Author Topic: Arduino interrupter  (Read 529 times)

Offline octopus1

  • High Voltage Enthusiast
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Arduino interrupter
« on: November 09, 2020, 03:19:14 PM »
Hello! I am almost done with my arduino interrupter (photos soon). It has two modes, pwm and music. it can create a pwm signal with a adjustable duty cycle of 3% to 10% and frequencies from htz to 100htz. the midi mode samples a music input, looks for peaks and pitch in the music and generators a pwm signal. it transmits this signal over a industrial fiber optic transmitter. Any suggestions would be appreciated!

Offline acobaugh

  • High Voltage Enthusiast
  • *
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Arduino interrupter
« Reply #1 on: November 10, 2020, 03:25:28 AM »
I'd be interested in this once you have a wiring diagram and code to share. I started down the path of building one last year, but never completed it.

Offline Zipdox

  • High Voltage Technician
  • ***
  • Posts: 129
  • Karma: +1/-0
    • View Profile
    • Zipdox
Re: Arduino interrupter
« Reply #2 on: November 10, 2020, 01:11:18 PM »
I think the code is more interesting than the hardware.

Offline octopus1

  • High Voltage Enthusiast
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: Arduino interrupter
« Reply #3 on: November 10, 2020, 07:36:25 PM »
as promised heres a small video and the code

(secondary coil in the background  :) )


green light is just a visual
red light is the end of the fiber


playing music off youtube


it doesn't look like a square wave on the scope but it is!


both visual green led and transmitter are on pin 12, anolog in from my computers audio jack is pin A0.


Im using a ife96e transmitter



boolean clipping = 0;


//storage variables
byte newData = 0;
byte prevData = 0;


void setup(){
 
  pinMode(13,OUTPUT);//led indicator pin
  pinMode(12,OUTPUT);//slope indicator
 
  cli();
 
  //set up continuous sampling of analog pin 0
 
 
  ADCSRA = 0;
  ADCSRB = 0;
 
  ADMUX |= (1 << REFS0);
  ADMUX |= (1 << ADLAR);
  ADCSRA |= (1 << ADPS2) | (1 << ADPS0);
  ADCSRA |= (1 << ADATE);
  ADCSRA |= (1 << ADIE);
  ADCSRA |= (1 << ADEN);
  ADCSRA |= (1 << ADSC);
 
  sei();//enable interrupts
}


ISR(ADC_vect) {


  prevData = newData;
  newData = ADCH;
  if (newData > prevData){
    PORTB |= B00010000;
  }
  else if (newData < prevData){
    PORTB &= B11101111;
  }
 
 
  if (newData == 0 || newData == 1023){
    PORTB |= B00100000;
    clipping = 1;
  }
}


void loop(){
  if (clipping){
    PORTB &= B11011111;
    clipping = 0;
  }


  delay(100);
}


Offline Max

  • High Voltage Technician
  • ***
  • Posts: 131
  • Karma: +10/-0
  • "With the first link, the chain is forged. [...]"
    • View Profile
    • My Youtube Channel
Re: Arduino interrupter
« Reply #4 on: November 11, 2020, 12:22:32 AM »
I'd love to see the video. Unfortunately there's none as far as I can see...  ???
What surprises me a bit is that the unfiltered differentiation results in meaningful ontimes. I'd expect a very very "noisy" signal. Or in more appropriate terms for a digital signal: I'd expect it to jump permanently between low and high - in average it should equal to the actual derivative of the input signal. This is probably fine for an SSTC but if it actually looks like what I described it's not suited for DRSSTCs.
Another issue - again more for DRSSTCs than SSTCs: you have no control over the duty cycle. In theory the derivative should be DC-free, which means as much as your signal should be exactly 50% duty cycle.

Considering those limitations I wonder what are the advantages and disadvantages of this solution compared to a (simpler?) "analog-to-pwm interrupter" - which again should work fine for SSTCs but not for DRSSTCs.

Small but important note about the code: global variables that are used inside the ISR must be declared as "volatile". Because the compiler can't know when the ISR is called it can't know when it is safe to use the cached variable and when it should (re)load it from memory. "volatile" tells the compiler to always assume it got changed since the last access (which is exactly what an ISR causes: unpredictable changes at any moment) and the compiler will always load it properly from memory. For simple programs and with no optimization active it may work without this but you really don't want to rely on that.
I don't know if it's visible in reality but as far as I can tell the clipping LED won't blink the same every time. since the delay in your loop is independant of the clipping detection the LED will actually be on for any random amount of time between 0 and 100ms. Reason: the interrupt that sets "clipping" to "true" can happen at any time within the "delay(100)". The LED will be on for the - random - remaining time only. If you want the LED to be on for exactly 100ms, put the delay(100) at the beginning of your if, before you turn the pin off. What's the effect? When - and only when - clipping is detected (LED is on) the delay starts. So every time clipping occurs a "fresh" delay will start and you'll always get a 100ms blink.


