Remote control with gamepad or joystick

Overview

In the previous article we already presented the possibility to control up to eight servos via a USB interface using a joystick or gamepad, a PC and a PiKoder/SSC. Here is now described how a wireless model remote control can be realized with a PiKoder – receiver, the PiKoder/SSC RX. Bluetooth for command transmission.

Setup

First, the PiKoder/SSC RX must be connected to the PC at the operating system level. For this purpose, you first search for new Bluetooth devices in the device control.

After a short time, the Bluetooth module of the receiver should be offered. The PIN is “1234”.

With the selection “Connect” the coupling (pairing) takes place on system level.

As the following view from the device manager shows, the coupling of the system also establishes two virtual serial interfaces, which we access later in the program for establishing a connection.

This completes the setup and the JoystickRC program can now be started as described in the previous post.

Open Source Android App for Bluetooth R/C

Overview

The “picCAR” App turns an Android-Tablet or Smartphone with Bluetooth into an R/C transmitter.

The app is based on the Cxem Car 1 Open Source Projekt. The app has been extended and revised to interface with a PiKoder/SSC RX receiver.

The picCar app is open source and released under a GNU General Public License Version 3. The app can be installed via the Play Store. The source code is provided through github.

User interface

picCar Main activity

The user interface of the picCAR app is pretty intuitive and straight forward. You can select one of four control modes by touching the respective screen button: button control, a virtual joystick, accelerometer (control by moving the device) and a combination between accelerometer and a slider. The Bluetooth connection would be established once the mode has been selected.

For building your receiver please refer to the PiKoder/SSC Bluetooth receiver page. The App is supported by all PiKoder/SSC firmware versions. It is recommended though that you use a PiKoder/SSC firmware 1.03 or above in order to deploy the TimeOut-Funktion of the Android app.

picCAR User’s Guide (.pdf File, EN)

The picCAR User’s Guide describes the picCAR app in detail.

Open Source Arduino Digital RC Transmitter

The sketch ArduinoDTX implements a feature rich RC addressing all needs of a state-of-the-art transmitter on an Arduino. It is based on fully digital encoding of all control information in the miniSSC – protocol rather than using a PPM frame. This fully digital encoding enables transmitting over a transparent serial channel such as Bluetooth, Wifi, and XBee. As a receiver for e.g. Bluetooth a PiKoder/SSC RX would be deployed.

This digital RC transmitter is based on the Open Source project arduinorc by Richard Goutorbe and thus inheriting the respective full feature set such as:

  • up to 9 proportional channels (Nano), 6 channels by default (Uno)
  • up to 6 additional digital channels (switches)
  • 9 model memories
  • Dual rate/Exponential switch
  • Throttle cut switch
  • 2 programmable mixers
  • End point adjustment, Potentiometer and Servo calibration
  • Throttle security check at startup
  • Optional Transmitter battery low voltage alarm
  • Programmable with Linux or Windows via USB (terminal application)

The original arduinorc-sketch has been modified and became the ArduinoDTx sketch, which outputs all channel information in the miniSSC-format rather than a PPM-pulse frame on Arduino pin D6. Every time a stick position would change a miniSSC message is generated. The PPM output has been removed completely.

The ArduinoDTx sketch is open source and provided through a respective github repository under the terms of the GNU General Public License Version 3.

Prototype setup: Digital four channel RC

Schematic setup of the Arduino Digtial RC transmitter

An RC transmitter with four channels will serve as a prototype project. As shown in the image two Thumb-Joysticks are evaluated by the Arduino (Pot 1/2 and Pot 3/4 in the above schematic). The connection to the Arduino’s analog pins is through a proto-shield. This shield does also accomodate the mode switch and the LED with the respective 270R resistor.

The RC is designed for battery operation. To guarantee the required minimum voltage of 6 V for the Arduino – even when using rechargeable batteries with a nominal voltage of 1,2 V – a battery holder for five AA elements has been selected. The two side panels support your palm operating the remote control and would enhance the user comfort significantly.

Please note that the USB port of the Arduino is easily accessible. This allows you to download software upgrades but also to customize the RC to your application.

Commissioning and testing

Test setup Arduino Digtial RC transmitter

