Go Down

Topic: Protecting ADC Inputs (Read 534 times) previous topic - next topic

LandonW

Can you not have a 5v rail and 24v rail? Then and measure both with separate analogInputs

adwsystems

Can you not have a 5v rail and 24v rail? Then and measure both with separate analogInputs
I'm not sure I understand. There is no rail, there is only one item with those voltages, the battery. The battery does not power the system. The battery is an input to the system, that can vary in two range, low =0-5V and high =5-24V.

LandonW

How will this be powered?  And if you are sensing 24v then you have potential for a 24v rail. Obviously you know that.... I f you use the switch method as described in other posts. I would maybe use a SPDT relay to close the 24v sensing circuit via button press and with the button press you can switch the ADC you are reading from in the software. (0-5v or 5-24v. As per your descriptions)

adwsystems

It is power from a 120VAC to 12V power supply via the DC jack. The 24V battery will never be connected to a power rail. The switch method does not, can not, guarantee the switch is in the correct position when the battery is connected; which may be connected before or after the unit is plugged into the wall.

LandonW

Have you started building this yet?
Why are you using 120vac to 12vdc to 5vdc?
Does the 12vdc power anything else?
Why is there a 0 to 5 need along with a 5 to 24?
Since you haven't provided a schematic, I will draw one when I get home from work.

adwsystems

#20
Dec 06, 2018, 10:47 pm Last Edit: Dec 06, 2018, 10:50 pm by adwsystems
Have you started building this yet?
Yes. Almost done. That's when I noticed the possible problem.


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.


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)


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.

That's all folks.


LandonW

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.

adwsystems

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).

MarkT

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.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

LandonW

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

adwsystems

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.

LandonW

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

adwsystems

#27
Dec 07, 2018, 04:23 pm Last Edit: Dec 07, 2018, 04:31 pm by adwsystems
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.




Like I said, not that complicated.

LandonW

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.

adwsystems

#29
Dec 07, 2018, 04:55 pm Last Edit: Dec 07, 2018, 04:56 pm by adwsystems
The load doesn't change. A fixed load is used in most test systems as the point of reference. A changing load would complicate most test systems.

Thank you for your thoughts but they are not applicable to this system.

Go Up