A better flasher
Ok, so in my previous blog entry I talked about the fun I had fine tuning my single LED flasher for my little solar / battery relay controller. Well, as it turns out what I produced wasn't the best idea I've had all week.I went back to my CAD software (Eagle) to update the schematic only to realize the original 555 based implementation had the two blue LEDs in parallel. Yep, darn, I didn't even give the second LED a thought - I could have stuck with a traditional flip-flop after all. Furthermore, my original schematic had the ULN2003 wired incorrectly so as a bonus I've also realized I don't need the original zener diode either. My circuit already has a 5v rail that will be provided by the Arduino.
So, being the perfectionist I am, I went back to the breadboard and put together a basic flip flop (almost identical to the previous circuit) and played around with different resistor / capacitor combinations to see how close I could get to a 1Hz flash rate. Based on the parts I had available I ultimately decided to stick with the standard 10K resistor and 100uF capacitor (provided a rate of 1.07Hz).
While I had all the gear out I thought I'd also optimize the current flowing through each LED. I measured around 5.2v from my power source (my test setup was using a 12v source and a 5.1v zener) and found the LED had 3.3v across its pins (I expected it to be around 3.2v). This leaves 1.9v so for a maximum current of 20mA I would require 95ohms between +VCC and the transistor's collector (with 100ohms being the closest available). I decided to halve the maximum current and use a 200ohm resistor instead. I put it all together and measured the current between the transistor's emitter and the LED's anode - it was spot on 10mA.
Below is the oscilloscope's output, the updated circuit and a small video showing the flashing LED (I used two inputs of a tri-colour LED to emulate two individual LED's.
No comments:
Post a Comment