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.

Basic battery monitor/charger HELP ME!!

Status
Not open for further replies.

DJAE

New Member
Self taught amateur, so please be gentle!
Working a this project for a friend:
A very basic battery charger for a 12v Gel Cell bike battery. All it does is supply an unregulated 15v. I have an opamp configured as a basic comparator detecting the output voltage vaia a voltage divider/pot. the output is pulled low by the load the battery presents (txfmr is 20vA). When the output rises above the full battery voltage the voltage divider sets a reference voltage tied to non-inverting pin of opamp, if this rises above a threshold voltage on inverting input of opamp then the output swings high (toward 9v rail), through resistor, into base of PN2222a saturating it. The relay coil is tied between 9v and collector of transistor and is activated when opamp output swings high.

The charging output (battery) is connected to the n/c of the relay, and when it is activated the output is disconnected stopping the charging cycle.

IT'S CRUDE I know, but on paper should work. I also know there are dedicated comparators out there, but this SHOULD work!!??

I have included my schematic and layout. Please not i didn't have a zener to hand so the threshold voltage to the opamp is currently being set by two 100k resistors (1/2 VCC).

My problem is this: With nothing connected to the output the opamp output is constantly high (about a diode drop below VCC; 8.4 v) meaning there is no output.

Here's what i have tried:
Lifting R1
Lifting R6
Connecting a DC source to the output
Adjusting the POT
Lifting the reverse diode (on the relay)
Changing the opamp
Presenting a resistive load to the opamp output (making a volatge divider at base of PN2222a)

In all these scenarios the output stays high. At first i though i blew an opamp, but i think i eliminated that by replacing it and ensuring that all voltages in to it were within tolerance.

Any help would be gratefully received.

Thanks
ADAM
View attachment 65762
View attachment 65763
 
Also i added an extra cap across txfmr secondary seen on pcb but not schematic and the primary cap is fitted off the board at the 240v ac input terminals.

Thanks
 
Quickly looking at the datasheet for the TL081, I think that your supply voltage (8v) is too low.
The datasheet which I looked at (ST Microelectronics) does not appear to explicitly state the minimum voltage, but I cannot help but think that the minimum is 10 volts (+/- 5v).
The maximum supply is +/- 18v (36v total), so you could probably connect the U2 supply to the input of your 7808 regulator.

However, if you do that, there may still be a problem in that the output of the TL081 may not swing low enough to turn off Q1.

As drawn, your scematic shows D3 connected to the wrong place, although you PCB layout shows it correctly to the 0v line.

Possible design failings are:
1 That if the mains supply fails, the battery will power the circuit via the input of U1, thus turning the charger into a discharger.
2 The green "Charging" LED will also discharge the battery when the charger automatically disconnects. Not really a "charging" indicator, more a "voltage on the battery connection" indicator.

Mmmm...
I seem to have ripped your design apart a bit, sorry about that but it seems a bit "iffy" to me.

JimB
 
Hi Jim,
I'm quite happy with your constructive and helpful comments, hardly ripping it apart!

Ok, so look now at the corrected attached image: diode in series with output to prevent discharge, and zener connected in correct position. Is that better?

OK, as for the main issue: If i swapped out the 7809 for a 7812 and changed values accordingly would that help do you think? I must say though i have seen opamps run from single 9v supplies, but maybe not the tl081. What i am seeing at the output pin is the 9v rails minus a little bit (maybe a diode drop?), would supply voltage problems cause that do you think?

QUOTE: However, if you do that, there may still be a problem in that the output of the TL081 may not swing low enough to turn off Q1.
I'm turning on Q1 with any voltage high enough; i'll take what i can get! If i can just get the output to swing low can i not use voltage drop across resistor (or maybe voltage divider) to drop of the last few mV?
View attachment 65765
 
Last edited:
Hi Jim,


OK, as for the main issue: If i swapped out the 7809 for a 7812 and changed values accordingly would that help do you think? I must say though i have seen opamps run from single 9v supplies, but maybe not the tl081. What i am seeing at the output pin is the 9v rails minus a little bit (maybe a diode drop?), would supply voltage problems cause that do you think?

View attachment 65765
Actually, can i do this? won't a charging battery pull the voltage below the 13.2 v input required by the 7812 input?
 
OK, that looks a bit better.

Getting back to your original problem, the op-amp output sitting high all the time.
What you need to do is to get to the situation where pin2 of the opamp is more positive than pin3, then the output should go to some low value near to 0v.

Check that there are no (accidental) connections to the null-offset pins of the opamp (pins 1 and 5), that would make the output stick high or low.

JimB
 
