Yes. Almost done. That's when I noticed the possible problem.
LandonW:
Why are you using 120vac to 12vdc to 5vdc?
Does the 12vdc power anything else?
I'm not. I'm using 120VAC to 12V to power the Arduino and some analog circuitry. Not sure where you got the 12V was converting to 5V.
LandonW:
Why is there a 0 to 5 need along with a 5 to 24?
Because the system is designed to test battery packs of 1 to 20 cells (1.2V through 24V)
LandonW:
Since you haven't provided a schematic, I will draw one when I get home from work.
Schematic of the section in question is not that complicated. It consists of a SPDT relay. COM to ADC, NO center of resistor divider, NC to top of resistor divider. (NO for >5V, NC for <5V). Battery to be tested connects across the resistor divider.
adwsystems:
I'm not. I'm using 120VAC to 12V to power the Arduino and some analog circuitry. Not sure where you got the 12V was converting to 5V.
Because the system is designed to test battery packs of 1 to 20 cells (1.2V through 24V)
Schematic of the section in question is not that complicated. It consists of a SPDT relay. COM to ADC, NO center of resistor divider, NC to top of resistor divider. (NO for >5V, NC for <5V). Battery to be tested connects across the resistor divider.
That's all folks.
I was thinking 12 was converting to 5 on the Arduino's on board regulator.
this is what I drew up for the 24v side, the switch is the relay and I'm not 100% on the resistor/cap portion.
LandonW:
I was thinking 12 was converting to 5 on the Arduino's on board regulator.
It is and for the LCD. But there is another 5V, or more precisely 0-5V/5-24V.
As for your schematic. I don't know what the cap, resistor or diode are for. The zener diode is irrelevant. and the relay is in the wrong spot. You show only NO and it is connected to the battery and the COM connected to the resistor divider. The SPDT relay is a selector, high voltage or low voltage. The relay goes between the resistor divider and the ADC input (COM), to select direct from the battery (NO) or from the resistor divider (NC).
Well the diode will pointlessly reduce the accuracy of the reading, the zener will either burn out or do nothing, the
zobel network will absorb high frequency energy (which is present for some unknown reason).
The only components needed are the two resistors of the divider, and an optional filter capacitor
across its lower leg to reduce noise in the readings. To protect against reverse polarity add a schottky
diode across the lower leg of the resistor divider. Adding any diode in series is going to throw off
the measurement.
The diode was meant for reverse voltage protection. And then zener won't burn out if it's rated for closer to 27vdc unless it sees that voltage for a more than a quick spike
The diode will add an offset between the ADC ground and the battery ground.
I'm not sure where the high frequency noise would come from. It's a battery.
I don't care about a zener to protect at 27V (not a bad idea, but unlikely and absolutely not the point). The resistor divider needs to be switched in/out based on whether the battery is above or below 5V. The question at hand is how to protect the ADC input if a 24V battery is connected and the 5V configuration is selected? The circuit presented does not accomplish this goal.
Noise will come from loads changing.
Sorry for my slowness in understanding your issue.
You want the device to know what circuit is being checked and have no dependence on the users ability to know what they're doing?
If that's the case, maybe integrating a 9v VR and when that VR has output then switch to the 24v sensing.
Doesn't have to be 9v but something high enough that 5v won't trigger it
What load is changing? This a battery tester the load is constant.
SPDT relay provides to options to connect to the ADC. Either direct to the battery being tested or from a resistor divider. Direct is selected when the battery selected is <5V, resistor divider for batteries over 5V. I need to protect the ADC input when a 24V battery is connected (accidentally) to the direct input.
Load would change via what ever these batteries power. Unless you are checking isolated batteries?
Other than what's been said, I have no other suggestions/opinions regarding this. My experience and knowledge have been exhausted... I just do it as a hobby.
hammy:
If you use the internal voltage reference ( around 1.1volts) you can scale you voltage ( restore divider) input to suit .
The ADC pin is still safe to 5v , so you automatically get 5x your full scale voltage protection .
Eg if you scale you divider to 12v full scale , the input is protected upto 60v input .
I agree, but need to check the other ADC connections to make sure they are all the connected in the same manner. Also seems to be a waste now that the direct connections are already on the circuit board.