Dear all, I've a project with RTC, LCD and Servo.
I wanted to program to show date and time for 1 second. Then servo turn in counterclockwise direction for 2 seconds if time is between 07:00-19:00. Else it will turn clockwise direction for 2 seconds. While servo turns, LCD prints the direction of rotation(Servo turns clockwise or Servo turns counterclock). Here is the code below.
Note that I've powered Arduino and peripherals from external 5V. I'm using a high quality Samsung charger, measured output by scopemeter and supply voltage is clean. I've connected this supply voltage to Arduino from 5V and ground. At the same time I've connected supply to LCD, RTC and servo.
I've observed that servo is jittering in between cycles while it supposed to stop completely. This is happening in 50%-60% of the cycles.
What do you think might be the reason of this problem?
Please find the video in link below, if you turn up the volume, you can hear jittering sound.
Please check my code attached.
RTC_with_I2C_LCD_Controlling_Servo.ino (3.37 KB)