Kind regards,
Max

Offline octopus1

  • High Voltage Enthusiast
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: Arduino interrupter
« Reply #5 on: November 11, 2020, 04:57:29 AM »
shoot i kinda just pushed all of that out of my mind lol, back to the draw.. coding board.

Offline octopus1

  • High Voltage Enthusiast
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: Arduino interrupter
« Reply #6 on: November 12, 2020, 04:31:03 AM »
okay new code, but my 1$ ardiuno kind exploded, so ill post the code when i can test it. it has pw control and actual midi shit (mostly stolen from the 4hv post)

Offline Max

  • High Voltage Technician
  • ***
  • Posts: 131
  • Karma: +10/-0
  • "With the first link, the chain is forged. [...]"
    • View Profile
    • My Youtube Channel
Re: Arduino interrupter
« Reply #7 on: November 14, 2020, 10:09:22 PM »
Arduino exploded?! How did you manage that?  :o

TBH I feel a little bad. While I was sceptical about your initial code I really hoped this would evolve into a usable (and controllable) audio interrupter. By now there're a couple MIDI interrupters available - all with different pros and cons, but there aren't many audio interrupters at all. That made your initial project so exciting IMO and the last thing I wanted is to stop you from making improvements.
Another reason why this interested me is that eventually I want to implement an audio interrupter mode on my Syntherrupter.

Nonetheless I'm looking forward to seeing your results! :)


Kind regards,
Max

Offline octopus1

  • High Voltage Enthusiast
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: Arduino interrupter
« Reply #8 on: November 16, 2020, 08:53:03 PM »
hello! new arduino arrived today (got another 1$ one lol) gonna work on writing some more code and then i should be done. trying to make this as simple as possible (no external components, just a arduino, fiber, and audio jack) to make it more useable for beginners. the one that i tied form the 4hv post didn't work in the slightest lol. dont know why im getting .05v output instead of 5v, that really my only problem right now, gonna need to find a way to internal amplify the signal from the audio jack (because i managed to step on and kill my last op amp and also becuase i hate tiny ics and have no breadboard)

      reagards, octopus

High Voltage Forum

Re: Arduino interrupter
« Reply #8 on: November 16, 2020, 08:53:03 PM »

 


* Recent Topics and Posts

