go_away

Author Topic: Charging NiMH batteries (in-circuit)  (Read 7483 times)

0 Members and 1 Guest are viewing this topic.

Offline vinniewryanTopic starter

  • Full Member
  • ***
  • Posts: 56
  • Helpful? 2
Charging NiMH batteries (in-circuit)
« on: March 10, 2011, 01:11:44 PM »





I'm building a circuit which is powered off of 3 AAA NiMH batteries at 3.6V. These cells power a microcontroller and some other circuitry. The microcontroller not only controls the I/O functions of the circuit, but it also has to control charging of the batteries, this is where things get a bit complicated..

I'm going to use some simple identifiers to help me word this.

Bs+ (positive supply of battery)
Cs+ (positive supply of charger)
Vd+ (positive drain of circuitry)

Bs+ of the batteries is NOT directly connected to Vd+ of the circuitry, there is a P-channel MOSFET between Bs+ and Vd+. The gate of this MOSFET is pulled low through a 100K resistor which allows the circuit to be powered by the batteries. When the charger is plugged in, it pulls the gate high which disconnects the battery from the circuitry, and at the same time applies Cs+ (charger) to Vd+, powering the circuitry through the charging port. Still following? Now this is where my problem lies; I'm currently using another P-channel MOSFET to connect Cs+ to Vs+, which will supply current from the chargr to the battery (when charging is needed), but this doesn't work because when there is a positive supply on both the source and drain pins of the MOSFET, current flows from 'source' to 'drain' regardless of the gate pin.

To eliminate this problem I tried using a diode to prevent current from going through the MOSFET in the wrong direction, but then Bs+ is reduced by 0.4V and that is not acceptable because then my circuitry shuts off prematurely. Here's a schematic. The red arrows at the top represent where current flows through the mosfet regardless of whether the gate is high or low. I tried adding a diode from 'drain' to 'Vd+' which corrects the problem, but reduces the voltage. I need a work around! J1 is a 3-pin mono headphone type jack (Gnd, +, +). The two '+' terminals are NOT connected together until I plug something into the jack.

Any suggestions?


Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Charging NiMH batteries (in-circuit)
« Reply #1 on: March 10, 2011, 05:24:50 PM »
Hi,

Any suggestions?

A few...
Don't use N-channel MOSFET symbols if you mean to use P-channel devices, it makes the schematic harder to follow.

Although filled with facts (I assume), your description is a bit hard to follow too. Better just keep to what you want it to do.

Sure a P-channel device have a diode letting current through "the other way". A bipolar device would cure that.

Is the complete circuit your own construction, perhaps not even built yet?

Why do you want to keep the controlling micro from being connected to the battery?
If you use the controller as a charge controller as well, it NEED to be able to sample the battery voltage directly at the positive pole, while having a good low impedance connection to the negative pole as well.

If you describe exactly what you want it to do, it will be so much easier to help you.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline vinniewryanTopic starter

  • Full Member
  • ***
  • Posts: 56
  • Helpful? 2
Re: Charging NiMH batteries (in-circuit)
« Reply #2 on: March 10, 2011, 07:52:47 PM »
Thank you for your response!

I apoligize for the incorrect FET symbol, I threw that diagram together in 10 minutes at work to make sure I got it up today.

I had a voltage monitor connected from the battery to the mcu, but then I read that it wasn't required in 'Fast-charging' circuits where a temprature sensor is used to detect a full charge.

The reason I want to disconnect the battery from the microcontroller is because when it's charging, there will be a seperate 5V supply which will power the circuitry, MCU, and supply charging current to the battery. If I dont disconnect the battery when it's fully charged, it will never stop charging because V+ is shared by the battery and the charger.

Basically, my circuit needs to automatically go into charging mode when the charger is plugged in, charge the battery, then disconnect it (the battery) until the charger is unplugged, at which time the circuit will be powered by the battery again. It's a remote-controlled device that has no on/off switch, so everything must be automatic. Also I need to keep my parts count and cost to a minimum so I'm using a microcontroller to do all the charging work. I have built in ADC's which I previously used to monitor voltage, but like I said, I later found out that it wasn't necessary.

PS, the I/O port of the microcontroller enables and disables current from the charging port to the battery.
« Last Edit: March 10, 2011, 07:55:12 PM by vinniewryan »

Offline vinniewryanTopic starter

  • Full Member
  • ***
  • Posts: 56
  • Helpful? 2
Re: Charging NiMH batteries (in-circuit)
« Reply #3 on: March 11, 2011, 05:27:11 PM »
I suppose the simple question here is, what's the best way to electronically connect and disconnect a 3.6V battery to a 4.2V source? So when the electronic switch is on, the battery gets charged from the 4.2V source, when the switch is off, the battery is disconnected completely and when tested with a volt meter, the battery V+ terminal shows the true voltage of the battery.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Charging NiMH batteries (in-circuit)
« Reply #4 on: March 12, 2011, 01:16:55 PM »
Hi,

I suppose the simple question here is, what's the best way to electronically connect and disconnect a 3.6V battery to a 4.2V source? So when the electronic switch is on, the battery gets charged from the 4.2V source, when the switch is off, the battery is disconnected completely and when tested with a volt meter, the battery V+ terminal shows the true voltage of the battery.

You should still measure the voltage of the cell, to avoid bad things, even if you sense the temperature of the cell.

This circuit should do, the rest is software.

If you wanna use a MOSFET, you have to dig one up that works reliably (and with low R_ds_on) on such a low voltage - better go with Bipolars.


I had a voltage monitor connected from the battery to the mcu, but then I read that it wasn't required in 'Fast-charging' circuits where a temprature sensor is used to detect a full charge.

