Howdy,
I'm an aerospace engineer by education which means basically a mechanical degree with a fluid specialty. And I'm a biotech engineer by work experience. In other words, I don't know the first thing about electronics, but I'm pretty good with Google so I can get in over my head real quick.
TLDR: This is my first circuit design and I may be in over my head. I have a logic circuit that requires the output of one nand gate for the input of a preceding nand gate and when I initially bread boarded it up, it didn't do what my truth table says it should. I've since fixed it but could use someone with a bit more experience telling me wether this looks like a viable solution.
Problem:
I installed a big Lithium battery bank in my RV. It's great, it will run my roof air conditioner for a few hours and with solar, I can stay in the woods indefinitely. But my brand new 200A Bosch alternator died shortly after I did the Lithium install and alternator upgrade. My wife does several solo trips cross country for business so getting stranded in the middle of nowhere is not a great outcome. When I took the alternator to a repair shop, it had a failed pulley clutch.
Root Cause Hypothesis:
It could be that I got a bad alternator and I'm just on the unlucky side of small number statistics, or more likely, I have a design problem. The charge controller charges at full rate all the way to full, then pulses the charging current for a fraction of a second several times per minute to keep the batteries topped off. This works well on solar power but when the RV is charging from the 60A DC-DC converter feeding from my alternator, it's slamming the alternator pretty hard for thousands of cycles which I believe is leading to the mechanical failure of the pulley clutch.
Solutions:
Option 1.) Install a second alternator on the RV.
Pros: This provides redundancy and isolates the RV house battery from the van's chassis battery so if it fails again, we at least don't get stranded anywhere.
Cons: Nobody manufactures a second alternator kit for our van so procuring a custom alternator bracket will be expensive, as will another heavy duty alternator. And it still doesn't address the root cause of our problem.
Option 2a.) Turn off the alternator charging before the battery reaches full charge.
Pros: We already have a relay separating the house and chassis systems so adding a manual switch to turn off the alternator charging would be cheap and easy to install.
Cons: It takes some mental overhead to keep track of and estimate the state of charge of our lithium battery and then remember to turn off the switch to the relay. Failing to do so in time would result in dozens or hundreds of extra charging cycles on the alternator.
Option 2b.) Design a controller to turn on the battery relay off when the State of charge is 95% or greater.
Pros: The charge controller has several programmable I/O pins so it's pretty easy to get a 3.3v signal to feed a logic circuit and since there is already a relay in place, it shouldn't be difficult to integrate this circuit into the system. This should reduce the cycles to approximately 2 on/off events per day when driving in the south during summer when the roof AC is needed at lunch breaks. This also gives me the opportunity to learn about digital circuits or micro controllers.
Cons: Adding complexity and additional failure modes to an otherwise simple system. Since I don't have a background in electronics, there is a pretty steep learning curve involved.
My design:
I decided to go the digital circuit route since I believe this, if designed well, will be more reliable than an arduino based solution.
It can't be as simple at turning off the relay when hitting 95% SOC because it would come back on at 94.99% and I would have the same cycling issue. I need the relay off when the state of charge reaches 95% and stay off until it reaches 70% SOC, then turn on again. This lead me to create the following truth table:
A= 1 when >95% SOC
B=1 when >70% SOC
C=1 when the relay is on:
X= undefined states since the SOC can't be above 95% and below 70% at the same time.
ABC | Y
000 | 1
00 1 | 1
0 1 0| 0
0 1 1 | 1
1 00 | X
1 0 1 | X
1 1 0 | 0
1 1 1 | 0
With a little help from http://www.32x8.com/var3.html I created the following logic diagram which I converted to all NAND gates to allow the use of a 74HC00 logic IC:
Awsome! That looks simple enough.
So then I Google the data sheets on the 7400 ICs and learn that they don't operate at 12 volts and that they won't drive a 200mA relay. Next I Google voltage regulators and watch youtube videos on NPN transistors and come up with this design:
I probably should have labeled my schematic, but it's late and I've been up all night, so you've just have to trust that I can accurately look up data sheets and calculate the resistor sizes needed for a given gain for the NPN. ( Note, the 74HC00 is a wimp so I chose a transistors with pretty large gains). I don't understand all this stuff but the 74HC00 data sheet recommended the capacitor and not letting unused inputs float so added a .1uF capacitor and diode to the voltage regulator. This really feels like overkill but I saw somewhere that is was a good design practice. It makes more sense with the high inductance load of the relay coil so you will see a smaller capacitor and diode there.
I bread board it all up and immediately smoke my 100 mA voltage regulator. The 5v circuit shouldn't draw more than maybe 20mA so I'm suspecting I either installed it backwards or perhaps the .1uF capacitor was too large? I replace the regulator with a larger 700mA (1.5 A peak) 5v regulator from my local electronics shop and it's stable and stays cool. Unfortunately, in the scenarios when the logic is depending on the feedback from the last NAND gate, the output to the small motor that I'm using for a load warbles a bit as if the output isn't entirely stable. If I remove the feedback loop between 3Y and 2B and feed the 2B input directly from the 5v or ground busses, the output is much more stable.
ABC | Y
000 | 1
00 1 | 1
0 1 0| 0 These are the conditions that falter a bit
0 1 1 | 1These are the conditions that falter a bit
1 00 | X
1 0 1 | X
1 1 0 | 0
1 1 1 | 0
Is this just an issue of me not changing the input lead wires fast enough and the IC inputs float too long or is there a bigger issue with this feedback concept in general? If so, what's the solution to this issue? Do I try to slow down the voltage decay in that feedback loop long enough to keep the circuit from changing states? Given that that leg is also feeding the transistor, I suspect it decays pretty quick. I've started reading up on latching circuits but I can't make much sense of it. Maybe I'm out of my depth or just need some sleep.
Any advice on this main question or feedback on the rest of the circuit design would be greatly appreciated.
-lb
I'm an aerospace engineer by education which means basically a mechanical degree with a fluid specialty. And I'm a biotech engineer by work experience. In other words, I don't know the first thing about electronics, but I'm pretty good with Google so I can get in over my head real quick.
TLDR: This is my first circuit design and I may be in over my head. I have a logic circuit that requires the output of one nand gate for the input of a preceding nand gate and when I initially bread boarded it up, it didn't do what my truth table says it should. I've since fixed it but could use someone with a bit more experience telling me wether this looks like a viable solution.
Problem:
I installed a big Lithium battery bank in my RV. It's great, it will run my roof air conditioner for a few hours and with solar, I can stay in the woods indefinitely. But my brand new 200A Bosch alternator died shortly after I did the Lithium install and alternator upgrade. My wife does several solo trips cross country for business so getting stranded in the middle of nowhere is not a great outcome. When I took the alternator to a repair shop, it had a failed pulley clutch.
Root Cause Hypothesis:
It could be that I got a bad alternator and I'm just on the unlucky side of small number statistics, or more likely, I have a design problem. The charge controller charges at full rate all the way to full, then pulses the charging current for a fraction of a second several times per minute to keep the batteries topped off. This works well on solar power but when the RV is charging from the 60A DC-DC converter feeding from my alternator, it's slamming the alternator pretty hard for thousands of cycles which I believe is leading to the mechanical failure of the pulley clutch.
Solutions:
Option 1.) Install a second alternator on the RV.
Pros: This provides redundancy and isolates the RV house battery from the van's chassis battery so if it fails again, we at least don't get stranded anywhere.
Cons: Nobody manufactures a second alternator kit for our van so procuring a custom alternator bracket will be expensive, as will another heavy duty alternator. And it still doesn't address the root cause of our problem.
Option 2a.) Turn off the alternator charging before the battery reaches full charge.
Pros: We already have a relay separating the house and chassis systems so adding a manual switch to turn off the alternator charging would be cheap and easy to install.
Cons: It takes some mental overhead to keep track of and estimate the state of charge of our lithium battery and then remember to turn off the switch to the relay. Failing to do so in time would result in dozens or hundreds of extra charging cycles on the alternator.
Option 2b.) Design a controller to turn on the battery relay off when the State of charge is 95% or greater.
Pros: The charge controller has several programmable I/O pins so it's pretty easy to get a 3.3v signal to feed a logic circuit and since there is already a relay in place, it shouldn't be difficult to integrate this circuit into the system. This should reduce the cycles to approximately 2 on/off events per day when driving in the south during summer when the roof AC is needed at lunch breaks. This also gives me the opportunity to learn about digital circuits or micro controllers.
Cons: Adding complexity and additional failure modes to an otherwise simple system. Since I don't have a background in electronics, there is a pretty steep learning curve involved.
My design:
I decided to go the digital circuit route since I believe this, if designed well, will be more reliable than an arduino based solution.
It can't be as simple at turning off the relay when hitting 95% SOC because it would come back on at 94.99% and I would have the same cycling issue. I need the relay off when the state of charge reaches 95% and stay off until it reaches 70% SOC, then turn on again. This lead me to create the following truth table:
A= 1 when >95% SOC
B=1 when >70% SOC
C=1 when the relay is on:
X= undefined states since the SOC can't be above 95% and below 70% at the same time.
ABC | Y
000 | 1
00 1 | 1
0 1 0| 0
0 1 1 | 1
1 00 | X
1 0 1 | X
1 1 0 | 0
1 1 1 | 0
With a little help from http://www.32x8.com/var3.html I created the following logic diagram which I converted to all NAND gates to allow the use of a 74HC00 logic IC:
Awsome! That looks simple enough.
So then I Google the data sheets on the 7400 ICs and learn that they don't operate at 12 volts and that they won't drive a 200mA relay. Next I Google voltage regulators and watch youtube videos on NPN transistors and come up with this design:
I probably should have labeled my schematic, but it's late and I've been up all night, so you've just have to trust that I can accurately look up data sheets and calculate the resistor sizes needed for a given gain for the NPN. ( Note, the 74HC00 is a wimp so I chose a transistors with pretty large gains). I don't understand all this stuff but the 74HC00 data sheet recommended the capacitor and not letting unused inputs float so added a .1uF capacitor and diode to the voltage regulator. This really feels like overkill but I saw somewhere that is was a good design practice. It makes more sense with the high inductance load of the relay coil so you will see a smaller capacitor and diode there.
I bread board it all up and immediately smoke my 100 mA voltage regulator. The 5v circuit shouldn't draw more than maybe 20mA so I'm suspecting I either installed it backwards or perhaps the .1uF capacitor was too large? I replace the regulator with a larger 700mA (1.5 A peak) 5v regulator from my local electronics shop and it's stable and stays cool. Unfortunately, in the scenarios when the logic is depending on the feedback from the last NAND gate, the output to the small motor that I'm using for a load warbles a bit as if the output isn't entirely stable. If I remove the feedback loop between 3Y and 2B and feed the 2B input directly from the 5v or ground busses, the output is much more stable.
ABC | Y
000 | 1
00 1 | 1
0 1 0| 0 These are the conditions that falter a bit
0 1 1 | 1These are the conditions that falter a bit
1 00 | X
1 0 1 | X
1 1 0 | 0
1 1 1 | 0
Is this just an issue of me not changing the input lead wires fast enough and the IC inputs float too long or is there a bigger issue with this feedback concept in general? If so, what's the solution to this issue? Do I try to slow down the voltage decay in that feedback loop long enough to keep the circuit from changing states? Given that that leg is also feeding the transistor, I suspect it decays pretty quick. I've started reading up on latching circuits but I can't make much sense of it. Maybe I'm out of my depth or just need some sleep.
Any advice on this main question or feedback on the rest of the circuit design would be greatly appreciated.
-lb
Last edited: