Maker Pro
Maker Pro

Voltage sensor 10-15v

Javasirc

Nov 16, 2015
4
Joined
Nov 16, 2015
Messages
4
I'm building a digital cooler to use in my truck. I only want the cooler cooling while the truck is running. While the truck is running, it generates 14 volts. While it's off is drops below 14v. So I'm looking for a sensor to read the volts and tell Arduino the voltage. I've been searching on Google and Amazon, but I can't find a sensor or IC to do this. Is there a sensor (preferably digital) that can read voltage?
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
Hello,
One of these modules should do the trick...There are hundreds on Ebay...
http://www.emartee.com/product/42082/

Martin
From close inspection of the traces on this "product" it appears to be nothing more than two resistors connected as a 1:5 voltage divider. There does not appear to be any active components, so the +Vcc connection doesn't serve any purpose.

Buy a screw-terminal 2-wire connector, a three-pin in-line connector, and a perf board and you can build the same thing for (probably) less than a dollar. The only thing "digital" about this is the Arduino.
 

Martaine2005

May 12, 2015
4,932
Joined
May 12, 2015
Messages
4,932
From close inspection of the traces on this "product" it appears to be nothing more than two resistors connected as a 1:5 voltage divider. There does not appear to be any active components, so the +Vcc connection doesn't serve any purpose.

Buy a screw-terminal 2-wire connector, a three-pin in-line connector, and a perf board and you can build the same thing for (probably) less than a dollar. The only thing "digital" about this is the Arduino.
Yes, indeed.
But the OP said he couldn't find anything and had done a reasonable search!
That was my first hit with the OP's query.

Martin
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
Yes, indeed.
But the OP said he couldn't find anything and had done a reasonable search!
That was my first hit with the OP's query.

Martin
Well, I guess if you have talent enough to build a digital cooler for your truck, you should be able to search Google and Amazon for the parts you need. Good find Martin! But what the hell is a "digital cooler" and why should it only run when the truck engine is running? And why does he need to measure the voltage to see if the truck is running? I don't think we know the whole story yet!
 

Martaine2005

May 12, 2015
4,932
Joined
May 12, 2015
Messages
4,932
Haha Hop,
Your guess is 100% better than mine...
I find most questions here are "I am building" "I am Making", and then, I need a full list of components and a diagram so I can make it!
I shouldn't take the @+"/# because I am also a learner with big L plates. I try my best "not" to exceed my limits. Many times I have. And get told off by my mate!!!
But when a question is " I have tried every where and got no results". I know I am on a winner!!

Martin
 

Javasirc

Nov 16, 2015
4
Joined
Nov 16, 2015
Messages
4
The cooler I'm building is going to be operated by a microcontroller, with both digital and analog sensors. I've used Coleman coolers before, but they run constantly and cool slowly. The reason I want to check the truck voltage is so the cooler can turn itself off when the truck is off and on when the truck is on. This is so it doesn't drain the batteries. And it's not my truck so I can't tamper with or modify anything.

The main purpose of the project is learning about microcontroller and electronics, it's not so much about the cooler. I know I could buy a premade thermostat for temperature control, but I'm not going to get the experience I want. I'm new to microcontroller and electronics. But I would like a cooler that works the way I need it to, so that's why I chose this particular project.
 

dorke

Jun 20, 2015
2,342
Joined
Jun 20, 2015
Messages
2,342
The cooler I'm building is going to be operated by a microcontroller, with both digital and analog sensors. I've used Coleman coolers before, but they run constantly and cool slowly. The reason I want to check the truck voltage is so the cooler can turn itself off when the truck is off and on when the truck is on. This is so it doesn't drain the batteries. And it's not my truck so I can't tamper with or modify anything.

The main purpose of the project is learning about microcontroller and electronics, it's not so much about the cooler. I know I could buy a premade thermostat for temperature control, but I'm not going to get the experience I want. I'm new to microcontroller and electronics. But I would like a cooler that works the way I need it to, so that's why I chose this particular project.

I wonder...
Why complicate things when they simple?:(

Where does the "cooler" get the voltage to operate from?
The ignition key of the truck disconnects the power to most of the electric things in it(indirectly),you can use one of this points to feed the "cooler" and the problem is solved in the simplest way possible...

BTW,
"learning about microcontroller and electronics"
very nice,
please do that on a table inside your home with a PC,
not on a truck with a cooler...;)
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
@Javasirc : Since you "can't tamper with or modify anything," can I assume you are going to power both the cooler (a Peltier heat-pump + a fan to circulate cool air?) and the Arduino from a cigarette lighter receptacle on the truck?

May I also assume that power (from the battery) is available at the receptacle, even if the ignition switch is OFF? If that is NOT true, i.e., the cigarette lighter receptacle is not "live" when the ignition switch is OFF, that should not be a problem because whatever senses the battery voltage is less than 14 volts will certainly sense when the voltage is zero. But in that case, the solution offered by @dorke is the simplest solution. However, the problem this presents is how to power up anything to determine if zero voltage is present.