post Re: Have you ever tripped a breaker during normal operation ?
[Dual Resonant Solid State Tesla coils (DRSSTC)]
panjaksli
December 02, 2020, 08:57:34 PM
post Re: Have you ever tripped a breaker during normal operation ?
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
December 02, 2020, 08:17:09 PM
post Re: mini tesla (hopefully not a fail)
[Beginners]
davekni
December 02, 2020, 08:12:55 PM
post Re: Have you ever tripped a breaker during normal operation ?
[Dual Resonant Solid State Tesla coils (DRSSTC)]
panjaksli
December 02, 2020, 07:34:53 PM
post Re: HF Litz wire as a primary coil
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
December 02, 2020, 07:14:18 PM
post Re: Have you ever tripped a breaker during normal operation ?
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
December 02, 2020, 07:05:18 PM
post Re: Have you ever tripped a breaker during normal operation ?
[Dual Resonant Solid State Tesla coils (DRSSTC)]
panjaksli
December 02, 2020, 06:58:40 PM
post Re: Have you ever tripped a breaker during normal operation ?
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Max
December 02, 2020, 06:56:50 PM
post Re: Have you ever tripped a breaker during normal operation ?
[Dual Resonant Solid State Tesla coils (DRSSTC)]
profdc9
December 02, 2020, 06:20:35 PM
post Re: Have you ever tripped a breaker during normal operation ?
[Dual Resonant Solid State Tesla coils (DRSSTC)]
panjaksli
December 02, 2020, 05:24:23 PM
post Re: Have you ever tripped a breaker during normal operation ?
[Dual Resonant Solid State Tesla coils (DRSSTC)]
buchtawill
December 02, 2020, 03:25:59 PM
post Re: Have you ever tripped a breaker during normal operation ?
[Dual Resonant Solid State Tesla coils (DRSSTC)]
panjaksli
December 02, 2020, 03:02:01 PM
post Have you ever tripped a breaker during normal operation ?
[Dual Resonant Solid State Tesla coils (DRSSTC)]
panjaksli
December 02, 2020, 01:36:04 PM
post Re: mini tesla (hopefully not a fail)
[Beginners]
bogdan
December 02, 2020, 08:55:06 AM
post Re: HF Litz wire as a primary coil
[Dual Resonant Solid State Tesla coils (DRSSTC)]
johnf
December 02, 2020, 07:43:14 AM
post Re: How to design FPGA based on EDA technology?
[Electronic Circuits]
Genterman
December 02, 2020, 06:53:52 AM
post Re: DRSSTC trouble
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
December 02, 2020, 03:29:14 AM
post Re: DRSSTC trouble
[Dual Resonant Solid State Tesla coils (DRSSTC)]
buchtawill
December 02, 2020, 02:43:33 AM
post Re: SKP DRSSTC = aliexpress driver + medium coil + large bricks ;)
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Maju
December 01, 2020, 10:44:31 PM
post Re: mini tesla (hopefully not a fail)
[Beginners]
davekni
December 01, 2020, 07:44:14 PM
post Re: transistor markings question
[Beginners]
davekni
December 01, 2020, 07:39:48 PM
post Re: HF Litz wire as a primary coil
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
December 01, 2020, 07:38:53 PM
post Re: How to design FPGA based on EDA technology?
[Electronic Circuits]
petespaco
December 01, 2020, 06:30:33 PM
post Re: Question about arduino polyphonic MIDI interrupter
[Dual Resonant Solid State Tesla coils (DRSSTC)]
bozidar
December 01, 2020, 04:58:29 PM
post Re: Question about arduino polyphonic MIDI interrupter
[Dual Resonant Solid State Tesla coils (DRSSTC)]
TMaxElectronics
December 01, 2020, 04:22:10 PM
post Re: Question about arduino polyphonic MIDI interrupter
[Dual Resonant Solid State Tesla coils (DRSSTC)]
bozidar
December 01, 2020, 03:02:51 PM
post Re: Half-brigde with pot on mosfet gates question
[Solid State Tesla Coils (SSTC)]
TMaxElectronics
December 01, 2020, 12:08:56 PM
post transistor markings question
[Beginners]
NOOBPASTE51
December 01, 2020, 12:02:19 PM
post Re: Question about arduino polyphonic MIDI interrupter
[Dual Resonant Solid State Tesla coils (DRSSTC)]
TMaxElectronics
December 01, 2020, 11:55:01 AM
post Re: HF Litz wire as a primary coil
[Dual Resonant Solid State Tesla coils (DRSSTC)]
TMaxElectronics
December 01, 2020, 11:50:19 AM
post Re: Analog HFBR amplifier
[Electronic Circuits]
TMaxElectronics
December 01, 2020, 11:21:56 AM
post Half-brigde with pot on mosfet gates question
[Solid State Tesla Coils (SSTC)]
costas_p
December 01, 2020, 11:17:16 AM
post Re: Question about arduino polyphonic MIDI interrupter
[Dual Resonant Solid State Tesla coils (DRSSTC)]
bozidar
December 01, 2020, 11:11:50 AM
post Re: mini tesla (hopefully not a fail)
[Beginners]
bogdan
December 01, 2020, 09:29:24 AM
post Re: HF Litz wire as a primary coil
[Dual Resonant Solid State Tesla coils (DRSSTC)]
johnf
December 01, 2020, 07:03:56 AM
post Re: How to design FPGA based on EDA technology?
[Electronic Circuits]
johnf
December 01, 2020, 06:49:26 AM
post Re: SSTC or DRSSTC with GaN Transistors
[Solid State Tesla Coils (SSTC)]
Steve Ward
December 01, 2020, 04:59:28 AM
post How to design FPGA based on EDA technology?
[Electronic Circuits]
Genterman
December 01, 2020, 04:02:06 AM
post Re: DRSSTC trouble
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
December 01, 2020, 03:46:10 AM
post Re: DRSSTC trouble
[Dual Resonant Solid State Tesla coils (DRSSTC)]
buchtawill
December 01, 2020, 02:00:54 AM
post Re: HF Litz wire as a primary coil
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Steve Ward
December 01, 2020, 01:47:10 AM
post Re: DRSSTC trouble
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
December 01, 2020, 12:02:23 AM
post Re: Site Info desperately needed: http://www.stevehv.4hv.org/
[General Chat]
Mads Barnkob
November 30, 2020, 10:28:56 PM
post Re: I started making a drsstc
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Miki_407
November 30, 2020, 08:58:41 PM
post DRSSTC trouble
[Dual Resonant Solid State Tesla coils (DRSSTC)]
buchtawill
November 30, 2020, 08:53:00 PM
post Re: I started making a drsstc
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
November 30, 2020, 08:49:30 PM
post Re: Simple H-Bridge construction with low parasitic inductances (for SSTC or ...)
[Beginners]
davekni
November 30, 2020, 08:45:46 PM
post Re: mini tesla (hopefully not a fail)
[Beginners]
davekni
November 30, 2020, 06:56:13 PM
post Re: I started making a drsstc
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Miki_407
November 30, 2020, 01:16:04 PM
post Re: I started making a drsstc
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Mads Barnkob
November 30, 2020, 12:56:05 PM

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 
SimplePortal 2.3.6 © 2008-2014, SimplePortal