Author Options:

Could i replace this 555 in this circuit with an arduino? Answered


n this could i replace the 55 timer this with a arduino?
If so what would the code be? If not could you atleast tell me what kind of wave the 555 is producing so that i can emulate the same with an arduino?

The circuit in question is for a 12 VDC flourocent lamp driver


It'll be a fairly high frequency square wave. The code just needs the "timer" unit loaded, and you can drive a pin from that.

What a waste of a processor though......

So i downloaded the frequency timer.zip file from


Then i extracted it in arduino-0022/libraries but i still get this error

sketch_jul31a.cpp:1:29: error: FrequencyTimer2.h: No such file or directory
sketch_jul31a.cpp: In function 'void setup()':
sketch_jul31a:3: error: 'FrequencyTimer2' has not been declared
sketch_jul31a:4: error: 'FrequencyTimer2' has not been declared

Two things:
1.) Where did you put the files, it should be in "libraries"
2.) Once it is, open the FrequencyTimer2.h file in wordPad or some other text editor.

At the top of the file there is a line
#include <wiring.h>

Comment it out like this:
//#include <wiring.h>
and add the line

#include <WProgram.h>
underneath it.


I guess at a cost and with different connections AND you would need to be able to programme it in C++ AND it will be bigger than the 555 AND microprocessors are notorious for being upset by high frequency changing wave forms even when they generate them.

Well, unless the OPs more specific, there are about 5 lines of code needed to do this.

#include <FrequencyTimer2.h>
void setup() {
void loop ( ) {}

I lied. 6.

(well, in C...)

Can certainly be done. Will cost you more cash and more effort.

Of course if you have some reason for wanting to be able to vary the frequency programmatically, an Arduino might make sense.