My initial idea was simple, simplistic and optimistic... I had to change everything and here is the result after I rewired the power supplies :
At first I wanted to power everything from a single 5V source : motor, relays, logic. I realised that they had very different requirements and I had to split the rails, starting from a single 12V input:
- The relays are powered from a DC/DC module
- The DC/DC also powers the motor through a crude current limiter (2 diodes, a resistor and a BD237 NPN transistor with gain around 100) to keep the peak under 400mA
- A separate 7805 provides some tens of mA to the logic
The whole circuit should be more stable and hence predictable... Right ?