Author Topic: Arduino interrupter  (Read 2394 times)

octopus1

  • Guest
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 Experimenter
  • **
  • Posts: 69
  • 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: 143
  • 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.

octopus1

  • Guest
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 Engineer
  • ****
  • Posts: 236
  • Karma: +28/-1
  • "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

octopus1

  • Guest
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.

octopus1

  • Guest
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 Engineer
  • ****
  • Posts: 236
  • Karma: +28/-1
  • "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

octopus1

  • Guest
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: How to get a GE Yokogawa AB40 Sync Scope to rotate without a powerplant.
[Laboratories, Equipment and Tools]
MRMILSTAR
Today at 05:24:19 AM
post Re: Difference between these transformers
[Transformer (Ferrite Core)]
Tesla Junior
Today at 04:24:09 AM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
Michelle_
Today at 04:20:35 AM
post Re: How to get a GE Yokogawa AB40 Sync Scope to rotate without a powerplant.
[Laboratories, Equipment and Tools]
Bobakman
Today at 04:05:28 AM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
alan sailer
Today at 04:03:54 AM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
Michelle_
Today at 03:19:19 AM
post Re: IKY150N65EH7, is it good for DRSSTC
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
Today at 03:09:29 AM
post Re: IKY150N65EH7, is it good for DRSSTC
[Dual Resonant Solid State Tesla coils (DRSSTC)]
unrealcrafter2
Today at 01:47:37 AM
post Re: How to get a GE Yokogawa AB40 Sync Scope to rotate without a powerplant.
[Laboratories, Equipment and Tools]
Bobakman
Today at 12:19:21 AM
post Re: How to get a GE Yokogawa AB40 Sync Scope to rotate without a powerplant.
[Laboratories, Equipment and Tools]
klugesmith
April 18, 2024, 11:33:01 PM
post Re: How to get a GE Yokogawa AB40 Sync Scope to rotate without a powerplant.
[Laboratories, Equipment and Tools]
Bobakman
April 18, 2024, 11:15:15 PM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
davekni
April 18, 2024, 10:59:36 PM
post Re: What actually kills MOSFETs?
[Beginners]
unrealcrafter2
April 18, 2024, 10:03:48 PM
post Re: How to get a GE Yokogawa AB40 Sync Scope to rotate without a powerplant.
[Laboratories, Equipment and Tools]
klugesmith
April 18, 2024, 09:53:25 PM
post Re: Welcome new members, come say hello and tell a little about yourself :)
[General Chat]
unrealcrafter2
April 18, 2024, 09:50:09 PM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
Michelle_
April 18, 2024, 09:15:55 PM
post Re: 100kHz CM300 gate resistor choice
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Mads Barnkob
April 18, 2024, 08:50:49 PM
post Re: 100kHz CM300 gate resistor choice
[Dual Resonant Solid State Tesla coils (DRSSTC)]
unrealcrafter2
April 18, 2024, 08:11:27 PM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
davekni
April 18, 2024, 07:28:05 PM
post Re: How to get a GE Yokogawa AB40 Sync Scope to rotate without a powerplant.
[Laboratories, Equipment and Tools]
Bobakman
April 18, 2024, 06:30:30 PM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
Michelle_
April 18, 2024, 06:03:57 PM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
Michelle_
April 18, 2024, 05:26:13 PM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
NyaaX_X
April 18, 2024, 04:03:38 PM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
Michelle_
April 18, 2024, 02:56:40 PM
post Re: DIY induction guns? (warning:long)
[Induction Launchers, Coil Guns and Rails guns]
Benbmw
April 18, 2024, 06:17:15 AM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
Michelle_
April 18, 2024, 05:46:07 AM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
MRMILSTAR
April 18, 2024, 05:18:31 AM
post Re: IKY150N65EH7, is it good for DRSSTC
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
April 18, 2024, 04:34:52 AM
post Re: How to get a GE Yokogawa AB40 Sync Scope to rotate without a powerplant.
[Laboratories, Equipment and Tools]
klugesmith
April 18, 2024, 04:11:53 AM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
Michelle_
April 18, 2024, 04:02:44 AM
post Re: 100kHz CM300 gate resistor choice
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
April 18, 2024, 03:35:52 AM
post Re: How to get a GE Yokogawa AB40 Sync Scope to rotate without a powerplant.
[Laboratories, Equipment and Tools]
MRMILSTAR
April 17, 2024, 11:54:05 PM
post 100kHz CM300 gate resistor choice
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Benjamin Lockhart
April 17, 2024, 11:37:16 PM
post Re: Has anyone tried to build a TMT (extra coil) Tesla coil?
[General Chat]
Michelle_
April 17, 2024, 02:29:30 AM
post Re: Has anyone tried to build a TMT (extra coil) Tesla coil?
[General Chat]
MRMILSTAR
April 16, 2024, 11:56:12 PM
post Re: How to get a GE Yokogawa AB40 Sync Scope to rotate without a powerplant.
[Laboratories, Equipment and Tools]
klugesmith
April 16, 2024, 11:46:57 PM
post Re: How to get a GE Yokogawa AB40 Sync Scope to rotate without a powerplant.
[Laboratories, Equipment and Tools]
Bobakman
April 16, 2024, 10:40:11 PM
post Has anyone tried to build a TMT (extra coil) Tesla coil?
[General Chat]
Michelle_
April 16, 2024, 09:21:39 PM
post Re: Medium Drsstc question
[Dual Resonant Solid State Tesla coils (DRSSTC)]
flyingperson23
April 16, 2024, 08:04:16 PM
post Re: First DRSSTC SKM100
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Benjamin Lockhart
April 16, 2024, 06:48:05 PM
post Re: Game changing tesla coil secondary winding suggestions
[General Chat]
Michelle_
April 16, 2024, 06:18:40 PM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
Michelle_
April 16, 2024, 06:14:53 PM
post Re: 3D printed mini-slayer: world's weakest tesla coil
[Solid State Tesla Coils (SSTC)]
unrealcrafter2
April 16, 2024, 05:44:44 PM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
MRMILSTAR
April 16, 2024, 03:12:12 PM
post Re: Drsstc voltage spike question
[Dual Resonant Solid State Tesla coils (DRSSTC)]
unrealcrafter2
April 16, 2024, 02:28:01 PM
post Re: First DRSSTC SKM100
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Saattvik24
April 16, 2024, 01:56:26 PM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
Michelle_
April 16, 2024, 06:50:47 AM
post Re: IKY150N65EH7, is it good for DRSSTC
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Anders Mikkelsen
April 16, 2024, 04:57:47 AM
post Re: IKY150N65EH7, is it good for DRSSTC
[Dual Resonant Solid State Tesla coils (DRSSTC)]
ethanwu0131
April 16, 2024, 03:40:53 AM
post Re: First DRSSTC SKM100
[Dual Resonant Solid State Tesla coils (DRSSTC)]
flyingperson23
April 16, 2024, 01:31:17 AM
post Re: Game changing tesla coil secondary winding suggestions
[General Chat]
Michelle_
April 15, 2024, 11:19:52 PM
post 3D printed mini-slayer: world's weakest tesla coil
[Solid State Tesla Coils (SSTC)]
Michelle_
April 15, 2024, 11:10:19 PM
post Re: Game changing tesla coil secondary winding suggestions
[General Chat]
alan sailer
April 15, 2024, 11:04:19 PM
post Re: Ignitron trigger drive ideas?
[Capacitor Banks]
Twospoons
April 15, 2024, 11:02:05 PM
post Re: Game changing tesla coil secondary winding suggestions
[General Chat]
Michelle_
April 15, 2024, 10:57:59 PM
post Re: Game changing tesla coil secondary winding suggestions
[General Chat]
Michelle_
April 15, 2024, 10:55:46 PM
post Re: Return of Electronics Flea Market in "Silicon Valley"
[Sell / Buy / Trade]
klugesmith
April 15, 2024, 10:37:32 PM
post Re: First DRSSTC SKM100
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Saattvik24
April 15, 2024, 10:05:00 PM
post Re: How to get a GE Yokogawa AB40 Sync Scope to rotate without a powerplant.
[Laboratories, Equipment and Tools]
MRMILSTAR
April 15, 2024, 09:28:50 PM
post Ignitron trigger drive ideas?
[Capacitor Banks]
klugesmith
April 15, 2024, 09:06:42 PM
post Re: First DRSSTC SKM100
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Mads Barnkob
April 15, 2024, 08:46:32 PM
post Re: Game changing tesla coil secondary winding suggestions
[General Chat]
Benbmw
April 15, 2024, 08:38:39 PM
post Re: Game changing tesla coil secondary winding suggestions
[General Chat]
sky-guided
April 15, 2024, 08:23:40 PM
post How to get a GE Yokogawa AB40 Sync Scope to rotate without a powerplant.
[Laboratories, Equipment and Tools]
Bobakman
April 15, 2024, 06:43:23 PM
post Re: First DRSSTC SKM100
[Dual Resonant Solid State Tesla coils (DRSSTC)]
flyingperson23
April 15, 2024, 06:29:10 AM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
Michelle_
April 15, 2024, 05:21:53 AM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
Michelle_
April 15, 2024, 05:15:33 AM
post Re: First DRSSTC SKM100
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
April 15, 2024, 04:07:54 AM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
davekni
April 15, 2024, 03:49:03 AM
post Re: Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
alan sailer
April 14, 2024, 09:46:30 PM
post Small-ish 3D printed SGTC via cheap ZVS flyback build, humbly asking a couple ?s
[Spark Gap Tesla Coils (SGTC)]
Michelle_
April 14, 2024, 07:31:00 PM
post Re: First DRSSTC SKM100
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Saattvik24
April 14, 2024, 02:26:19 PM
post Re: mg75q2ys40 IGBT
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Mads Barnkob
April 14, 2024, 07:20:54 AM
post Re: IKY150N65EH7, is it good for DRSSTC
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Mads Barnkob
April 14, 2024, 07:18:20 AM
post Re: Game changing tesla coil secondary winding suggestions
[General Chat]
Michelle_
April 13, 2024, 06:46:40 AM
post Re: Game changing tesla coil secondary winding suggestions
[General Chat]
Michelle_
April 13, 2024, 04:18:42 AM
post Re: Upper and Lower Explosive Limits on Confined Flammable Vapors at -79 C.
[General Chat]
alan sailer
April 13, 2024, 03:24:20 AM
post Re: Game changing tesla coil secondary winding suggestions
[General Chat]
alan sailer
April 13, 2024, 03:20:46 AM
post Game changing tesla coil secondary winding suggestions
[General Chat]
Michelle_
April 13, 2024, 03:13:22 AM
post Re: Capacitor Blowout
[Sell / Buy / Trade]
lbattraw
April 12, 2024, 09:14:58 PM
post mg75q2ys40 IGBT
[Dual Resonant Solid State Tesla coils (DRSSTC)]
thedark
April 12, 2024, 08:40:18 PM
post Re: UD 2.7 OCD LED stays on, no output during inital test
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
April 12, 2024, 07:20:30 PM
post Re: Mosfet Buffer Stage Questions
[Beginners]
davekni
April 12, 2024, 07:12:43 PM
post IKY150N65EH7, is it good for DRSSTC
[Dual Resonant Solid State Tesla coils (DRSSTC)]
ethanwu0131
April 12, 2024, 04:47:33 PM
post Re: UD 2.7 OCD LED stays on, no output during inital test
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Admiral Aaron Ravensdale
April 12, 2024, 11:43:36 AM
post Mosfet Buffer Stage Questions
[Beginners]
Egg
April 12, 2024, 12:49:02 AM
post Re: UD 2.7 OCD LED stays on, no output during inital test
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
April 12, 2024, 12:41:16 AM
post Re: Plasma Torid - Class E Self Resonant Dual/Stereo - Plasma Torid Build
[Dual Resonant Solid State Tesla coils (DRSSTC)]
davekni
April 12, 2024, 12:22:41 AM
post Re: Capacitor Blowout
[Sell / Buy / Trade]
Michelle_
April 11, 2024, 10:45:53 PM
post Re: UD 2.7 OCD LED stays on, no output during inital test
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Admiral Aaron Ravensdale
April 11, 2024, 07:39:30 PM
post Re: UD 2.7 OCD LED stays on, no output during inital test
[Dual Resonant Solid State Tesla coils (DRSSTC)]
flyingperson23
April 11, 2024, 07:24:52 PM
post Re: Tesla coil safety questions, risk analysis quantified
[Beginners]
sky-guided
April 11, 2024, 06:09:30 PM
post UD 2.7 OCD LED stays on, no output during inital test
[Dual Resonant Solid State Tesla coils (DRSSTC)]
Admiral Aaron Ravensdale
April 11, 2024, 12:55:16 PM
post Re: Plasma Torid - Class E Self Resonant Dual/Stereo - Plasma Torid Build
[Dual Resonant Solid State Tesla coils (DRSSTC)]
alan sailer
April 11, 2024, 03:40:00 AM
post Re: Plasma Torid - Class E Self Resonant Dual/Stereo - Plasma Torid Build
[Dual Resonant Solid State Tesla coils (DRSSTC)]
sky-guided
April 11, 2024, 03:05:07 AM
post Re: Tesla coil safety questions, risk analysis quantified
[Beginners]
Michelle_
April 11, 2024, 02:57:33 AM
post Re: Tesla coil safety questions, risk analysis quantified
[Beginners]
alan sailer
April 11, 2024, 01:44:32 AM
post Re: Tesla coil safety questions, risk analysis quantified
[Beginners]
Michelle_
April 11, 2024, 01:31:40 AM
post Re: Plasma Torid - Class E Self Resonant Dual/Stereo - Plasma Torid Build
[Dual Resonant Solid State Tesla coils (DRSSTC)]
OmGigaTron
April 11, 2024, 01:11:00 AM
post Re: Tesla coil safety questions, risk analysis quantified
[Beginners]
alan sailer
April 11, 2024, 12:58:52 AM

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