Search This Blog

Monday, March 16, 2020

STM8 Timer - servo controlled water valve

The motor in the submersible pump I was using has started to rusting after a year and a few months. The rust stops the motor from spinning until I hit it with a high enough voltage which eventually exceeded the power supply I was using.
Pump motor is rusting
I ordered a couple of replacement pumps, but they are probably stopped somewhere between China and the post office due to the virus.  I have decided to go for a different approach.

I  made a servo controlled valve to control the water flow from a siphon.  This simplifies the overall design by removing the pump at the source and reduced the wring needed.
Top view of assembly
I used a Tower S9 micro servo mounted in a cut out dental floss case with a couple of M2 screws.  I used a cheap metal air valve, but it seems to work okay so far for water.  It is held down with 3 L shaped bracket with a couple of screws. The brackets are made out of the left over bits from the case. The servo arm is coupled to the handle with a 'g' shaped metal strip from a transformer.  The valve side is loose enough to allowed it to move to accommodate for minor misalignment.

Side view of the assembly
Two large holes are drill on the side of the case for connecting the tubing.

Timer Aux power supply 
There are a few modifications needed on my timer project for driving the servo.

  • R2 is replaced by 2.7K while R7 is replaced by 8.2K.  This sets the output to 5V
  • D3 is removed. The 5V output on J4B is now always on.
  • J6 is installed.  The /EN signal is used for driving the servo
/EN (PD3) is used as PWM for driving the servo
The 5V, GND, PWM signal are routed to a 3-pin connector for the servo.

I used TIM2 for generating a 50Hz PWM signal for controlling the servo.  TIM2 is disabled after 1 second when the servo is in the "Off" position.  This powers down the servo and prevents the annoying rattling in some cheap servos.