Go Down

Topic: Powering two arduinos with a 12v car battery (Read 1 time) previous topic - next topic

syka2210

I have created a new threat regarding the issue about powering an arduino using a step down converter, from a 12v car battery without using phone chargers or such.
This is a discussion moved from this threat.

I have a couple of questions, and keep in mind that I have limited knowledge about electronics.
1st-Does the system takes the amps that it requires, or if we have a step down rated at 3A, it will disipate the rest through heat?
2nd-I need to power 2 arduinos, a uno and a micro that communicate between them. they power about 7-8 switches, 3 relays, 2 hall sensors, 2 2digit 7 segment led, 1 7 segment led, one 2 row lcd, a step motor driver, a couple of led (5-6), and a microSD module(that runs on 3.3V). Thinking i might need 3 arduino's from the lack of pins. Note that i cannot use a Mega because i have multiple task that need to run simultaneously, so one main operation will be commanded from the uno, with additional information gathered from the micro's, while the micro's will perform their own tasks.
3rd-What about electrical noise? Does it affect the analog readings? And if i use only digital reading, does it present a problem?
We believe in better. And cake, definitely cake!

syka2210

This Step down module for example has an max output of 3A, with cooling. Now, am I going to reach that level of current?
We believe in better. And cake, definitely cake!

MorganS

1. No. It takes the amps it requires.

2. That's kind of a lot of things to add up for the power consumption. The relays and LCD will have the highest power consumption. Hall effect and conventional switches can be assumed to use zero power. The SD card is close enough to zero for this analysis. Look at the datasheets and add up the current.

2a. You probably don't need 3 micros to do whatever it is you are doing. With proper programming, the Mega will do it all for you.

3. Where is this car battery? In a car? Then you have to deal with noise and other problems.
"The problem is in the code you didn't post."

ReverseEMF

#3
Jul 17, 2018, 03:04 pm Last Edit: Jul 17, 2018, 03:17 pm by ReverseEMF
This Step down module for example has an max output of 3A, with cooling. Now, am I going to reach that level of current?
So, I'm a bit confused.  In the threat*[sic] you say this thread is "moved" from, is titled "How to Power Arduino uno with a 42v battery".  Yet, in the text it's referred to as a 12V battery.  How does this relate to this "moved" thread?

Also, DVDdoug supplied a very nice answer to a question you seem to asking here, regarding the nature of current.

And, how can this be a moved thread, when you aren't even the original OP?
Very strange! [have you read How To Use This Forum]

Also, there isn't enough information in your question, for anyone to answer it.  So, all I can do is advise you further(?) on the nature of current:

Find out how much current each device uses [the maximum [ever] amount it is likely to use], then add it all up.  If it's less than the rated amount the supply can deliver, then you're good -- but, consider that often a max current rating on a supply is the amount of current it will handle in the most "stressful" way -- i.e. that usually means heat dissipation.  So, rule of thumb, use a supply rated at 150% to 200% of the actual load.  That way, the thing is less likely to sit there and cook.  Which is, especially, an issue if the supply will be in an enclosed space with limited, or no, air circulation, or it it's going to be used in hot location(s) [i.e. where temperatures will be greater than "room temperature"].  I'm throwing all of this at you to give you a sense of how to judge the selection of a power supply, given the conditions it will be used in.

Also, an Arduino Uno [proper -- i.e. can't vouch for clones] regulator can supply only a limited amount of current.  It's hard to judge how much, because of factors like ambient temperature, and something called dropout voltage (which is related to how high the voltage is at the VIN pin).  Based on the official schematic for the Arduino UNO, the +5 pin is supplied via a NCP1117ST50T3G regulator chip.  This chip is rated at 1A max, but if you drive it with 12V, that little sucker is going to heat up pretty fast, and I doubt you'll be able to get 1A out of it for long.  It has an internal thermal shutdown, so that's what will, likely, happen--it will run [at 1A] for a short while, then shutdown for a while, then run for a while, then shutdown again, etc.  So, you can't hurt it by trying to draw more current from it than it can consistently deliver, so experiment.  I'm guessing you'll get more like 500mA of consistent current -- but, ambient temperature plays a role in this, too.

BUT, if you avoid using the +5 pin on the Arduino to power your stuff, then you can avoid all this nonsense. 

Also, there is the issue of driving things from an Arduino output -- such as those relays [note the distinction between powering and driving].  An Arduino output is spec'd as able to supply a max of 40mA of drive current.  But, the datasheet consistently specifies 20mA when talking about such things as low and high output voltage, etc., so, many of us consider 20mA as the upper limit--as a rule of thumb.  You can go to 40mA if you consider that the output low voltage is going to be higher, and the output high is going to be lower [confusing, huh -- that's why I advise newbies to follow the 20mA limit].

