The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
I have heard, there has to be a certain way I should wire an LED (10mm 3.5-4.0v) to the Netduino safely. If someone could help me picture what I have to put together that would be great!
-Cwbh
I have heard, there has to be a certain way I should wire an LED (10mm 3.5-4.0v) to the Netduino safely. If someone could help me picture what I have to put together that would be great!
-Cwbh
I've hooked up one of those straight into 3.3V and an OutputPort, but I've also heard that this isn't suggested so I'll attach a schematic of what is (I'm 90% sure) a 'safe' way to do it. I personally think that unless you got a bunch of LEDs you don't have to use transistors, but I could be wrong.... I guess until you hear from Chris or another member that knows a lot about this stuff then its best to stay on the safe side?
In addition to the resistor limiting the current drawn from the netduino, you'll need one to limit the current flowing through the led. The value depends on the supply voltage, forward voltage of the led and the current required to illuminate it. It's not quite as simple as providing it with s certain voltage.
I'm sure a quick search will provide a better explanation of the theory and formula for the resistor value than I can type on my phone keyboard.
Also, in addition to what Fred said, I generally like to have the "load" on the collector side of the transistor, otherwise the load gets involved in the base-emitter current, which can complicate things. So, now with an extra resistor, and the load on the collector side, a diagram:
I would use a 1k transistor to the base, which (using V=IR) works out to a safe 3.3ma (I=V/R, or IB = 3.3v/1000, which is .0033 amps, which is 3.3ma) current from the netduino pin, and a 220k resistor for the LED load, limiting the current to 15ma (IC = 3.3v/220) which should be safe for most leds, but possibly a little dim. (Check your LED specs)
The specs of the netduino:
max current: 8 mA per pin
digital pins 2, 3, 7: 16 mA per pin
analog pins 0-3: 2 mA per pin
microcontroller max current: 200 mA total
8ma and 16ma are a little "low" for driving many LEDs.. the "standard" i remember from way back for LEDs is 21ma, but there are many different leds out there, and some are much brighter and draw much more current. So, to avoid burning out your netduino's pins, you should probably use a transistor. (certainly I and others have been driving leds directly, but...) Also, this kind of circuit is an easy way to learn about transistors, and with an added diode for safety you can drive motors, relays, etc.
also, i just realized, the OP was using a 10mm 3.5-4v LED, which is higher than the 3.3v of the outputs, so my circuit should probably have the collector side hooked to 5v instead of 3.3v.
I just attach LEDs to a digital i/o and then a ground pin, but I still need to get a breadboard. Maybe that's not the way with a 10mm one.
neonsonicboy - betaarchive.co.uk VIP member - Netduino owner Follow me on Twitter! | Find me in irc.aurora-irc.eu #aniboshi [often but not always] | Also known as ntkrpamp on IRC channels | I don't post here much but I visit often.
I just attach LEDs to a digital i/o and then a ground pin, but I still need to get a breadboard. Maybe that's not the way with a 10mm one.
You're probably "ok" doing this, but not too many LEDs draw less than 8ma, so you are theoretically risking running outside of the specs and burning out your netduino, if you are using one of the 8ma or 16ma pins. You should probably use some kind of resistor, regardless.
Thanks for the diagram Bill! Though, I am using my motor project code, using PWM in D6. Doesn't turn on. I also am using a 100k Ohm resistor as I don't have a 220k at the moment.
Is there a way to use an OutPutPort? What is D0?
-Cwbh
You got it working with a motor as I remember -- have you substituted the motor with an LED, now? It should work, assuming you have the LED oriented properly?
I would start using any output port, such as D0, which is the most upper-right pin on the netduino. Once you get it working, then move on to PWM.
I see you are in NYC, do you have a car? I'm joining a hackerspace in Highland Park, NJ, which is about 1/2 way from NYC, id be happy to get together and work on some stuff.
Your previous thread:
http://forums.netdui...ch__1#entry4823
This time I used a normal PNP transistor rather than the Darlington 120. It is about 40 Miles from my house . To be honest I am a student, and I'm only a few years (Soon) until I can drive. I looked at Lawrenceville school actually (I see you are in Princeton). I might join the Brooklyn one, as it seems close(er). I really like Scott's Morse Code Code, which I will probably use for this project, along with the led and other stuff .
-Cwbh