Ok, i tried what you said and cut track on PCB (so i'm already on a slippery slope!) and connected pin 7 of opamp to the unregulated voltage (approx 21v off load) and sure enough the output remains high (approx 18v).

Looking at the datasheet shouldn't the output be low without anything connected to either input (i.e. when i lifted both resistors to inputs)?

View attachment 65770
 
connected pin 7 of opamp to the unregulated voltage (approx 21v off load) and sure enough the output remains high (approx 18v).
OK, now we are sure that the op-amp has plenty of supply volts, which may or may not be needed, you can revert your track-cut later if required.

As I said in post #6 :
What you need to do is to get to the situation where pin2 of the opamp is more positive than pin3, then the output should go to some low value near to 0v.

When pin3 is positive with respect to pin2, the output will be high.
When pin3 is negative with respect to pin2, the output will be low.

Use your meter and test the inputs.
Connect a battery to the charging connector and adjust R2 to give a lower voltege at pin3 than pin2, and then measure the output.

shouldn't the output be low without anything connected to either input (i.e. when i lifted both resistors to inputs)?
No, not necessarily.
The gain of the op-amp is so high that microvolts of difference will drive the outputs one way or the other.

Leaving op-amp outputs unconnected - a recipe for confusion!

JimB
 
OK, now we are sure that the op-amp has plenty of supply volts, which may or may not be needed, you can revert your track-cut later if required.

Here we go again! If ONLY i was organised enough to use my breadboard! I was so confident in this basic circuit that even i could understand it!

As I said in post #6 :
What you need to do is to get to the situation where pin2 of the opamp is more positive than pin3, then the output should go to some low value near to 0v.

When pin3 is positive with respect to pin2, the output will be high.
When pin3 is negative with respect to pin2, the output will be low.

Use your meter and test the inputs.
Connect a battery to the charging connector and adjust R2 to give a lower voltege at pin3 than pin2, and then measure the output.

I know that this should work as a comparator, and how, but in my mind with 1/2 vcc on pin 2 (non inverting) and no battery connected (i.e. nothing on pin 3) then the output should be low right? And then i realize; wouldn't that then create a voltage on pin 3, and if that's higher..... so i got a little confused!

I tried another op-amp, an opa606 (overkill for this application i realize), and at first switch on the thing went NUTS switching that relay so fast the circuit was dancing around my bench (it was switching Jim, but not as we know it!)... I eventually caught the little sod and packed it in for the night. This was WITHOUT a battery connected so i am quietly optimistic!

No, not necessarily.
The gain of the op-amp is so high that microvolts of difference will drive the outputs one way or the other.

Leaving op-amp outputs unconnected - a recipe for confusion!

JimB
Hence the offsets! DERRRRRBRAIN, i'm so blind sometimes! Thanks Jim, i will post again later, either way!
 
Last edited:
Dougy83 offered some advice on this circuit (by accident) in another post. He mentioned some basic hysterisis to prevent rapid relay switching at threshold voltage, but i ahve only ever seen hysterisis applied digitally (to industrial lighting and other applications at work). How would i apply it here? Could i use a capacitor to delay charging on 1 pin?

I would really appreciate any assistance. this isn't even for me, i offered to help someone out and have opened a whole can of worms!

I would just like to get a circuit working for my friend's bike!

Thanks
 
Add a resistor between the pot and the + input, and then another between the + input and the output and you have hysteresis. Or if you're not tied to that circuit I'd replace the opamp with a 555 timer; I can provide a drawing if you're interested.
 
Last edited:
Add a resistor between the pot and the + input, and then another between the + input and the output and you have hysteresis. Or if you're not tied to that circuit I'd replace the opamp with a 555 timer; I can provide a drawing if you're interested.

Sorry, excuse my ignorance but won't adding positive feedback prevent the opamp for acting as a comparator? I thought the main difference between other opamp configurations and the comparator was the lack of feedback?! Suggetsed resistor value please? And a very basic description of what its doing would be good; i don't like implementing what i don't understand!

I did consider using a 555, i would be interested in seeing your idea please.

Thanks a lot for you comments!
 
Sorry, excuse my ignorance but won't adding positive feedback prevent the opamp for acting as a comparator? I thought the main difference between other opamp configurations and the comparator was the lack of feedback?! Suggetsed resistor value please? And a very basic description of what its doing would be good; i don't like implementing what i don't understand!
There's a lot of difference between positive and negative feedback. Yes, adding negative feedback allows you to control the gain. Adding positive feedback as shown allows you to adjust the set-point slightly when it switches... that wasn't explained very well, so please have a look here:

and https://www.electro-tech-online.com/custompdfs/2012/07/OpAmps01.pdf section 1.10.2

As far as resistor values go.. you could try a 100k from the pot and a couple of MEGs in the +ve feedback path - that should give a few hundred millivolts hys.

Sure I'll draw up the 555 bit soon
 
The pot going to pin 2 sets the low threshold, the pot to pin 6 sets the high threshold.

I hope you don't mind the rough circuit.. I left out most of it as it's based on your schematic, just using a 555 instead of the 741. Add the caps on the supply rail, etc.
 
Hmm, 555's eh, the do it all chip. It is exactly the circuit i thought, setting the reset and threshold pins with dividers, and looking at it now may have been the simpler way to go. However, as previously mentioned this is a circuit for someone else that i drew up in a weekend, and to that end i don't think it's too bad. Given that it's all on a PCB already i will probably just go with the hysteresis. I can't believe that i said i have only ever seen hysteresis applied digitally and the you show me a Schmitt trigger! I guess these are the dangers of picking up electronics as a hobby and trying to piece it all together as you go!

That PDF looks pretty interesting, i will have a proper read later. Does positive feedback follow the same rules as negative? (i.e. is the feedback loop at zero potential?) If so why the extra resistor between the pot and input; why cant the branch of the pot do the same job? Or is it a case of currents?

I really appriciate all your help.

Thanks
 
Last edited:
>> That PDF looks pretty interesting, i will have a proper read later.
The section on positive feedback I mentioned is less than a page and a half, which includes pictures.

>> Does positive feedback follow the same rules as negative? (i.e. is the feedback loop at zero potential?)
No, different rules. I'm not sure what you mean by 'zero potential' unless you're referring to the voltage between the inputs. If this is what you mean, then no, the voltage can be markedly different and the output will be either high or low.

>> If so why the extra resistor between the pot and input; why cant the branch of the pot do the same job? Or is it a case of currents?
You can just use the resistance of the pot, but it changes as you adjust it (from 0 to <10k). The 100k resistor gives us a stable 100k-ish (from 100k to <110k) resistance to work with, irrespective of the value of the pot.

>> I really appriciate all your help.
You're most welcome.
 
Status
Not open for further replies.

Latest threads

Back
Top