2

I'm trying to create an automatic water pump for my dear old pussy cat (I'm using her as an excuse, really I wanted a project of some sort)

I have the following Circuit:

enter image description here

R1 is the water itself S1 is the water being conductive and completing the circuit through the water

When power is applied to the circuit all the opAmps are LOW, the MOSFET is allowing current to flow from Source to Drain and the motor/pump spins.

When a connection is made i.e the water from the pump fills the bowl to a certain level (R1/S1), 7mv goes to the non-inverting A input of the opAmp. This saturates the output (5v) due to open-loop gain, charges the Cap at C1 and also saturates the B output of the opAmp, shutting off the MOSFET.

When the connection is lost i.e the cat has a drink and the water level drops. The A opAmp goes low and C1 is allowed to drain through the 15k Resistor (R5). After the cap is drained (~seconds) the motor spins, the bowl fills up.

Eventually I am going to have an RFID tag on her collar which will turn on a relay to provide power to all this, but thats phase 2.

I know I would be better of using proper comparators, but this opAmp suffices. Like I said, this circuit is working as I expect, but are there any recommendations from anyone at all?

JYelton
  • 32,302
  • 33
  • 134
  • 249
  • 3
    I'd seriously consider using a float switch instead of potentially running 5V through your cat if your cat happens to be the shortest path to ground. – Ron Beyer Aug 08 '19 at 13:17
  • 3
    Shes a lazy cat, could do with a jump start :D – Chris Robertson Aug 08 '19 at 13:22
  • 2
    Forgive me for my safety concerns, but is there some limit on the quantity of water that is dispensed if you've gone for the weekend and the circuit malfunctions? Maybe it's coming from a fixed-volume reservoir? – Spehro Pefhany Aug 08 '19 at 13:41
  • 1
    **Cat owner:** Installs fancy cat watering device so the cat has fresh water. **Cat:** Scratches around the watering device as though covering up after a bad case of the runs, then drinks out of the watering can in the garden behind the rose bushes, isn't bothered by the dead bugs in the brackish, week old water. – JRE Aug 08 '19 at 14:34
  • Been there, done that, still have the brainless cat. And a fancy porcelain water fountain with pump. – JRE Aug 08 '19 at 14:35

3 Answers3

4

The LM358 is not a rail-to-rail op amp so it won't work in a low voltage circuit like this.

When there is no water (the switch is open) both inputs of the first op amp will be very close to ground. What makes you think the op amp output will be low in this case?

Elliot Alderson
  • 31,192
  • 5
  • 29
  • 67
  • 1
    LM358 works OK on 5V - Common mode voltage is about Vcc-1.5V. Vout does not rail high very enthusiastically but gets nearish. A modest pullup helps. – Russell McMahon Aug 08 '19 at 13:12
2

The LM358 will work from 5V as long as neither input exceeds about 3.5V - so that's OK.

The FET gate should be pulled up to 5V as the opamp does not pull well to positive rail. (It's a vaguely rail to rail output amplifier with a little help).

The immensely overspecified IRF9540 MOSFET (grunty is fine if it works and you have one) has a turn on voltage nominally of 4V and more in practice usually - so should be marginal. If it works it may have lower than average Vgsth.

Neither opamp is biased to act as a comparator reliably - you may have been lucky with input offset voltages.

SO - the following will make the circuit "look correct".
If it works now it's uncertain if correcting it will make it better or worse, but ...

Add a small bias voltage to the (now) non-inverting inputs - say a 1k to ground and 220k to V+ (5V) and connect the midpoint to both non-inverting inputs and add a small capacitor to ground. (0.1 uF say)(or larger).

MAYBE make R2 larger - tbd.

A lower VGsth FET is recommended but as a one off if it works it works.

C2 probably not needed.

Connect R9 from opamp B output t V+ (5V) and increase to 10kish.


A similar circuit based around a hex inverter CMOS Schmitt trigger suh as CD40106 / 74C14 / ... could be designed to have a quiescent current of microamps - 4 x AA Alkaline cells would last the shelf life of the battery - maybe 5+ years if the cat is not too thirsty.

Water pulls input up as now.
Pull down in the megOhm range.
One inverter section follows to get polarity right and drive FET.

4 spare inverters to make a siren or flashing light or whatever :-) eg an alarm that flashed a light if water pump did not restore water level within X seconds.

Russell McMahon
  • 147,325
  • 18
  • 210
  • 386
0

A few things to augment existing suggestions:

1) tests what happens if there's a radio transmitter such as a phone or wifi network device ON and active somewhere near

2) some security measures to stop the system and alarm if

  • the pump starts to consume exessive current or
  • the water cup isn't changed to a clean one in 48 hours
  • the water level doesn't rise fast enough (already suggested)
  • Adding such limits are additional reasons (beyond calibration concerns) why a practical useful implementation of this goal would probably use an MCU... – Chris Stratton Aug 08 '19 at 14:28