Hello, I have an arduino uno with a relay shield attemting to make an automatic transmission controller. The shield has 4 10amp (at 12v) max the board powered by the 5v pin on the arduino. The relay coils are switched by what appears to be optoisolators connected to the digital pins. There are 2 other things in my project drawing current. I don't really know what to call them... they are like a chain of voltage dividers attached to switches (so you can use one analog pin to read multiple switches) Anyway on the test bench without both voltage dividers hooked up everything appears to work fine. I say without them both hooked up because I don't think I ever did a full test on the bench seeing how the transmission is in a truck and that would be borderline impossible. Anyway, everything appears to work fine, it can shift right through the gears etc... On the bench the board is operating on 12vdc... in the truck it is more like 13.8vdc which is a little higher than recommended. When i try to shift to second gear the relay board clicks on and off over and over... I believe the entire arduino is clicking on and off but its hard to tell... Some of the lights on the arduino itsself light up halfway some all the way. Now the relay states are as follows in first : on off on on and in second: on on on on... so there is max current draw in second. My question is, what is my arduino doing? Is it just freaking out because there is too much current draw through the 5v pin or is something else wrong. Can post code if needed, but i doubt it has anything to do with it because it works fine on the bench. (plus the code is really wrong and prob poorly written) Thanks for any help!
Are you sure this board is supposed to powered off the Arduino pins? The relay shields I know of require a separate 7.5 - 12 volt power supply.
Hmm did not know that. It appears to work off of 5v... but then again all it says on the pin is vcc so i dont really know. Did not come with a spec sheet but here is a link to the item on ebay. http://www.ebay.com/itm/Brand-New-4-Channel-5V-Relay-Module-Arduino-PIC-ARM-AVR-DSP-Free-Shipping-/110860745877?pt=LH_DefaultDomain_0&hash=item19cfd0bc95
Just looked up the part number on the relay and it appears to use a 5v coil.
Max milliamp draw per pin on the Uno is 40ma. That should give you a max of 200 ma total.
The specs say that Each 5V Relay need 20mA driving current
see I'm thinking each relay uses 20ma from the vcc pin... meaning when all 4 are on it is drawing 80ma from the 5v pin on the arduino.
Is the max current on the 5v pin on the arduino also 20ma?
No, max current is 40ma on each arduino pin. Also, check for shorts and bad connections with a meter.
I thought absolute max was 40ma but recommended was 20ma max? And I don't see how it could be a short if it works all the time on the bench.
Right, 40ma Per Pin Max. If it works fine on the bench and not in production then I would check for shorts and also, check voltages. If you are running on 13+ volts you may be over heating the lm7805. 13.5 volts is ok for that chip. However, it is recomended that if you are going to run more than 9 volts you should use a heat sink on it.
I have had plenty of problems like this, and found in most cases that just checking everything with my meter will give me the answer. Also, bad solder joints can cause higher amp draw (just like a bad connector can) I would also retouch any solder joints just to be sure.
I'm confused. You are telling me max for each pin is 40ma, including the 5v pin? This means my problem is clearly the overloading of the 5v pin. If the relay shield is drawing up to 80ma total it would be overloading the arduino alone. Plus I add the rest of my project and I am drawing roughly between 100 and 200ma from the one 5v pin on the arduino.
And I would say it needs a heat sink as it seems to get very warm to the touch.
That sounds like the right place to start then. Keep in mind that, shorts and bad grounds can cause high current draw also.
ok i will give it a shot. Thanks
I'm not sure how much of your system is being powered by the Arduino's 5V supply. It would be odd for a relay big enough to support 10A to have a small enough coil to be operated by 20mA and 5V. The presence of the optoisolators also suggests the relay coils are powered externally. However, the higher the supply voltage, the lower the peak current the 5V regulator can support before it overheats. Your symptoms suggest you may be hitting the limit at the higher voltage. In that case, you could resolve the problem by adding an external regulator to bring the 12v+ down to 7V or so. If you don't already have it, it would be worth adding some filtering on your supply to suppress the spikes on the incoming supply, which are likely to be quite nasty in an automotive environment.
PeterH:
I'm not sure how much of your system is being powered by the Arduino's 5V supply. It would be odd for a relay big enough to support 10A to have a small enough coil to be operated by 20mA and 5V. The presence of the optoisolators also suggests the relay coils are powered externally. However, the higher the supply voltage, the lower the peak current the 5V regulator can support before it overheats. Your symptoms suggest you may be hitting the limit at the higher voltage. In that case, you could resolve the problem by adding an external regulator to bring the 12v+ down to 7V or so. If you don't already have it, it would be worth adding some filtering on your supply to suppress the spikes on the incoming supply, which are likely to be quite nasty in an automotive environment.
See that is the first step I was planning on taking... I was either going to add a secondary 5v regulator or have an external regulator bringing all the voltage down. I will try the external regulator now that you have informed me of the relationship between supply voltage vs peak current. Thank you!
Without more info, it might be better to supply the relay board VCC via a separate 7805 regulator chip or a UBEC voltage regulator like below.
Without more info, it might be better to supply the relay board VCC via a separate 7805 regulator chip or a UBEC voltage regulator like below.
Ended up finding a LM7805 and a couple caps laying around last night and doing exactly what you have described... gotta wait until around the middle of the week before I can install it into the truck and see if it fixes the problem.