Updated schematic to correctly reflect what I wrote below...

enter image description here

I’ve had to add more functionality:

enter image description here

enter image description here

Top left: The linear regulator has been replaced by a LM2575-5. This will be the HV variant with a Vmax of 60v. The Diode is a Shottky, not a Zener as shown.

Bottom left: Simplified the XOR transition detector to only one Schmitt inverter per leg, by using inverted output of bi-stable to drive one side of XORs.

Bottom right: Added a relay to soft-switch the pump off (Pump OFF), so it isn’t running during supply changes.

Middle right: The two RC/Inverter pairs after each bi-stable are to add an initial delay before any switching takes place. I want to have a further delay between switching off one supply (Solar) and switching on another (Battery), using two separate contactors. The 3 NOR gates act as an AND. The last inverter is there so that the default supply (Solar) is from the NC relay contacts, so current is minimized – no relays energized in normal operations.

Bottom right: This new relay controls a soft-switch (Enable Batt Ops/Using Batts) on the pump telling it whether it is running from Solar (MPPT enabled) or Batteries (separate under-voltage functionality enabled).

I’ve included a timing/state diagram (SX rotated it and I couldn't figure out how to correct) to show how it should work.

Does this all look OK? I don’t care about the unlabeled switch functionality.

I have a further question:

As shown, the “Enable Batt Ops/Using Batts” relay switches on Delta #1 after the switch selects Batts and off Delta #1 after the switch selects Solar as the power source for the pump.

The pump senses the state of this relay on a POR. So I’d like it to go high when the “Supply from Batts” relay closes, and to go low when the “Supply from PV (Solar)” relay opens, as shown in Red in the timing diagram, i.e. each time a new supply source is connected.

I could add another RC stage for this relay to extend the delay to be slightly less than Delta #2. Is there a simple way to switch it based on the supply transitions?


I’m looking for some help reviewing and simplifying the circuit shown.

enter image description here

It’s to control a pump that can be powered from 3 different sources (Solar PV, Genny, Batteries - but not that relevant to the design, correct voltages taken care off). The pump has a remote on/off switch activated by shorting between two terminals. The purpose of this circuit is to always power the pump down before switching supply, so that the load is minimal. This reduces DC arcing in the contactors, and keeps the pump happy. I have 24V DC (coil) contactors that will be controlled by the relays shown.

The component values shown are simply what the schematic package defaulted to, ignore them.

At the top left is a separate battery under-voltage disconnect circuit, using an NE555. Battery voltage (44-48V) is on the left. The outputs on the right go to a contactor that switches the battery off if the input voltage drops too low. The two resistor voltage dividers are set to provide hysteresis.

The two switches on the left select either Solar, else Genny or Batteries. I’ve used an S-R latch to eliminate any switch bounce. They each have an RC delay stage (say 2 secs) driving a relay (that then drives a contactor, not shown). I’ve seen people use two Schmitt inverters – for hysteresis – to ensure a positive switching action at the relay. But given the S-R latch, do I need these?

It’s been a very long time since I looked at a transistor, and the world has moved on. Can anyone suggest a general purpose NPN device to drive a 5V relay coil? Or would a MOSFET be better?

The two XOR gates at the bottom act as a transition/edge detector. Any time either of the two switches changes states, this circuit energises a relay whose contacts are connected to the remote switch on the pump. The RC delay will be around 4 secs, to give a 4 sec positive pulse output on any edge change.

So, if a switch is pressed, the pump will immediately be commanded to switch off. 2 seconds later the selected contactor will switch output, and a new power source connected. 2 seconds later the pump will be released and start again.

As noted I don’t think I need the Schmitt inverters, but would like to know if there is any reason why not.

What’s the best way to create a single OR gate (there are two spare XOR gates available) instead of using a 7432? Perhaps just a couple of diodes?

I’d welcome any thoughts on the circuit - can it be improved and/or simplified?

  • \$\begingroup\$ A 2N7000 (NMOS) or PN2222A (NPN BJT) should work fine for switching the relays. I would lean toward using the 2N7000 since it can be directly connected to the Schmitt trigger output. \$\endgroup\$ Commented Sep 30, 2019 at 23:08
  • \$\begingroup\$ do you want to be able to turn both relays on at the same time? \$\endgroup\$ Commented Oct 1, 2019 at 3:59

1 Answer 1


44V is kind of high for a 7805, the voltage divider for the 555 input only needs 3 resistors not 4

I don’t think I need the Schmitt inverters,

the whole thing is a mix of analogue and digital, schmitt inverters behave well with analogue inputs, if you were to connect directly to the transistors there would be a period where the transistor was not not saturated and it would get quite hot, and possibly fail closed.

You don't need that many schmitt inverters, use the inverted signal from bistable to feed the the R-C delay then you only need one instead of two.

at the bottom put the schmitt inverters after the R-Cs not after the OR.

or re-design to use 74HC7014 (schmitt buffer).

the whole thing is critically reliant on the capacitors for timing, so use quality parts and all from the same batch.

a diode or will work fine, or even a resistor or: just use two base resistors one for each input, the base when high is only about 0.7V so a low XOR output won't steal much of the current that a high one will supply.

XOR is a bit of a funny beast the only other gates it can be used to build are wider XORs , buffers and inverters, it can't make an AND or an OR.

With TTL you can short outputs together to get an AND, but that will not work with CMOS

  • \$\begingroup\$ Great response, thanks. Some very helpful suggestions. What was I thinking asking whether the Schmitt triggers were required?! - I'd overlooked the RC stage taking everything analogue... To answer your earlier query, in some scenarios both relays can be on at the same time. For the Diode OR, it’s preceded by 7486 XOR gates. What’s the advantage of a Schmitt stage after it - won’t the 7486 output be stable enough? Or are you saying I just need to buffer the logic level? \$\endgroup\$
    – David00
    Commented Oct 1, 2019 at 10:00
  • \$\begingroup\$ the XOR stage probably wants schmitt buffering of the XOR inputs that connect to capacitors, but yeah an OR gate, a diode OR can feed the transistor directly. or even a resistor OR: just use 2 base resistors \$\endgroup\$ Commented Oct 1, 2019 at 20:38
  • \$\begingroup\$ I deleted thje bit about buffering the diode OR it made no sense to do that in this context \$\endgroup\$ Commented Oct 1, 2019 at 20:43
  • \$\begingroup\$ @David00 I can'y accept that edit, it had many good things, but the inputs to the XORs had the wrong signals, the plain and the inverted delayed should come from opposite sides to the flip-flop. \$\endgroup\$ Commented Oct 3, 2019 at 0:00
  • \$\begingroup\$ Thanks for spotting this error. It's been over 30 years since I looked at circuit design. I noticed another introduced issue by not re-inverting before the logical AND. Will submit a new edit for review. \$\endgroup\$
    – David00
    Commented Oct 3, 2019 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.