Project tutorial
Antenna Turret Toy with Computer Tracking

Antenna Turret Toy with Computer Tracking © GPL3+

Lacking a real antenna, I made this toy, to sit on my desk and point in the direction of the ISS or other satellites that I'm receiving.

  • 6 views
  • 0 comments
  • 0 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)
Hy gluegun
Hot glue gun (generic)

About this project

This antenna satellite tracking toy was inspired from a project I did last year.

Since I didn't have time to make a proper antenna and to install it on top of my house, I decided in the meantime, to make this toy, to sit on my desk and point in the direction of the ISS or other satellites that I'm receiving.

The project is very simple and consists only of an Arduino nano board and two servos. You can choose the smallest 180° servos you can get. I had two bigger ones in stock and I didn't want to buy others.

This is a toy and it is about fun, not about precision.

For the electric diagram I chose to use an external USB power supply to power the servos because the computer USB doesn't have enough current to do this. The diode separates the voltages from computer USB and external supply.

The code is simple. You receive the antenna direction on USB, you move the servos and you display the position. Initially I added an OLED display to show the position. Lately I decided not to use it, but the code is there.

The encoders only move 180° and in order to cover 360° horizontal, I had to make a trick, and in the second half of the circle the antenna turns on its back to continue tracking.

There are a lot of pan/tilt devices tutorials, but mine is different because it can be controlled by the computer. You can use Orbitron or other satellite tracking software compatible with EasyComm2 protocol. Most of them are free.

PST rotator can manually point to the antenna in the desired direction or also track satellites and control your radio.

You can use this project not only as a satellite dish, but for a laser turret, camera holder, rocket launcher and whatever you can think of.

Code

servos_easycom2_apr2021Arduino
AZ/EL Rotator toy controller for Arduino with servos
Uses EasyComm2 protocol for computer - Tracking Software
Two servomotors to move the antenna in Az (360 deg) and El (90 deg)
/*  AZ/EL Rotator toy controller for Arduino with servos
 *  ========================================================
 *  Uses EasyComm2 protocol for computer - Tracking Software
 *  servomotors to move the antenna in Az (360 deg) and El (90 deg)
 *  
 *  Viorel Racoviteannu
 *  https://www.youtube.com/channel/UCiRLZX0bV9rS04BGAyUf-fA
 *  https://racov.ro
 *  YO3RAK@gmail.com
 *  
 * I cannot take any responsibility for missuse of this code
 * or any kind of damage it may occur from using this code.
 * 
 */
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Fonts/FreeSans18pt7b.h>
#include <Fonts/FreeSans12pt7b.h>
Adafruit_SSD1306 display(4);

#include <Servo.h>
Servo AzServo;  // create servo object to control the azimuth servo
Servo ElServo;  // create servo object to control the elevation servo

  String Azimuth = "";
  String Elevation = "";
  String ComputerRead = "";
  String ComputerWrite = "";
  int ComAzim = 0;
  int ComElev = 0;

void setup()   {
  Serial.begin(9600);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x32)
  display.display();    
  display.setTextColor(WHITE);
  display.setFont(&FreeSans12pt7b);
  delay(2000);
  display.clearDisplay();                     // Clear the buffer
  
  display.setCursor(-3,24);
  display.println("EasyComm2");
  display.display();
  delay (1000);
  display.setFont(&FreeSans18pt7b);
  
  AzServo.attach(5);  // connect Az servo to pin 5
  ElServo.attach(6);  // connect Az servo to pin 6
  
  Serial.begin(9600);

   /********************** make a short movement *************************/
  ComAzim = 90;
  ComElev = 40;
  Rotate();                // center the servos
  delay(100);
  for (ComAzim = 70; ComAzim <= 110; ComAzim += 1) { // goes from 80 degrees to 100 degrees
    // in steps of 1 degree
    Rotate();              // tell servo to go to position
    delay(20);                     // waits 15ms for the servo to reach the position
  }
  for (ComElev = 20; ComElev <= 60; ComElev += 1) {
    Rotate();
    delay(20);
  }
  ComAzim = 90;
  ComElev = 40;
  Rotate();
  DisplayPosition();

}

