How Build an Automatic 180 degree Repeating Disc Rotator?

I'm new to PLD. For a simple, cheap home DIY project, I want to build a motor/switch/controller to flip a small 10" disk 180 degrees and then repeat every 1 hour.

My notion is a small hobby motor that slowly rotates the disk and hits a mechanical switch to stop the rotation and then a timer that restarts the motor to flip the disk 180 degrees 1 hour later. A schematic is attached.

Would you have any tips on how to get started? Is the Arduino software easy to program in with Windows since I dont know how to do any software programming?
Thanks for any tips

Arduino is programmed in C/C++, and if you are unfamiliar with the language, expect a long learning curve before becoming proficient. The Arduino IDE has a number of example programs, and countless tutorials are posted on line.

However, reading a switch, timing intervals and activating an appropriate motor driver are not complicated tasks. With internet search efforts plus trial and error, you might be able to piece something together within a couple of days.

Using a servo rather than a motor would make this project much simpler to implement

1 Like

There are many sensing technologies out there.  Are you locked in to a mechanical switch?  In fact, with a stepper no switch would be needed, just count steps taken.

  1. Install Arduino IDE

    https://support.arduino.cc/hc/en-us/articles/360019833020-Download-and-install-Arduino-IDE

  2. Make a list of devices to be used:
    a. wood
    b. wires
    c. power supply (DC, not AC)
    d. switch (SPSTNO)
    e. DC motor
    f. RTC (real time clock) module
    g. Arduino

  3. Learn to read a pushbutton (switch)

    https://docs.arduino.cc/built-in-examples/digital/Button

  4. Learn to control event timing

    https://docs.arduino.cc/built-in-examples/digital/BlinkWithoutDelay

  5. Learn to control a DC motor

    https://docs.arduino.cc/tutorials/motor-shield-rev3/msr3-controlling-dc-motor

  6. Learn to control a RTC (and LCD)

    Arduino Real Time Clock (RTC) Tutorial using DS1307

(7. servo - https://docs.arduino.cc/learn/electronics/servo-motors )

Thanks. if programming tutorils are easy enough to follow that takes some of the intimidation away.

I think I see. A servo that moves 180 degrees and powerful enough to rotate the disk and just invert the polarty to change direction?

In general, yes, but you don't reverse the polarity, rather you command the servo to move to a particular angle

Any cheap sensor would be fine. It's just a mechanical switch came immediately to my mind. I'm afraid that over time, counting steps would eventually cause the disk to move away from 180 degrees.

perfect starting guide! Thanks so much!

If you use an absolute encoder you won't have that risk. Only a very small risk counting steps otherwise.

Take the Servo Sweep example in the IDE and you have almost exactly what you describe

There's a library example that does the slow motion servo motion that would take a delay(3600000)to handle the hour delay

Why introduce another library when the built in Servo library will do exactly what has been described ?

/* Sweep
 by BARRAGAN <http://barraganstudio.com>
 This example code is in the public domain.

 modified 8 Nov 2013
 by Scott Fitzgerald
 https://www.arduino.cc/en/Tutorial/LibraryExamples/Sweep
*/

#include <Servo.h>

Servo myservo;  // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos = 0;  // variable to store the servo position

void setup()
{
    myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}

void loop()
{
    for (pos = 0; pos <= 180; pos += 1)
    {  // goes from 0 degrees to 180 degrees
        // in steps of 1 degree
        myservo.write(pos);  // tell servo to go to position in variable 'pos'
        delay(15);           // waits 15 ms for the servo to reach the position
    }
    delay(3600000) for (pos = 180; pos >= 0; pos -= 1)
    {                        // goes from 180 degrees to 0 degrees
        myservo.write(pos);  // tell servo to go to position in variable 'pos'
        delay(15);           // waits 15 ms for the servo to reach the position
    }
    delay(3600000)
}

There is no good reason, that’s a great solution.

Good stuff. Thank you. Ill keep a library of the is together while I gather some hardware.
The 180-degree position slip needs to be consistent over a long time as in a year. Is servo still a good option vs a sensor/switch solution? Would you have any suggestions for a cheap servo with some power to flip the disc? Thanks again!

A servo should be reliable over a long period, particularly if you use a standard size servo rather that a cheap "9 gram" servo.

The main problem will be in ensuring that the servo can actually move through 180 degrees because not all of them can

A post was split to a new topic: Problem with long delay

OK. I like the idea of a step motor now. Which of the Arduino boards (there are so many and this is new to me) can you suggest for single step motor control? I'm assuming there is a board that has built-in all the capability to do that control? Thank you!

When you say the disk flips, do you mean it turns 180° in one direction, then reverses 180° next time, or does it always turn the same direction? Or does it matter?