3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

How do I program an Arduino to be used as an interrupter in a Solid State Tesla Coil?

I want to use an Arduino as the interrupter in my Dual Resonant Solid State Tesla Coil but I do not know how to program in Arduino (or any other programming language for that matter).  The rest of my gate driver (i am using an IGBT full bridge) is a 555 timer with equal on/off time generating pulses at the resonant frequency of the coil.  The output is split into 2 parts, 1 being the direct output from the 555 and the other being the output of the 555 connected to an inverter gate.  From there both inputs are fed into MOSFETs (or some other type of transistor, I just had some switching MOSFETs laying around) that have their gates controlled by the interrupter.  I want the Arduino to take the pulse from the 555, read its frequency with pulseIn, and then read a variable resistor on the analog pins whose value will be used as the duty cycle of the pulse generated by the interrupter expressed as a percentage.  The drains of the MOSFETs will then be connected to the gates of the IGBTs that will switch 900 volts from an inverter based around a transformer from a disposible camera flash board through the primary coil.  This is the last part of my driver and then I can build the coil and post the instructable for everyone to enjoy (hopefully, i am always open to constructive criticism).

5 answers
sort by: active | newest | oldest
Dec 3, 2009. 2:40 PMjohndavid400 says:
If you are just trying to convert an Analog reading from a potentiometer to a PWM value, you could use something like this code, but I don't think you can change the frequency while the code is running (you can set it in the setup() function), but you will change the duty-cycle with the potentiometer.  Or you can use PulseIn.

int potPin = 14;
int potVal = 0;
int outPin = 11;

int pulse_length = 0;
int 555_pin = 4;

void setup() {

/*
//You can change the PWM frequency of pin 11 here by changing the 0x01 setting
// check http://www.arduino.cc/playground/Main/TimerPWMCheatsheet for more
// uncomment the below line to change the frequency from 488Hz, to 32kHz
 //TCCR2B = TCCR2B & 0b11111000 | 0x01  
Serial.begin(9600);

pinMode(potPin, INPUT);
pinMode(outPin, OUTPUT);
pinMode(555_pin, INPUT);
}

void loop() {

potVal = analogRead(potPin) / 4;
 
/*this will return the length in Microseconds that the pulse is HIGH on digital pin 4 (with a timeout of 1000 microseconds) and store the pulse in variable "pulse_length", you do with it what you want from there:
*/
pulse_length = pulseIn(555_pin, HIGH, 1000)

analogWrite(outPin, potVal);

Serial.print(" potVal:  ");
Serial.print(potVal);
Serial.println("        ");

}
Mar 3, 2011. 2:24 AMcarnotricecooker says:
Hi, could you explain how an arduino can be programmed/ setup to audio modulate a solid state tesla coil and how PWM is involved? I essentially want my arduino to do this: http://www.youtube.com/watch?v=eSa0nGmHT8E. I'm currently building Steve Ward's Mini Solid State Tesla Coil: http://www.instructables.com/id/Building-a-solid-state-tesla-coil/?comments=all#CJPK7MSGKS0RPEX
Nov 24, 2009. 10:18 AMsteveastrouk says:
I don't see the point of the 555. The microcontroller can do it all, as far as I can see. Can you do a block diagram ?

Steve
Nov 28, 2009. 5:56 AMsteveastrouk says:
Well for a start look at IGBT/MOSFET driver chips - they're the interface from the micro to the power.

Atmegas ("arduinos") are not a processor family I have worked with, so I can't give you any specific code to help, but start by looking at the PWM modes the thing's internal timers offer. You can program the basic frequency of the PWM, and modulate the duty cycle - in fact the atmegas have 6 channels of PWM which can all be locked together in phase.

Steve

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!