Regarding the use of multiple Arduinos to solve the not-enough-in/out-pins issue.  There are ways to create more outputs/inputs without involving a whole separate Arduino. Check this out [might refer to different MCU than Arduino, but same concepts]:



* Unless this really is a threat, and not a "thread"...but so far, it hasn't been all that threatening.  I've needed stitches on occasion, and thought the thread a bit threatening (but not as much as the needle, for sure :smiley-lol: )
"It's a big galaxy, Mr. Scott"

Please DON'T PM me regarding what should be part of the Public Conversation -- Let it ALL hang out!!
Unless, of course, it's to notify me of a mistake.

syka2210

#4
Jul 17, 2018, 03:48 pm Last Edit: Jul 17, 2018, 03:58 pm by syka2210
The battery is connected to a petrol engine and charged with an alternator, so the voltage will reach to about 14.4 volts. note that we are not talking about a car, but some sort of buggy/monopost. it will not have additional electronic system such as cigarette lighter port, or ECU. it is a carburetor engine.

So you are saying it is possible to perform multiple task at the same time, such as reading 2 sensors, driving 2 stepper motors and displaying information on the lcd's in real time? As in the same second?

Also sorry about the "threat". Not an advanced english speaker.

The tread was actually continued here, because i asked a question on javbus's thread and it continued like that until somebody asked me to create a new post.
We believe in better. And cake, definitely cake!

ReverseEMF

The battery is connected to a petrol engine and charged with an alternator, so the voltage will reach to about 14.4 volts. note that we are not talking about a car, but some sort of buggy/monopost. it will not have additional electronic system such as cigarette lighter port, or ECU. it is a carburetor engine.
Even so, "carburetor engine" sounds like spark plugs, which means potential for nasty spikes.  Also, an alternator will introduce its own kind of noise. So, some noise filtering is wise.

So you are saying it is possible to perform multiple task at the same time, such as reading 2 sensors, driving 2 stepper motors and displaying information on the lcd's in real time? As in the same second?
Who said that? [you really should read: How to Use This Forum]

The tread was actually continued here, because i asked a question on javbus's thread and it continued like that until somebody asked me to create a new post.
Ahhh...then it's, indeed, a new thread, and thus, no need to refer to the previous thread.  That's just confusing, for no reason ;)
"It's a big galaxy, Mr. Scott"

Please DON'T PM me regarding what should be part of the Public Conversation -- Let it ALL hang out!!
Unless, of course, it's to notify me of a mistake.

MorganS

Find out how much current each device uses [the maximum [ever] amount it is likely to use], then add it all up.  If it's less than the rated amount the supply can deliver, then you're good -- but, consider that often a max current rating on a supply is the amount of current it will handle in the most "stressful" way -- i.e. that usually means heat dissipation.  So, rule of thumb, use a supply rated at 150% to 200% of the actual load. 
Good advice.

So, you can't hurt it by trying to draw more current from it than it can consistently deliver,
I have a number of Unos with blown regulators on my shelf that disagree.

. note that we are not talking about a car, but some sort of buggy/monopost.
That is actually worse than a car. But the standards for cars will be adequate. Pretty much any 5V converter, even the cheap ones will work. So long as you follow the advice above.

Quote
So you are saying it is possible to perform multiple task at the same time, such as reading 2 sensors, driving 2 stepper motors and displaying information on the lcd's in real time? As in the same second?
As in the same millisecond. The Arduino can do 16000 things in a millisecond. (Thousandth of a second.)
"The problem is in the code you didn't post."

ReverseEMF

I have a number of Unos with blown regulators on my shelf that disagree.
I did not know that -- thought they were more robust.

As in the same millisecond. The Arduino can do 16000 things in a millisecond. (Thousandth of a second.)
Well, true if each thing takes 1 instruction cycle.  But most things take a few more -- sometimes, many more instruction cycles [because they require more than one instruction to achieve].  But, yes, it is, typically, possible to "multitask" rather effectively.  They aren't really happening all at the same time, but it can go so fast, it seems like it's simultaneous.

The OP gave the indication that the reason for multiple Arduinos had to do with running out of pins, not the need for simultaneous functionality [i.e. multitasking].  That's why I wondered who made the "multitasking" statement [i.e. where that notion came from].
"It's a big galaxy, Mr. Scott"

Please DON'T PM me regarding what should be part of the Public Conversation -- Let it ALL hang out!!
Unless, of course, it's to notify me of a mistake.

