Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Max input voltage for ADC input on microcontroller

Status
Not open for further replies.

lloydi12345

Member
Hi, I've read that PIC16F877A can handle 5.5v. I would like to use it's ADC module. Will my circuit below be fine even if I'm using 6v Lead Acid Battery as my input source?

I would like to ask also if you have any idea what's the voltage reading that lead acid batteries are considered dead that it can't power a device fully functional.

Regards,
lloydi12345
 

Attachments

  • Capture.JPG
    Capture.JPG
    69.3 KB · Views: 442
Hi, I've read that PIC16F877A can handle 5.5v. I would like to use it's ADC module. Will my circuit below be fine even if I'm using 6v Lead Acid Battery as my input source?

I would like to ask also if you have any idea what's the voltage reading that lead acid batteries are considered dead that it can't power a device fully functional.

Regards,
lloydi12345

hi,
If you connect a 6V SLA directly to a PIC's adc input you blow the internal protection diode. DONT.!

Use a resistive divider to reduce the maximum expected voltage of the battery to 5V or less.

For a 6V SLA I would not try to power a device from it if the Vout is less than 5.5V
 
hi,
If you connect a 6V SLA directly to a PIC's adc input you blow the internal protection diode. DONT.!

I don't see how Eric?, I certainly agree not to do it - but it won't damage the protection diode, that will simply pass the 6V from the SLA through to the power supply pin of the PIC, and may well kill the PIC.

As you said, a simple potential divider is all that's called for.
 
Thank you for your replies. I don't get it sorry guys. What I mean is that, I have a voltage divider circuit above. I have one power supply regulated to 5v to power the PIC and another power source for my motors which I will use for ADC input. The 6v above on my schematic is the 6v SLA (Motors' Power source) then it passes through the voltage divider which gives an output of exactly 5v. I'll feed it then to the ADC input of the microcontroller.
 
I don't see how Eric?, I certainly agree not to do it - but it won't damage the protection diode, that will simply pass the 6V from the SLA through to the power supply pin of the PIC, and may well kill the PIC.

As you said, a simple potential divider is all that's called for.

Consider that the SLA is at 6V and the internal clamp diode [0.7Vfwd] current should be limited to 20mA,[according to the d/s].
This would mean the current thru the internal diode [connected to the PIC's Vs rail] would be well in excess of the 20mA limit.
IMO I would expect that clamp diode would fail, either s/c or o/c. If s/c, the internal gold wire to the die would fuse, if o/c the excess [6V] would take out the pins internal die circuit.

If as you say the:
that will simply pass the 6V from the SLA through to the power supply pin of the PIC, and may well kill the PIC.

this would mean the internal clamp diode is redundant as it offers no protection to the internals of the PIC.?


I would say in both cases, the diode and then the PIC will fail.

We both agree to not limit the PIC pins input current to ~<20mA will damage the PIC.:)
 
