Controlling Speed Controllers With Arduino.




About: Hey YOU! Yeah, I'm talking to you who is reading this. Send me ideas for instructables, like things that you are wondering how to make or build, or really anything electronically related, and I'll get back t...

Hey guys, I'm back with another instructable. This is about RC speed controllers. What this will do is allow you to test out your speed controller in the Arduino world using Serial, then you write the values down and can use them for your projects. 

Submitted by Newton Labs for the Instructables Sponsorship Program

Step 1: Setup

All you need to do is hook up your speed controller to your Arduino, red(s)->+5 black/brown(s)->GND yellow/white(s)->10 and/or 9.

Step 2: Programming

// If you need any help feel free to PM me (simonfrfr) or email me
// at
String readString;
#include <Servo.h>
Servo myservo;  // create servo object to control a servo
Servo myservo2; // create second servo object
const int left = 10; // left motor's pin on arduino
const int right = 9; // right motor's pin on arduino
void setup() {
  Serial.println("servo-test-22-dual-input"); // so I can keep track of what is loaded

void loop() {
  while (Serial.available()) {
    char c =;  //gets one byte from serial buffer
    readString += c; //makes the string readString
    delay(2);  //slow looping to allow buffer to fill with next character

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured string
    if (readString == "l") // acfivates left servo only
      myservo.attach(left); // writing both to left motor
        if (readString == "r") // activates right servo only
      myservo.attach(right); // writing both to left motor
        if (readString == "b") // activates both motors
      myservo.attach(left); // writing to left motor
      myservo2.attach(right); // writing to right motor
    int n = readString.toInt();  //convert readString into a number

    // auto select appropriate value, copied from someone elses code.
    if(n >= 500)
      Serial.print("writing Microseconds: "); // serial display
      Serial.println(n); // number
      myservo.writeMicroseconds(n); // writes to ports
      Serial.print("writing Angle: "); // serial display
      Serial.println(n); // number
      myservo.write(n); // writes to ports

    readString=""; //empty for next input

Step 3: Enjoy!!!

Go to Serial monitor and input number values and you can try different frequencies for different RC speed controller rates. Enjoy! Feel free to ask any questions or comment on my coding.



    • Organization Contest

      Organization Contest
    • Paper Contest

      Paper Contest
    • Build a Tool Contest

      Build a Tool Contest

    2 Discussions


    5 years ago

    Nice tutorial, however when I try to use it on the same board, the board acts that it has lost radio signal and activates the failsafe, how did you get past this?

    1 reply

    Reply 5 years ago on Introduction

    Oh, the switches on the controller need to be flipped in the right order. (just try different switch combinations)