syka2210

#8
Jul 18, 2018, 12:02 pm Last Edit: Jul 18, 2018, 12:04 pm by syka2210
My mistake. I made the statement that i needed multiple pins, but also (wich i forgot to mention) that the board need to run multiple operations at the same time such as: reading values from 2 hall sensors, reading from different switches, commanding 2 stepper motors independently, and 3 relays. Note that each relay will be activated in an while loop, ( i know there is another way to write the program, i read about it, but for now i am trying to master the "basics") and while the loop is activated, about 3-4 seconds, the board cannot do another task, such as reading values from different senzor and output the data on lcd's, led's and so on.
I don't mind using more boards rather than expanding the number of pins and learning about the other metod of multitasking, but for now i am trying to learn about this metod, so in the future it might come in handy.
We believe in better. And cake, definitely cake!

MorganS

If you have multiple boards which must communicate then you must have multi tasking. If it is doing something "useful" and a new command arrives, it must have some way to read that command without stopping what it was doing.

By making several boards communicate, you SIGNIFICANTLY increase the complexity of your project. You have not convinced me that this project needs that level of complexity.
"The problem is in the code you didn't post."

ReverseEMF

#10
Jul 18, 2018, 02:29 pm Last Edit: Jul 18, 2018, 02:34 pm by ReverseEMF
OK, this is suspiciously sounding like an X-Y problem--we are all laboring on "X", when knowledge of "Y" [the actual issue] would work wonders towards allowing us to actually help the OP.

So, syka2210...what is it that you are actually doing...if I [we] may ask?

But, in the meantime...

Note that each relay will be activated in an while loop,... <snip> ...and while the loop is activated, about 3-4 seconds, the board cannot do another task, such as reading values from different senzor and output the data on lcd's, led's and so on.
That sounds like "busy-wait polling" -- running in a while-loop, waiting for a state change in a sensor--or a delay loop to complete, before moving on to the next sensor, then waiting for a state change or delay-loop.  And, yes, the drawback is, nothing else can be performed while "locked" in one of these loops.

( i know there is another way to write the program, i read about it,...)
Here, you're probably talking about interrupt driven I/O.  And, yes interrupts can be a bit tricky, but they would allow things to occur with more simultaneity.

BUT, dedicating Arduino boards to things like the management of a stepper motor based on commands relayed from a "master" Arduino is definitely a valid way to go.  As is dedicating a board to LCD management, etc.  And, in a critical application, even an Interrupt driven solution may not be adequate, because when interrupts are called, timing can be thrown off -- unless done properly [for instance: regimenting program flow to a timer interrupt so that stepper motor pulse timing is never compromised -- interrupts are processed between stepper motor actions, because the stepper motor timer interrupt has the highest priority].  If that sounds complicated -- it is.  So, tackling such a thing with multiple processors may be a simpler, though more expensive solution -- but expensive can also be a cost of frustration and learning curves ;).  

But, this is all speculation in a vacuum ;)
"It's a big galaxy, Mr. Scott"

Please DON'T PM me regarding what should be part of the Public Conversation -- Let it ALL hang out!!
Unless, of course, it's to notify me of a mistake.

TomGeorge

Hi
Can you draw a block diagram showing the layout and ALL the devices your arduino's will be working with, please?

Thanks.. Tom..
Everything runs on smoke, let the smoke out, it stops running....

syka2210

i will try to draw a simple sketch of the sistem i am trying to build in the next couple of days. unfortunately, the time is not my ally, having to divide mine between work, college and other activities. this might be a slow learning, but it is lovely.
We believe in better. And cake, definitely cake!

syka2210

#13
Jul 18, 2018, 08:26 pm Last Edit: Jul 18, 2018, 08:32 pm by syka2210


So this is one of the... i don't know how to call it... task. the dc motor and the stepper will not work simultaneously. They can't physicaly. i need the shortest time of response from those two motors, one of them (the dc motor) giving a rotation to translation movement conversion. Yes i know i have driver boards for dc motors, but this way is cheaper and through the motor runs the car battery current, not willing to connect my battery directly to a driver board, without having a step down module, and that gives me another set of problems.
We believe in better. And cake, definitely cake!

MorganS

Relays are considered to be slow. But they are a bit faster than the rotation of a motor. Stick with the relays if that is what you want. You still have to connect power to the relay board. And the stepper driver. And the Uno.

We don't need a computer diagram. A pencil drawing is often better than struggling to draw coloured wires on the screen.

"The problem is in the code you didn't post."

Go Up