can i code a arduino to a servo to turn from 0 to 180 for 10 seconds

hey im new to this and need some help. im working on a rc boat project and im trying to figure out if i can have it move to the right for 10 seconds and pause for 10 seconds and then back to the left for 10 seconds. i know i can get the arduino to turn the servo but dont know if it can do the time and run the motor on a time as well. any help is much appreciated.

No problem. Any Arduino can do that. Get a driver for the servo unless it has logical control signals, and proper power supplies.

thank you. so i already have the motor, arduino, and servo. do i just need to order a driver and its possible?

can i just wire it like this and also wire in the motor as well?

What you describe certainly sounds possible but we're a bit short of detail to be able to offer much help.

What servo? Most servos do not need drivers.

What motor? Brushed or brushless? Does it need to be run in reverse or forward only? Most motors do need drivers of some sort.

When you say "move to the right for 10 seconds" do you mean move rapidly to the right and then stay for 10 seconds or perhaps move slowly to the right taking 10 seconds to get there? They're very different.

If the boat is RC (remote controlled) what is the servo moving that needs to be automatic rather than controlled? I.e. what is this project?

Steve

hey thank you for the response. i have a big pond and i have two pet ducks. i dont need it remote controlled just a on/off switch to get the sequence going. i want to be able to take the boat and tie a string to it with a float full of food in it for them to follow and eat. so I want to turn it on in the middle of the lake and so the rudder on the boat would turn to the right for 10 seconds and turning the motor on so it pulls it to the right for 10 seconds then the motor turns off for 10 seconds then the rudder goes to the left and the motor turns on for 10 seconds then cuts off and stops for 10 seconds then goes back to the right essentially pulling it in a figure 8 and not going fast when the motor is on and it only needs to go forward. i bought these servos Amazon.com: 4Pcs SG90 9g Micro Servos for RC Robot Helicopter Airplane Controls Car Boat: Toys & Games
this is the motor DC3V-6V 5V 280RPM Slow Speed Reduction Micro Full Metal N20 Gear Motor Car Robot | eBay
and this Amazon.com: REXQualis Board Base on Arduino UNO R3 ATmega328P ATMEGA16U2 with USB Cable Compatible with Arduino IDE Projects: Computers & Accessories

Please post links to motors, servos etc.

i thought i did in my last post. are those links not working. thanks, griffin

would there be anyway for me to wire a servo and a motor to do those actions on a timed basis into one arduino

What you ask sounds completely possible using one Arduino. The only question is if the boat is in the middle of a lake what exactly are you intending to use to turn it on and off? Some sort of radio control presumably?

You will need a MOSFET circuit to drive the motor. You can't switch it directly from an Arduino pin.

You will also need some power, presumably a battery. Have you decided on that? How long does this duck feeding system have to run for?

Timing is really not a problem, there are many different ways of doing it. Have you tried anything yet, like connecting a servo and getting it to move?

Steve

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.