If battery voltage is present all the time, the problem is sensing battery voltage when the truck is NOT running without consuming any significant amount of power that would drain the battery. When the truck is running AND its battery voltage is sufficient (more than 14 V) to power the cooler and the Arduino, some means must be provided to sense this and to power up the Arduino and cooler.

This is not an easy problem to solve, sensing a voltage without drawing any power from it. A gold-leaf electroscope comes close, but is totally impractical. An insulated-gate field-effect transistor presents a high enough resistance to detect the presence of sufficient voltage to run a more sophisticated circuit, such as a low-power microprocessor. However, designing a high=impedance FET circuit that would survive the voltage transients present on a typical truck battery could be problematical.

The problem could be solvable under certain conditions, such as allowing an insignificant (but small) amount of power to be used. For example, you can use a very low-power microprocessor that periodically goes into "sleep" mode, consuming very little power, and "wakes up" to measure the battery voltage. If the "sleep" period is considerably longer than the "waking" period where the voltage is measured, the average power consumed by the low-power microprocessor can be only a few microwatts. This would be less than the self-discharge rate of a lead-acid truck battery, so you could safely power up the microprocessor without fearing that it would drain the truck battery... at least for several months, or years maybe if lead-acid batteries last that long.

There are two situations to consider: wake up finds battery voltage and wake up finds no battery voltage. If battery voltage is present, then it has to be greater than 14 V before the Arduino and cooler are turned on, but it may be sufficient to power the microprocessor during the next "sleep" cycle.

"No battery voltage" would only occur if you powered from the lighter socket, and it was either not "live" because the ignition switch is off, or the truck battery is dead. If this happens, everything (including the low-power microprocessor) must be powered down. The problem then is how to detect when there is enough voltage available to power it up again.

It is also possible for the truck to be running, but the battery voltage is too low (less than 14 V) for any of several reasons: because the alternator is either defective. or isn't providing enough power at idle, or the battery is defective and won't accept a charge. You would want the Arduino electronics, and especially the cooler, to remain OFF if the alternator isn't providing sufficient power to keep the truck battery charged when the truck is running. That way the truck owner can't blame you when the battery eventually runs down.

So, the only remaining problem is how to "bootstrap" from a totally powered down situation to a situation where there is enough power to operate the low-power microprocessor through at least one "awake" cycle to discover if there is enough voltage to run the cooler.

I don't have a "perfect" solution, but I may have a practical one: a self-contained lithium-ion rechargeable battery to run the low-power microprocessor. When sufficient voltage is detected to run the cooler, i.e., when the truck engine is running, only then would the battery be re-charged and a relay energized to send power to the Arduino and cooler. At any other time, the cooler and the Arduino and battery charging circuit would be disconnected from the truck battery by means of a relay controlled by the low-power microprocessor. The μP would still go through sleep and awake states to measure the battery voltage, but it would connect a high-resistance voltage divider through contacts on a reed-relay to do so. That would be done to minimize the current drain on the truck battery.

I would not get fancy with the programming of the low-power microprocessor. It's only function is to measure the truck battery voltage without loading the battery significantly more than the self-discharge rate of the battery. Only when it detects that the voltage is sufficient to power-up the Arduino and cooler would it energize a relay to do so. The power to operate the relay would be derived from the truck battery to minimize the drain on the lithium-ion battery.

I commend your desire to learn about microcontrollers and electronics. Your idea of using this to operate a cooler that has battery power on all the time, but turns itself on only when the truck is running and turns itself off when the truck is not running, is a good application for microcontrollers such as low-power PICs from Microchip and Arduino boards using Atmel microprocessors. Just be aware that the Arduino "wants" to use a 5 V DC power supply, so down-regulating from 14 V DC can be a huge waste of energy unless you incorporate a DC-to-DC buck converter into your design. You can buy these off-the-shelf fortunately.

You might want to consider using a back-up method to determine when the truck engine is running. The alternator in a running truck will produce "ripple" frequencies (dependent on engine speed) that may be a more reliable means to detect a running engine than the battery voltage. This ripple is not present when the truck is not running.
 

Javasirc

Nov 16, 2015
4
Joined
Nov 16, 2015
Messages
4
You're right about your assumptions. I use a 12v cigarette lighter socket that always has power. I'm not worried about using some power when the truck is off. The te peltiers are my concern because they use a lot of power, and I want to use more than one.

I ordered a lot of the parts I need and am experimenting with them. I'll look up the dc-dc buck.
 

Minder

Apr 24, 2015
3,478
Joined
Apr 24, 2015
Messages
3,478
Why not switch the Cig. lighter socket over to a 'Only live in run' connection in the fuse or distribution panel.
You mention you don't want to tamper with anything, but this would seem the best/easiest solution.
In some cases it is just a swap of a stake on connector.
A vehicle wiring schematic is an advantage.
M.
 
Top