Monday 4 April 2016

Radio Control

Not added to blog for a while, been out of action, my Jack had crusciate ligament surgery, he wasn't allowed to jump at all, so kiddie gate on bedroom door, bed out, mattress on floor, we all lived like like in bedroom together for a year!!!!!!!!!!!

Now I'm back to playing.

ESP8266, got a few different modules, had 4 off ESP8266-03, and it's smallest with a decent amount of GPIOs, so that's the one I started with.
Fitted it to a 0.1" jig, plugged into breadboard, plugged in a USB to 3v3 TTL module, added a few resistors and LEDs.
Setup Arduino, got it programming with examples, modified examples.
Added a 3v3 regulator and a couple of capacitors.

Created a 3v3 regulator / interface board:

Software is a mixture of various examples.
Turn it on and it becomes a Wifi access point. Connect to it with a WiFi device (I use my Samsung mini 4 phone). Open a browser (I use Chrome), navigate to 192.168.0.1, it shows a radio transmitter:
Multi-touch, finger touching right side acts as the right joystick of a standard radio control transmitter, finger touching left side acts as left joystick.
Positions of fingers are passed back to module and it uses those values to drive up to 4 servos.

It's all fully working, it works with standard Futuba (large) servos, it works with small 9g servos, it works with an 10A ESC that I connected up.

The web page is based upon:
This includes an html page and a javascript page.
I created an MSVS 2015 project to compress these so they can be stored as static text in the main Arduino program.
The Arduino program uses ESP8266WiFi, WiFiClient, ESP8266WebServer, Servo and EEPROM libs. The program itself is stiched together from various examples.
Basically: It scans all current Access Points, chooses an unused channel. Loads SSID and Password from EEPROM, uses these to create an Access Point, it then sets up a web server.
Web server serves up main web page and javascript (as explained), it also allows 192.168.0.1\config page that allows Title, SSID and password to be changed and saved to EEPROM.
(Title is "Trix" in this instance, shown on joysticks main page).

I have a couple of ideas ready to use this module, then I can test it in anger (so to speak).

Costs: About £5 for all the components shown.