I'm building my first Arduino project, which is quite simple but yet offers some challenges for a newbie that I am. The case is simple: a sensor to trigger the LED lights from each end, and the LEDs go on one by one - then off one by one, depending on from which sensor it was triggered on. You've probably seen many such projects already.
However I would need some tips on what kind of sensors would you recommend? I would want to avoid light gates and pressure sensors, so something along detecting movement in the vicinity of the sensor (not further than 3 feet) would be ok. I have couple of Sharp GP2Y0A02YK0F available, would these do?
Another question really bugs me to even ask, but how do I calculate the power for the LEDs? I've got 16 bright LEDs that I control via Arduino Uno and 2 shift registers. Do I need some extra power for the complete project? I've only experimented with one shift register and 8 LEDs without problems, waiting for a shipment of miscellaneous chips and parts so I can try with another SR.
Power calculation depends on the wattage rating of the LED driver, voltage, and number of LEDs. 12 LEDs of 20mA each at 9VDC = 12 x 0.020 x 9 = 2.16W. I think that the MM5450/5451s can handle around 2.5W, total. You can add more MM5450/5451s, use less LEDs, use less voltage, use different components, redesign your circuit, etc. to get what you need. From experience, I can say that the 12VDC NorthStar LEDs, for example, at even 7.5VDC are probably bright enough for your application. Their 12VDC rating is to achieve the listed specs of brightness (in milli-candelas), and you may not really need that much light for your use.
Disclaimer: I have no affiliation with thekanes.org nor any manufacturer/seller of the NorthStar LED lights.
Thanks, daemon. I checked thekanes project and it provided again some nice ideas for Arduino projects in general
I'm not sure if I mentioned that I was planning to use just shift registers (74HC595) since I already got those and I'm having real hard time finding the MM5450/5451 LED drivers anywhere (in Europe at least).
I guess I'll be needing just two of those since I got 16 steps that I need to add LED on. I'll see if even 5V is enough, which makes 16 x 0.02mA * 5V = 1.6W. So I should be safe there, right?
I was just wondering how to calculate if I have for instance a load of shift registers for some reason, how much overhead these add to the power consumption. I might be asking really stupid questions here, so sorry about that
I also decided to add an ambient light sensor to see if the LEDs need to be triggered in the first place.
Jameco ships internationally and does have the MM5450 LED drivers. I think that it would probably simplify things to use a 5450 or 5451 because of the number of outputs on the chip (34 for the 5450; 35 for the 5451) and you would not need resistors in parallel with the LEDs. 16 LEDs would be quite easy, as long as you didn't exceed the 2.5W limit of the chip. A couple of the 74HC595 shift registers would also work and would just require the additional resistors.
You cannot power the LEDs from the Arduino pins, since the pins are only capable of 40mA and you need at least 320mA (16 x 0.02A = 0.320A). You also need to consider the power requirements for the sensors and the Arduino itself, depending on the model. A 5VDC or 6VDC, 1A power supply would probably be a good start. You could use the Arduino Line Out for getting the power or tap off of the incoming power supply.
Okay, I can't believe I typed that. Okay, so I'm not an EE. What I meant was that, in any event, you would not need the LED series resistors with an MM5450/5451.
Hey, no worries on the grammar - that I can handle, at least much better than my electronic skills XD
So indeed, the question I was after earlier but didn't quite explain it right was that no matter what I use to control the LEDs, I need to figure out how to calculate whether the Arduino and its power source can handle it.
Let's assume that I have Arduino plugged into plain USB port - or to an external 5V power. I can only get 40mA from each pin, right? But the overall consumption, say I want to use 5451 for example. How much can I suck through the Arduino board or do I have to have external power source for the LEDs and control it via Arduino, or was that what you meant by using the line out to control just that?
Ow, my brains. Too long without coffee. So I guess you meant that I could take the power for the LEDs from the power source directly or from the line out? I guess two power sources would be a tad bit overkill for a small project like this...
If you are bringing 5VDC in, you could tap into that either before the Arduino, or from the VIN pin of the Arduino, it does not matter. However, if you are using the +5V pin from the Arduino, it could make a difference, since it uses the Arduino's voltage regulator. VIN will provide the same current as the external power supply, bypassing the Arduino's voltage regulator. From the Arduino Uno description:
"VIN. The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin."
For what you are doing, as long as your external power source can provide enough current for everything, you can access it through the VIN. If you want to bring in 9VDC and use the 5VDC pin, you would need to decide if the Arduino voltage regulator can handle the current load, but using directly from VIN, you should have no problems.
Basically if you are powering from the USB port you have 500mA to play with, it you re powering it from the DC jack then you have about 640mA depending on the actual voltage. This is due to the power dissipation of the regulator http://www.thebox.myzen.co.uk/Tutorial/Power_Examples.html
The regulator itself is god for 1A but you won't get closer without a heat sink on it.