For commissioning the RC you would download the arduinodtx sketch (.ino-file) which is provided through an respective github repository. Please note that building the sketch requires the Arduino “TimerOne”-library.

After you have uploaded the sketch to your Arduino the easiest way to test the RC would be to build the “wired remote control” shown to the right using a PiKoder/SSC evalutation board. In the standard configuration the pots 1-4 would control the respective servo channels 1-4 of the PiKoder/SSC.

If you wanted to customize your RC transmitter then you would hve to follow the steps described on the arduinorc-page. All commandos for programming the arduinorc are still available to you – for more information please refer to the (arduinorc command documentation).

Using Bluetooth communication

Bluetooth shield configuration for Arduino Digtial RC transmitter

You can easily customize the digital remote control to a Bluetooth RC with an ITEAD-Bluetooth Shield and then use the PiKoder/SSC RX as a readily available and fully compatible 8 channel receiver. Since the transmission is based on a tranparent serial protocol there are no changes needed in the sketch and the complete feature set is also available for the Bluetooth RC.

The transmitter setup is shown in the image. Prior to operating the RC the connection between the wifi modules has to be configured. Please refer to the PiKoder/SSC RX User Manual for a detailed description.

Using WLAN communication

You can also easily customize the digital remote control to a Wifi RC by adding a logic level converter, a dc-dc converter, two jumpers as UART multiplexers (to allow for programming the wifi radio) and an ESP8266-01 Wifi module and then use the PiKoder/SSC wRX as a readily available and fully compatible 8 channel receiver. The hardware setup and the programming of the wifi radios is described in great detail in the blog Arduino WLAN RC Transmitter.

Additional Application Examples

In order to increase the range of your radio control you can upgrade from Bluetooth to XBee. The setup is described in the blog Arduino based XBee radio control and in the PiKoder/SSC Application Note #3: XBee Communication.

Arduino WLAN RC Transmitter

Der Open Source Arduino Sketch arduinodtx implementiert die Bedieneroberfläche und die Bedienelemente für einen leistungsfähigen Modellfernsteuerungssender mit einem seriellen Kommandoausgang (PiKoder/SSC kompatibel). Für die Kommandoübertragung zum PiKoder wird ein transparenter serieller Kommunikationskanal benötigt.

Soll WLAN als Übertragungsweg genutzt werden, dann kann ein solcher Kanal senderseitig mit einem ESP8266-01 Modul realisiert werden; als Empfänger kommt ein PiKoder/SSC wRX zum Einsatz.

In diesem Fall werden neben den Basiskomponenten wie Steuerknüppeln, Schalter, etc., die zum Aufbau des arduinodtx-basierten Fernsteuersenders erforderlich sind, ein Logic Level Umsetzer von 5 auf 3,3 Volt, zwei Jumper zur Umschaltung der seriellen Kommunikationsschnittstelle (UART-Multiplexer) und ein ESP8266-01 Modul benötigt wie im Beitragsbild dargestellt. Die Verdrahtung entnehmen Sie dem folgenden Schaltbild (die Signale mit gleicher Bezeichnung müssen verbunden werden, Signale in blauer Schrift sind mit den entsprechenden Arduino-Signalen zu verbinden):

Der Aufbau ist relativ einfach und sollte problemlos auf einem Prototyp-Board erfolgen können.  

Im nächsten Schritt ist der ESP8266-01 als Access Point mit seriellem Ausgang zu programmieren – die Beschreibung hierzu finden Sie im Blog ESP8266-01 Sketch für den PiKoder/SSC wRX. Wollen Sie den ESP8266-01 im “eingesetzten Zustand” programmieren, dann müssen Sie die dargestellte Schaltung um einen Programmierteil erweitern:

Bitte beachten Sie auch die Jumperstellung für D0/D1. Zusätzlich sollte bei jeder direkten Kommunikation mit dem ESP8266-01 der Arduino “stillgelegt” werden (RESET Leitung auf GND legen), so dass die Datenübertragung nicht gestört wird.

Mit dem erfolgreichen Abschluss der Programmierung des ESP8266-01, dem Umstecken der Jumper, Aufwecken des Arduino und einem Reboot ist die Modellfernsteuerung betriebsbereit.