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.

Monitoring Circuit (Miniature Remote Controlled Solar Car)

Status
Not open for further replies.

devonsc

New Member
I'm not sure if I'm allow to post this...I'm currently working on a project regarding the Miniature Remote Controlled Solar Car and this is my second post. First was the DC/DC Converter (Miniature Remote Controlled Solar Car). Hope this post is allowed.

Hi there. I'm currently working on this project and needs help badly. At this point, I will be working on the implementation of the PIC Microcontroller to monitor a few matters and display them using a LCD (Figure Project). These includes the following:

a.) Read current load current drawn from the load, which is a 12V DC motor.
b.) Present the approximate life-time of the battery at that level with that drawn current.
c.) Present the battery level in terms of percentage.

:?: Would like to ask, how do I tap the current drawn by the load and feed it to a Current-to-Voltage Converter before applying it to the PIC microcontroller? :oops: At which point shall I tap the current point from? Advice needed.

:?: The battery level in terms of percentage, if I were to come out with a look-up table for reference before writing a programme for the PIC microcontroller, do I consider having a table with reference to the voltage or with reference to the current? Reference Figure 1. :oops: Advice needed.

Thanks in advance.
 

Attachments

  • figure_1.jpg
    figure_1.jpg
    20.3 KB · Views: 926
  • block_diagram_2_136.jpg
    block_diagram_2_136.jpg
    36.3 KB · Views: 1,079
Re: Monitoring Circuit (Miniature Remote Controlled Solar Ca

devonsc said:
a.) Read current load current drawn from the load, which is a 12V DC motor.
b.) Present the approximate life-time of the battery at that level with that drawn current.
c.) Present the battery level in terms of percentage.

:?: Would like to ask, how do I tap the current drawn by the load and feed it to a Current-to-Voltage Converter before applying it to the PIC microcontroller? :oops: At which point shall I tap the current point from? Advice needed.

You measure the voltage drop across a resistor in series with the load, in order to keep this voltage drop to a minimum it's usual to use a very small resistor and use an opamp (in differential mode) to amplify the small voltage drop to a useable level.

You could also have another resistor monitoring the charging current from the solar panel - or just one resistor, monitoring the current to and from the battery (like car ampmeters do).

:?: The battery level in terms of percentage, if I were to come out with a look-up table for reference before writing a programme for the PIC microcontroller, do I consider having a table with reference to the voltage or with reference to the current? Reference Figure 1. :oops: Advice needed.

You need to test and find out what gives the best approximation of battery life left, it's a very complex subject - most systems only give a vague estimate of battery life.

For best accuracy I would suggest you plot a number of discharge curves for different loads, and implement them as a number of lookup tables in the PIC - you can measure the present load current, and battery voltage, then call the table that most closely matches the current.

The graphs you plot will also look good, and take up plenty of space, in your write up :lol:

These tables don't need to be particularly long, don't forget you're not measuring from 0-15V for a 12V battery, only something like 10-15V - you shouldn't discharge a lead acid battery more than about that (the battery spec will give the exact figure).
 
Re: Monitoring Circuit (Miniature Remote Controlled Solar Ca

For best accuracy I would suggest you plot a number of discharge curves for different loads, and implement them as a number of lookup tables in the PIC - you can measure the present load current, and battery voltage, then call the table that most closely matches the current.

:) Is this what you mean? :oops:
I should use different loads, such as:
a.) 100 ohm resistor
b.) 1 kohm resistor
c.) 10 kohm resistor

Then, using each of these loads and leave it connected to the battery for a period of time, say 5 minutes and jot down the readings for the voltage as it varies with time. From there, I plot the graph with the following axis (Figure: discharge curve)

Then, when I apply the real load, say, a motor that draws 0.6A, I will call the table that draws 0.5C (0.65A) since it is the closest? Please correct me if I'm wrong :cry:
 

Attachments

  • discharge_curve.jpg
    discharge_curve.jpg
    12.8 KB · Views: 689
Re: Monitoring Circuit (Miniature Remote Controlled Solar Ca

devonsc said:
For best accuracy I would suggest you plot a number of discharge curves for different loads, and implement them as a number of lookup tables in the PIC - you can measure the present load current, and battery voltage, then call the table that most closely matches the current.

:) Is this what you mean? :oops:
I should use different loads, such as:
a.) 100 ohm resistor
b.) 1 kohm resistor
c.) 10 kohm resistor

Then, using each of these loads and leave it connected to the battery for a period of time, say 5 minutes and jot down the readings for the voltage as it varies with time. From there, I plot the graph with the following axis (Figure: discharge curve)

Then, when I apply the real load, say, a motor that draws 0.6A, I will call the table that draws 0.5C (0.65A) since it is the closest? Please correct me if I'm wrong :cry:

Yes, that's right - you need to select your tables carefully, if you do a wide range of different load tests you can then work out how many different tables you will need for acceptable accuracy.