void loop() {

  if (Serial.available()){
    SerComm();
    Rotate();
    DisplayPosition();  
    delay (250);
  }
  
}

void SerComm() {
  // initialize readings
  ComputerRead = "";
  Azimuth = "";
  Elevation = "";

  while(Serial.available()) {
    ComputerRead= Serial.readString();  // read the incoming data as string
//    Serial.println(ComputerRead);     // echo the reception for testing purposes
  }
  
// looking for command <AZxxx.x>
    for (int i = 0; i <= ComputerRead.length(); i++) {
     if ((ComputerRead.charAt(i) == 'A')&&(ComputerRead.charAt(i+1) == 'Z')){ // if read AZ
      for (int j = i+2; j <= ComputerRead.length(); j++) {
        if (isDigit(ComputerRead.charAt(j))) {                                // if the character is number
          Azimuth = Azimuth + ComputerRead.charAt(j);
        }
        else {break;}
      }
     }
    }
    
// looking for command <ELxxx.x>
    for (int i = 0; i <= (ComputerRead.length()-2); i++) {
      if ((ComputerRead.charAt(i) == 'E')&&(ComputerRead.charAt(i+1) == 'L')){ // if read EL
        if ((ComputerRead.charAt(i+2)) == '-') {
          ComElev = 0;                  // if elevation negative
          break;
        }
        for (int j = i+2; j <= ComputerRead.length(); j++) {
          if (isDigit(ComputerRead.charAt(j))) {                               // if the character is number
            Elevation = Elevation + ComputerRead.charAt(j);
          }
          else {break;}
        }
      }
    }
    
// if <AZxx> received
  if (Azimuth != ""){ComAzim = Azimuth.toInt(); }

// if <ELxx> received
  if (Elevation != ""){ComElev = Elevation.toInt();}

// looking for <AZ EL> interogation for antenna position
  for (int i = 0; i <= (ComputerRead.length()-4); i++) {
    if ((ComputerRead.charAt(i) == 'A')&&(ComputerRead.charAt(i+1) == 'Z')&&(ComputerRead.charAt(i+3) == 'E')&&(ComputerRead.charAt(i+4) == 'L')){
    // send back the antenna position <+xxx.x xx.x>
      ComputerWrite = "+"+String(ComAzim)+".0 "+String(ComElev)+".0";
      Serial.println(ComputerWrite);
    }
  }
}

void Rotate() {
  // rotate the servos to the coordinates received thru serial
  // because the servo rotates in the oposite direction, we have to reverse the movement
  if (ComElev >90){                // if received elevation more than 90 deg
    ComElev = 180-ComElev;         // keep it below 90
    ComAzim = (180+ComAzim)%360;   // and flip the antenna
  }
  if (ComAzim > 180) {              // if azim more than 180 deg
      AzServo.write(360-ComAzim);   // flip the antenna
      ElServo.write(180-ComElev);
    }
    else {
      AzServo.write(180-ComAzim);
      ElServo.write(ComElev);
    }
}

void DisplayPosition() {
  // display values
  display.clearDisplay();
  display.setCursor(0,28);
  display.print(ComAzim);
  display.print(" / ");
  display.print(ComElev);
  display.display();
}

Schematics

Electric Diagram
Servos and board connections
Drawing1 rqybmfdxc1

Comments

Similar projects you might like

Portal 2 Turret - Master Turret Control of Portal 2 Turrets

Project tutorial by Novachris

  • 3,605 views
  • 0 comments
  • 19 respects

Arduino Antenna Rotator compatible with tracking software

Project tutorial by viorelracoviteanu

  • 15,251 views
  • 32 comments
  • 32 respects

Talking Portal 2 Turret Gun

Project tutorial by Novachris

  • 6,332 views
  • 7 comments
  • 30 respects

Make Eating Robot With Arduino Nano | Gold Screw

Project tutorial by GoldScrew

  • 6,183 views
  • 12 comments
  • 19 respects

Nerf Scope Module | Arduino Project

Project tutorial by Michael Darby - 314Reactor

  • 4,763 views
  • 2 comments
  • 10 respects

Interactive Toddler Music Box Toy

Project tutorial by Christopher Monreal and Nick Udell

  • 2,821 views
  • 1 comment
  • 2 respects
Add projectSign up / Login