789Views8Replies

Author Options:

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

http://www.aaroncake.net/circuits/flampdrv.gif

I
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
Thanks

8 Replies

user
steveastrouk (author)2011-07-28

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

Select as Best AnswerUndo Best Answer

user
qwerty156 (author)steveastrouk2011-07-30

So i downloaded the frequency timer.zip file from

http://www.arduino.cc/playground/Code/FrequencyTimer2.zip

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

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)qwerty1562011-07-31

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.

Steve

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)qwerty1562011-07-31

Which chip are you using ? The 328 ?

Select as Best AnswerUndo Best Answer

user
rickharris (author)2011-07-28

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.

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)rickharris2011-07-28

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

Select as Best AnswerUndo Best Answer

user

#include <FrequencyTimer2.h>
void setup() {
pinMode(11,OUTPUT);
FrequencyTimer2::setPeriod(200);
FrequencyTimer2::enable();}
void loop ( ) {}



I lied. 6.

Select as Best AnswerUndo Best Answer

user
orksecurity (author)rickharris2011-07-28

(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.

Select as Best AnswerUndo Best Answer