Rather than do it manually it would be easier if you have a data logger, or multi-meters with RS232 interfaces - but manually is fine, it just takes more effort.
 
Rather than do it manually it would be easier if you have a data logger, or multi-meters with RS232 interfaces - but manually is fine, it just takes more effort.

Thanks a lot :) I will try to find out if there is any data logger in my laboratory. I will do it manually if there isn't any.

By the way, would like to ask for your opinion about the duration. Is it true that I might need to run that specific load for up to hours in order to see the changes in battery voltage level? :oops: Mind to correct me if I'm wrong?

Thanks again, Mr. Nigel Goodwin.
 
devonsc said:
By the way, would like to ask for your opinion about the duration. Is it true that I might need to run that specific load for up to hours in order to see the changes in battery voltage level? :oops: Mind to correct me if I'm wrong?

Yes, you will probably have to run it for hours, hence the reason for a datalogger being handy!.

I did some battery life tests many years ago, the results are shown on my website at . Notice that the longest one was over 9 hours!.

I used an A2D which plugged into the parallel port, and some DOS software I wrote.
 
Oh no! I saw your plots...up to 9 hours? :) How I wish you don't mind sending over your data logger programme :D (In my dreams)

You're going scold me for asking help in this way :) Well, I will get it done as soon as possible.
 
Wow, your instructor just won't be satistfied until he's SURE he's charged you with the nigh impossible.

OK, here's the skinny on measuring battery capacity. You do not measure out a discharge like this. It's pointless. You have a sealed lead acid battery, right? The voltage at various states of charge is well known and easy to find on the internet, EXCEPT that it's strongly temp dependent. You can't measure state-of-charge accurately without knowing the temp (well, if you're always in a temp-controlled room, that's known), and having a fairly accurate ADC. The PIC's ADC state can do it if you use 2% precision resistors, use an accurate Vref, and calibrate the result versus a known voltage source.

But that only measures the unloaded battery. If the battery is being used, or has been loaded recently (the exact period of time which constitutes "recent" depends on how heavily it was loaded and temp), it will bring down the voltage slightly and it apppears as if the charge state is lower than it is. Perhaps your motor is not big enough to constitute enough load to lower the battery voltage enough to interfere with the calculation. You could try to see how the battery voltage drops as it's loaded, but it is time and temp dependent, so it could easily get complicated and never produce a useful result.

You could have it take the state-of-charge only when the motors have been idle for awhile, and remember that state while deducting the current later observed being drawn by the motors. Eventually you will get another opportunity to measure state-of-charge voltage when the motors aren't being used and then remember that new point.

Half the battery meter systems out there, developed commercially, don't work well.
 
The PIC's ADC state can do it if you use 2% precision resistors, use an accurate Vref, and calibrate the result versus a known voltage source.

Sorry, I'm lost :oops: Don't quite understand. Please don't get mad :oops: Mind to briefly explain this again? Real sorry...

If it is not too much trouble for you, mind to explain again? Thousand apologies.
 
By the way, Mr. Nigel and Mr. Oznog? Can we say this:

Method by Nigel:
a.) Time consuming.
b.) I might not get my results even though, after waiting for long due to very low load current?

but if:

a.) I'm using such resistor values? (100ohm, 50ohm and 10ohm), won't I get a high current drawn from the battery?
b.) If my surroundings is approximately 30-32 degree celcius. Such temperature range, will it cause my results to vary a lot?
c.) I will only be getting 3 sets of results, meaning the battery will only go through the process of charging - discharging for three times, will these three times lower my possible charged voltage state value a lot?

Sorry if there is any nonsense that exist in my questions.
 
Back to the earlier on post by Oznog.

The voltage at various states of charge is well known and easy to find on the internet, EXCEPT that it's strongly temp dependent.

I found the following from the Power-Sonic website.

But the temperature surroundings in my country is around 30-34 degree celcius. Range difference from 20 to 30 degree celcius, will this range of changes cause a lot of changes in the battery characteristic or it is minor and I can implement this graph as a guide for me? Any opinions? Please?

Thanks in advance...
 

Attachments

  • battery_characteristics.jpg
    battery_characteristics.jpg
    66.1 KB · Views: 567
Hi there, as mentioned earlier, I'm working on the Monitoring Portion of the battery. Currently learning up the PIC microcontroller which I will be using. I would like to ask regarding the following matters. Can anyone explain regarding the use of the following?

a.) RTCC (Real Time Clock Counter)
b.) WDT (Watch Dog Timer)
c.) Brown-out Detection

For (a) and (b), what are the differences besides the rate?

Thanks in advance.
 
devonsc said:
Hi there, as mentioned earlier, I'm working on the Monitoring Portion of the battery. Currently learning up the PIC microcontroller which I will be using. I would like to ask regarding the following matters. Can anyone explain regarding the use of the following?

a.) RTCC (Real Time Clock Counter)
b.) WDT (Watch Dog Timer)
c.) Brown-out Detection

For (a) and (b), what are the differences besides the rate?