Last edited:
Consider that the SLA is at 6V and the internal clamp diode [0.7Vfwd] current should be limited to 20mA,[according to the d/s].
This would mean the current thru the internal diode [connected to the PIC's Vs rail] would be well in excess of the 20mA limit.

Hi Eric,

Why would high current flow through the diode?.

The protection diodes are simply reverse biased diodes from input pin to Vdd and Vss.

If you apply 6V to the pin, the diode to Vdd will conduct, feeding 5.3V (or so) to the Vdd pin, actually powering the PIC through the diode. Because the source is only 6V, the PIC would almost certainly not be damaged in any way, and certainly the protection diode wouldn't be.

However, it would be of no use at all for trying to monitor the battery voltage :D

As we've said all along, it simply needs a potential divider - a couple of 4.7K resistors would be fine.

If you're only wanting a YES or NO logic input, a simple series resistor is all that's needed, but for using an analogue input a potential divider is essential.
 
Oh I get it. The current limit a PIC pin can handle is until 20mA. Here's my simulation below. I've followed your suggestion Nigel. I'll use it for a 4-bar battery status so I really need it to be ADC. Will my PIC be in good hands? :)

btw, If 1.5v alkaline batteries wont function at 1.2v and considered dead on most applications what about 6v Sealed Lead Acid battery? :D
 

Attachments

  • Capture.JPG
    Capture.JPG
    25 KB · Views: 350
Last edited:
Hi Eric,

Why would high current flow through the diode?.

The protection diodes are simply reverse biased diodes from input pin to Vdd and Vss.

If you apply 6V to the pin, the diode to Vdd will conduct, feeding 5.3V (or so) to the Vdd pin, actually powering the PIC through the diode. Because the source is only 6V, the PIC would almost certainly not be damaged in any way, and certainly the protection diode wouldn't be.

hi Nigel,
Depending upon whatever else the +5Vs is powering in addition to the PIC, the power/current for the total circuit would flow thru the PIC diode,
because the projects +5V regulated source would 'shut off' .

A LTS sim shows the way I think it will work.
 

Attachments

  • 000esp02.gif
    000esp02.gif
    26 KB · Views: 344
hi Nigel,
Depending upon whatever else the +5Vs is powering in addition to the PIC, the power/current for the total circuit would flow thru the PIC diode,
because the projects +5V regulated source would 'shut off' .

You're assuming it's powering other higher current items on the same rail - which 'may' possibly happen, but it's probably more likely not.
 
You're assuming it's powering other higher current items on the same rail - which 'may' possibly happen, but it's probably more likely not.
hi,
I would think it will more likely that the +5V will be powering other circuitry, having seen some of the Forums project offerings.

Whatever ever the case, we both agree, dont connect low impedance over voltage/current sources directly to a PIC I/O pins.

OT: has the weather improved enough to enable the country walks.?

EDIT:
To clarify the points we are making, here is a sim showing how the current supply source is switch over.
 

Attachments

  • 000esp03.gif
    000esp03.gif
    31.1 KB · Views: 269
Last edited:
I'm so confused now :confused: :confused: really sorry. I'm using one 12v lead acid battery to power my circuit and one 6v lead acid battery to power my motor. Thank you for the simulation, I really wanted to understand them all especially the graphs but I think I have to review my electronics again to understand them all fully. Please confirm if the two 4.7k ohms voltage divider resistors are good. :( Sorry for the headache.
 
I'm so confused now :confused: :confused: really sorry. I'm using one 12v lead acid battery to power my circuit and one 6v lead acid battery to power my motor. Thank you for the simulation, I really wanted to understand them all especially the graphs but I think I have to review my electronics again to understand them all fully. Please confirm if the two 4.7k ohms voltage divider resistors are good. :( Sorry for the headache.

hi,
Sorry if we have confused you.

Simple question is what is the voltage supply to your PIC pins +Vsupply..??
 
Uhm my supply voltage supposedly is 12v Lead Acid Battery but I didn't used it yet. I'm still using wired cannon adapters which outputs a 6v that is regulated my 7805 because I'm still doing my battery power indicator for the battery of my motors. After I finalize my circuit for the battery power indicator which looks like a 4 bar that can be seen on some low cost cellphones battery status, I will then use the 12v lead acid battery. I'm still not sure at the end if it will work. I'm still working out on the battery power indicator.
 
Uhm my supply voltage supposedly is 12v Lead Acid Battery but I didn't used it yet. I'm still using wired cannon adapters which outputs a 6v that is regulated my 7805 because I'm still doing my battery power indicator for the battery of my motors. After I finalize my circuit for the battery power indicator which looks like a 4 bar that can be seen on some low cost cellphones battery status, I will then use the 12v lead acid battery. I'm still not sure at the end if it will work. I'm still working out on the battery power indicator.

I understand from what you have said, that the PIC will have a +5V supply from a 7805 voltage regulator.

This means that for you safely sample the voltage level of a 6V SLA you should use a resistive divider from the 6V battery and 0V, take the junction of the divider resistors to the PIC's analog input.

What is the maximum voltage that the 6V SLA can be at, example: will the 6V SLA ever be connected to a charger while you are monitoring it,???
 
I understand from what you have said, that the PIC will have a +5V supply from a 7805 voltage regulator.

This means that for you safely sample the voltage level of a 6V SLA you should use a resistive divider from the 6V battery and 0V, take the junction of the divider resistors to the PIC's analog input.

What is the maximum voltage that the 6V SLA can be at, example: will the 6V SLA ever be connected to a charger while you are monitoring it,???

I'm not connecting any charger on it. The circuit's use is to tell the user that if the battery is on its low voltage then it should be removed and should be charged right away. So is my two 4.7k resistors in parallel setup fine?
 
Last edited:
I'm not connecting any charger on it. The circuit's use is to tell the user that if the battery is on its low voltage then it should be removed and should be charged right away. So is my two 4.7k resistors in parallel setup fine?

Its two 4.7K resistors in SERIES not parallel.

So the centre of the resistor divider will be 3V when the battery is at 6V, which is OK/
 
Last edited:
I'm sorry. What I mean is that, the ADC input is in parallel. Is it okay?

Yes, its OK.
If you assume the 6V SLA needs recharging when the voltage drops to say 5.5V , that would be 2.75V at the adc input.
 
Yes. :)

I hope its alright to ask this one. Do you know what's the dead voltage level of 6v SLA batteries? So I can prompt the user that he needs to recharge the battery.
 
Status
Not open for further replies.

Latest threads

Back
Top