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.

Confused - ADC using PIC

Status
Not open for further replies.

devonsc

New Member
Hi,

Do you guys mind to give me some advice on how do I tap voltage the output voltage of the solar panel for ADC purposes? I'm building a boost DC/DC converter where the input of this circuit is being supplied by a solar panel.

By using a PIC microcontroller, I intend to perform some ADC set-up to read the output voltage of the solar panel to control my duty ratio of my DC/DC converter. Any advice?

Can I connect a small resistance value in series and pull a wire out from the end of the resistor for voltage reading? Meaning, I apply this pull-up as the input to the PIC for conversion. Is this good enough? Will this work?

All the while, I thought it is good enough to perform my ADC using my PIC but by going through posts in this forum, it seems that there are a lot of questions about Vref for ADC. Help really needed. I'm lost. Thanks in advance...
 
What voltage is the panel and what will you use for Vdd? 5v Vdd I assume?

The ADC cannot read a voltage over 5v, and you cannot allow a voltage much over 5v to go to a PIC pin in a worst-case scenario. So you may need a voltage divider, but this will consume current at all times. You can only make the resistors so large too, the ADC needs to be hooked up with a circuit of at most 2.5k output impedance for the full accuracy.

If you don't need to read voltages above 5v, but they may occur, a zener will do the job without conducting power during normal operation.
 
You can't just use a series resistor, that won't provide a scaled down reading, just a clipped one.

If it's more than 5V you just need a potential divider to drop the voltage to within a 0-5V range. Don't worry about possible loss of accuracy, Oznog always seems to scaremonger on this point? - any loss of accuracy is EXTREMELY small, of no consequence for your purposes.
 
on related note I have a potential divider linked to a pic with an ADC which is used for a low battery indicator.

I use 1meg resistors for this to limit the amount of current drawn.
Will using resistors this large cause the innacuracy problems discussed here?
Or is the error insignificant for my application (battery indicator for 9V battery)
 
2camjohn said:
on related note I have a potential divider linked to a pic with an ADC which is used for a low battery indicator.

I use 1meg resistors for this to limit the amount of current drawn.
Will using resistors this large cause the innacuracy problems discussed here?
Or is the error insignificant for my application (battery indicator for 9V battery)

I've just checked the datasheet for a 16F819, it says that the recommended source impedance is only 2.5K, and that the maximum allowed is 10K - note that the higher the input source impedance the slower the acquisition time.

Certainly 1M sounds rather high :lol:
 
What voltage is the panel and what will you use for Vdd? 5v Vdd I assume?

The voltage output of the panel varies from 4V to 10V (Will not exceed 10V). I intend to shut the PIC down if the output of the solar panel is lower than 4V. Apart from that, I intend to power-up my PIC using the power directly from the solar panel.

If it's more than 5V you just need a potential divider to drop the voltage to within a 0-5V range. Don't worry about possible loss of accuracy, Oznog always seems to scaremonger on this point? - any loss of accuracy is EXTREMELY small, of no consequence for your purposes.

But instead of droping the voltage level to a range of 0-5V, is there a way where I can scale the values down? Something like: What ever reading value I obtain from the solar panel's output, I make sure it is being divided by 2 before being applied to the ADC input of the PIC using a voltage divider, like you mentioned.

Meaning, overall, I do the following: By having 2 ADC inputs,
a.) one would be an input of a "limited to 5V input". At this point, if the PIC reads a value of lower than 4V, I shut off the PIC.

b.) another would be an input of a "voltage from the solar panel divided by two". This will be the one to control my PWM duty ratio.

By the way, the duty ratio will be used to control my on/off of a MOSFET and I need approximately 16mA to turn it on. Would like to confirm, about this: Does it mean that if the voltage used to power-up my PIC is 4V, I will obtained an output current of approx. 20mA? Whereas if it is 3V, it will be approx. 15mA?
 
How about you just use a PIC with a Brownout Detect and/or Brownout Reset function?
 
Oznog said:
How about you just use a PIC with a Brownout Detect and/or Brownout Reset function?

Oops, sorry, I guess I've found out the solution for both my questions. There is Brown-Out Detection in my PIC. Thanks a lot. Will be back with questions if I have doubts. Thanks a lot!
 
Its an internal comparitor circuit inside of certain PICs which has the ability to detect a low voltage condition in your circuitry before it becomes too low that the PIC (or the rest of your circuit) starts behaving irratically. This gives you enough time to save your current important registers and settings so you can resume what you were doing when the power is restored.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top