We're trying to build a circuit that switches on a pump via a Pi gpio pin.
Requirements
- Pump: runs at 5V, working current ca 100 mA (Link)
- PI gpio pin restrictions apply: 3.3V, max allowed draw is low (Ref)
- Runtime via "high": Pump needs to run as long as gpio is "high", normally 1-3 seconds
- Maximum runtime: Pump must never be allowed to run more than approx. 5 seconds, even if the gpio stays high longer (failsafe)
- Cooldown: Can not immediately "re-start" pump, desired cooldown is around 30 seconds (failsafe)
Solution Attempts
I've come up with multiple ideas, but they all have some (major?) problems
1. Mosfet
Using a simple Mosfet Irf510.
This works, but does cause the Mosfet Gate Voltage to change slowly. And my understanding is that Mosfets don't like being in the Miller Plateau for very long (lifespan!). Then again, the Mosfet is extremely beefy and this is only in the emergency phase - i.e. shouldn't happen very often. So maybe this is not a problem?
Related to that, the auto "shutoff" isn't abrupt, but gradual. This is undesired.
2. 555 with Mosfet
Using a 555 timer IC. There are some problems with this
- Inductive Load of the pump would probably destroy the 555
- Voltage at Source and Drain for the Mosfet would probably reduce lifespan
- Even if this was salvageable, there are lots of components used (!)
3. Microcontroller
Using a MCU, e.g. a STM8S103.
I haven't actually tried this. It should work, but seems somewhat overkill - especially since it would require flashing custom firmware.
Question
Do you see my attempts (1) or (2) being salvageable? I really like (1), but I have some major concerns wrt lifespan. Any different components / circuits that I should look into? Maybe a Zener Diode? Or is the MCU my best option?
Note: I'm new to electronics and circuit board design.