I have a project with a hefty 24V battery to power 24v relays and loads. I was wondering if I can power the arduino from the 24V battery somehow, or if I'm better off with a separate 9v battery for the arduino. (And if I do that, I would presumably connect the negative terminals of the 24v and 9v batteries. Or would that be a bad idea?)
connect the negative terminals of the 24v and 9v batteries.
That would be the only way to make it work.
24V is a bit too high for the input of an arduino, You will need a regulator to get it down into the 12 to 7v5 region before you could plug it into the arduino power jack. This is your best solution.
In a pinch, you can make a voltage divider out of two 20-ohm 10-watt resistors, but that will drain your battery pretty fast, and make the resistors kinda warm.
Another possibility is to add another layer of regulator. An LM317 is good to 37V input, so you can use that to drop to 8V, then feed that into your Arduino.
Linear regulators are very inefficient in this type of application and will unnecessarily burn through your batteries. A better alternative is a "buck converter" which Google knows all about.
The maximum rating on those Dimension parts is 30V input. This is still borderline for a 24V lead-acid arrangement which might charge to 32V. Still, it beats having to build a buck converter from scratch.
The TRACO TSR-1 range are similar with an input of 36v from memory.
Thanks for the quick replies!
I think I will go with the cheapest and simplest option though and use a 9v battery. The buck converter is interesting, but a little beyond my capacity to understand with my current level of electronics knowledge.
When you say 9V battery, do you mean one of those little cubes with the clips on top? If so, you will find that they don't last long.
Yeah, the rectangular ones.
I only need my project to run for a few hours at a time, so I think I should be ok. Any idea what the power consumption of an arduino is? The transistors I'm switching are very low current, only use 0.14mA each.