You should read the 'mid range reference manual' which explains them all.

But briefly:

RTCC - an internal counter/timer, can be used from internal or external clocks.

WDT - a crude internal RC timer, of very low accuracy, if the WDT is enable it will reset the PIC as it times out. Your code should include CLRWDT instructions accordingly to prevent this. Used to reset your PIC if it gets locked in an endless loop (assuming you don't have a CLRWDT instruction in the loop).

Brown out detction - sets the voltage level that the PIC resets at, so if the power supply drops below a certain level the PIC will reset.
 
But briefly:

RTCC - an internal counter/timer, can be used from internal or external clocks.

WDT - a crude internal RC timer, of very low accuracy, if the WDT is enable it will reset the PIC as it times out. Your code should include CLRWDT instructions accordingly to prevent this. Used to reset your PIC if it gets locked in an endless loop (assuming you don't have a CLRWDT instruction in the loop).

Brown out detction - sets the voltage level that the PIC resets at, so if the power supply drops below a certain level the PIC will reset.

Thanks. I was reading the datasheet but I don't understand what it counts. But this makes it clear:

Used to reset your PIC if it gets locked in an endless loop (assuming you don't have a CLRWDT instruction in the loop).

Thanks again.

By the way, do you mind explaining the purpose of including multiple NOP continuosly in a specific programme? I found a programme where it has multiple NOP being used continuosly in a sequence. Thanks...
 
devonsc said:
By the way, do you mind explaining the purpose of including multiple NOP continuosly in a specific programme? I found a programme where it has multiple NOP being used continuosly in a sequence. Thanks...

Simply to give a specific time delay, one NOP takes one instruction cycle, if it only need a fairly small delay it's often easier to use a number of NOP's rather than bothering writing a loop.

In fact my IR tutorial uses a number of NOP's for the 40KHz generation, but only with a 4MHz crystal, with a 20MHz crystal I switch to a loop instead.
 
Thanks for your explanation regarding NOP.

Would like to ask you about the using the PWM from my PIC microcontroller to control my boost DC/DC Converter. You mention before about adjusting the duty cycle of the PWM to avoid overcharge of the 12V battery. Initially, I was thinking to step-up the voltage to a level to 15V from 7.5V. Instead of stepping it up with a duty ratio of 50%, can I just step the voltage level of 7.5V to 13.5V to avoid overcharge? What are the consequences that I might face if I were to do this?

Thanks in advance.
 
devonsc said:
Thanks for your explanation regarding NOP.

Would like to ask you about the using the PWM from my PIC microcontroller to control my boost DC/DC Converter. You mention before about adjusting the duty cycle of the PWM to avoid overcharge of the 12V battery. Initially, I was thinking to step-up the voltage to a level to 15V from 7.5V. Instead of stepping it up with a duty ratio of 50%, can I just step the voltage level of 7.5V to 13.5V to avoid overcharge? What are the consequences that I might face if I were to do this?

Yes, you can step it up as you like, it's up to you what value you choose. As I suggested before, you should look at the PICKit1 details, it generates 13V off a 5V USB supply, using the PIC A2D for feedback regulation.
 
Thanks.

Yes, you can step it up as you like, it's up to you what value you choose. As I suggested before, you should look at the PICKit1 details, it generates 13V off a 5V USB supply, using the PIC A2D for feedback regulation.

:oops: Sorry, forgotten about this "reading material". Will read it now...
 
devonsc said:
Thanks for your explanation regarding NOP.

Would like to ask you about the using the PWM from my PIC microcontroller to control my boost DC/DC Converter. You mention before about adjusting the duty cycle of the PWM to avoid overcharge of the 12V battery. Initially, I was thinking to step-up the voltage to a level to 15V from 7.5V. Instead of stepping it up with a duty ratio of 50%, can I just step the voltage level of 7.5V to 13.5V to avoid overcharge? What are the consequences that I might face if I were to do this?

Thanks in advance.

This absolutely will not work, because your output goes to a battery and you start from a solar cell. Either one of these components makes voltage feedback impractical.

The PWM feedback will be set up so you increase the duty if the voltage is too low and vice versa. What's going to happen is when you put a half-discharged battery on it, and your circuit has enough sun that it should be capable of a lot of current with optimum PWM freq, look at what happens. The battery voltage will rise to 12.6 volts, the PWM will increase and miss the maximum power point totally, and as it increases duty the output gets worse, not better! Your solar cell will see a short for a load and there is no charging current.

This type of circuit always has to use delta adjustments to find the max power point. The weird part is you don't know if your duty cycle is too high or too low by looking at the output. You just have to tweak the duty cycle in small increments one way or the other and see if it makes the output greater or lower. Now you can "sort of" use voltage feedback for this, but the problem is it's a lot slower to respond, whereas changes in current are much faster.

You can still use a voltage divider to read the battery voltage to sense overcharge, and cut back the current or shut off when it happens. But really, this isn't necessary with your setup at all.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top