I want to control a servo motor to open a door in the morning and close it in the evening.
I got it to work by simple getting the time with an DCF77 module and connecting the servo motor to 5V, GND and an Arduino PWM pin. This is shown in the attached circuit diagram with the hardware switch in position 2. So far so good.
Because the servo motor tends to buzz while it is not moving I want to disconnect it from 5V when it is not used.
Therefore I added the hardware switch that is shown in the circuit diagram. Putting the switch to Position 1 interposes a relay between the 5V pin and the servo motor. The relay is switched by a digital Arduino pin by means of a transistor.
In my opinion this should work, too.
But I experience a very unstable behaviour of the board that is not quite predictable.
Somtimes the relay toggles again and again after turning on the Arduino and serial communication with the board is no longer possible.
Does anyone have an idea what I am doing wrong here.
I appreciate any help or comments.
Arduino_Sketch_150.tif (80.7 KB)