Sounds a bit unsafe.


The reason I want to disconnect the battery from the microcontroller is because when it's charging, there will be a seperate 5V supply which will power the circuitry, MCU, and supply charging current to the battery. If I dont disconnect the battery when it's fully charged, it will never stop charging because V+ is shared by the battery and the charger.

There's no need for a separate 5V supply, just run it off the battery while charging.
When the battery goes some way down, reapply charge and if the charger is not connected, poll the pin every now and then. If the charger is on, you can see it by the battery voltage rising.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline vinniewryanTopic starter

  • Full Member
  • ***
  • Posts: 56
  • Helpful? 2
Re: Charging NiMH batteries (in-circuit)
« Reply #5 on: March 13, 2011, 05:07:26 AM »
Quote
This circuit should do, the rest is software.

This should work, but I would send R1 low and get rid of Q2(& R2) and use the I/O pin of the MCU to disable charging instead of enabling it. Otherwise if the battery is too low to power the MCU then it will never be able to enable charging through Q1. This should work perfectly! Thanks! Now I need to figure out a new solution for monitoring the batteries voltage, currently I'm using an ADC for this but my ADC Vref can't exceed V+ so I have no reference voltage to compare the batteries voltage to. This is originally why I was using CH+ to power the MCU during charging, so I can compare the battery to CH+ for voltage monitoring. Thoughts?

Quote
Sounds a bit unsafe.

That's what I thought :/ so I left it in anyway and added some programming to limit the charge time.

Quote
There's no need for a separate 5V supply, just run it off the battery while charging.
When the battery goes some way down, reapply charge and if the charger is not connected, poll the pin every now and then. If the charger is on, you can see it by the battery voltage rising.

Good point, and when the battery is done charging I'll send the MCU into standby mode with a wake-up capacitor to drop the current consumption and wake up every so often to check the drain status of the battery.

Thanks so much for your help, having a second opinion on this kind of thing really helps when I'm stuck in a train of thought.

Cheers!
« Last Edit: March 13, 2011, 05:30:38 AM by vinniewryan »

Offline vinniewryanTopic starter

  • Full Member
  • ***
  • Posts: 56
  • Helpful? 2
Re: Charging NiMH batteries (in-circuit)
« Reply #6 on: March 13, 2011, 05:18:50 PM »
You know, I just re-built the circuit on a bread board using a P-mosfet to switch the battery on and off to the charging current again, and it seems to be working just fine... This is very odd because when I built the circuit using SMD components it was giving me a voltage through the fet. Perhaps there was an error in my board design, though I checked my traces and searched for errors with a scope and multimeter and the only problem I could find was directly caused by the mosfet, so it seems I have much more testing to do before ruling out all other possibilities. I'll update when I figure somthing out.

Offline vinniewryanTopic starter

  • Full Member
  • ***
  • Posts: 56
  • Helpful? 2
Re: Charging NiMH batteries (in-circuit)
« Reply #7 on: March 13, 2011, 06:57:47 PM »
Okay so I figured it out, the original problem was in my first circuit where I was using 2 MOSFET's. 1 to enable and disable the battery to V+, and the other to enable and disable CH+ to the battery. I found that 1 MOSFET will work perfectly, the following schematic shows my new circuit:



The voltage after the diode rests perfectly at 4.2V, and when the FET is disabled the battery holds charge and shows true voltage on my volt meter, which means it will be just perfect for the ADC as well because my Vref is 4.2V+ (Vdd).

Thanks so much for your help and suggestion, I've been trying to re-design this for months now off and on, and I was set on the idea that I needed 2 FETs. Now I believe i have a perfectly functioning charging circuit with all monitoring capabilities necessary :D

Cheers!

Offline oleamm

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Re: Charging NiMH batteries (in-circuit)
« Reply #8 on: January 24, 2012, 05:16:55 AM »
Okay so I figured it out, the original problem was in my first circuit where I was using 2 MOSFET's. 1 to enable and disable the battery to V+, and the other to enable and disable CH+ to the battery. I found that 1 MOSFET will work perfectly, the following schematic shows my new circuit:



The voltage after the diode rests perfectly at 4.2V, and when the FET is disabled the battery holds charge and shows true voltage on my volt meter, which means it will be just perfect for the ADC as well because my Vref is 4.2V+ (Vdd).

Thanks so much for your help and suggestion, I've been trying to re-design this for months now off and on, and I was set on the idea that I needed 2 FETs. Now I believe i have a perfectly functioning charging circuit with all monitoring capabilities necessary :D

Cheers!

Can you explain about using resistors? 10k, 100k, 1k. Why do you use it?

--------
PS: Forum admin is really crazy man!!! 7 verifications to register and than 7 verifications to reply this topic. "Type the letters shown in the picture, Type the word 'robot' here, Type the numbers '54321' here, Is the weather in Florida normally hot or cold?, ....".
Really crazy! Can't answer to topic more than 10 times!  :o :-\

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Charging NiMH batteries (in-circuit)
« Reply #9 on: January 24, 2012, 06:49:27 PM »
Hi,

[...]

PS: Forum admin is really crazy man!!! 7 verifications to register and than 7 verifications to reply this topic. "Type the letters shown in the picture, Type the word 'robot' here, Type the numbers '54321' here, Is the weather in Florida normally hot or cold?, ....".
Really crazy! Can't answer to topic more than 10 times!  :o :-\
What's crazy is the amount of spam any forum sees, unless those running things are vigilant about keeping it out.

Don't worry, as soon as you're proven human and non-spammer, those entertaining little quizzes will vanish.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

 


Get Your Ad Here

data_list