Hello all you experts. I am new to the forum, and sort of new to Arduino. I am a basic stamp guy from way back.
Using the blink example I can blink an LED just fine, but when I attach a flashlight (3volt 2 cell ) bulb in its place I get nothing (no light on or off), even without the resistor.
If I plug the bulb in to the 5V and ground it lights up just fine? I cannot understand this behavior.
I am using the usb to power my Arduino Duemilanove.
What am I missing here?
Here is my code:
int led = 3;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Pretty simple, but will not work with a flashlight bulb, what am I doing wrong??
Isn't a flashlight bulb going to draw massively more current than an Arduino pin can source? I would stop doing that if I were you, and switch it using a transistor instead.
If you are using the same current-limiting resistor you were using with the LED, probably nothing bad will happen. (The lamp may or may-not glow, depending on how much current is required to light it up.... I guess it's not going to glow...)
Without the resistor, you will (probably) draw escessive current from the Arduino, and you might damage it. The current required to damage the Arduino (more than 40mA) may or may-not be enough to light the lamp.
...a 3v flashlight bulb...
...If I plug the bulb in to the 5V and ground it lights up just fine
And it will be very bright (compared to 3V) and it won't last long! Power (Watts or milliwatts) increases with the square of the voltage. So, at 5V you are getting about 2.7 times as much power (and heat) from the bulb... i.e. A 1W bulb would be running at 2.7W.
Since LED's are polarized, unless I soldered them on to a base of some kind they could not be removed and re-inserted easily. Especially if you are having a spectator do it.
Also, I could not find any screw in colored low voltage LED's.
I know it is obvious, but this small project is a great learning experience for me. Lots going on here for coding and electronics as well.
I have to make a trip to radio shack today for some diodes and some transistors, but I have everything else. I will post some pictures of my finished product when I am closer.
radbrad:
Since LED's are polarized, unless I soldered them on to a base of some kind they could not be removed and re-inserted easily. Especially if you are having a spectator do it.
Also, I could not find any screw in colored low voltage LED's.
I guess there's ways to do it... OTOH people can relate to light bulbs (old tech) so maybe it's psychologically better to use them for the trick.
With small bulbs I'd be a teeny bit worried about people twisting too hard and breaking them.
Depending on the bulb your trying to use (and your soldering skills).... You could "convert" the bulb to LED. I did that with this bulb for my full-sized Maglight.
Just took the guts out of the normal bulb and soldered LED in its place. Even fit the current-limit resistor inside the base. Works great.
Very impressive 1ChicagoDave. What I will do is get it working. I have the screw in bulbs now. As they burn out I will replace them with the LED's. I could just break 4 of them but I want to get it working first.
I have nice screw in bases and want it to look fairly good. I don't think I could match your soldering skills though.
Thanks for the great idea though. I may steal you idea in the future.