Thread Tools
May 04, 2015, 01:51 AM
Registered User
elewon's Avatar
Thread OP

DIY Radio with Mega2560 and OpenTx

So, I recently upgraded my 9XR to OpenTx. Actually, I was quite happy with the stock 9XR except I was running out of 16 model slots. So, I switched to OpenTx just to get 30 models and I'm amazed by the capabilities of the firmware and the companion SW. Haven't even looked at LUA yet!

Since it was first time ever I was trying to upgrade to OpenTx, I had to walk through a whole bunch of information and in that process I came across the DIY radio version of OpenTx with Arduino MEGA2560 board and that's the project I'm working on these days. DIY radio involves fitting the gimbals, switches, pots etc in a home made box. Arduino MEGA2560 board is then flashed with OpenTx and hooked up to the controls to complete the radio. The radio supports PPM/DSM protocols and appropriate add-on RF module can be used for RF link.

However, this is too much work for me. So my idea is to sacrifice the FS T6 radio I have lying around. The T6 is useless for me because I blew up the main board in the process of trying to use a 3S LiPo. I could not find a replacement main board either and had to buy a 9XR. So I already have the Tx box with most of the controls required for radio already in place. I just need a LCD display and additional switches/Pot. Then the plan is to try and fit the Arduino, LCD, and rest of the electronics in the T6 box.

When I started out, I was surprised by lack of building information online. So I thought of starting this thread to record my experience, in case someone else wants to do this too. I will post the pics and other information as I make progress and once I have the radio working, I intend to post a "build guide" to help ease the build for others.

Meanwhile, it'd be interesting to see if anyone has done work in this area. Ideas/suggestions/questions are welcome too!

BTW just in case, here are some of the features of MEGA2560 DIY Radio:
* Open TX Firmware
* Up to 16 Chs
* 4 gimbals
* 3 Pots (All three can be converted to 3 position switches)
* DR switches for THR/RUD/ELE/AIL channels
* Thr cut and Trainer switch
* A 3 Position switch
* Upto 2 Rotary encoders (1 can be used for menu navigation)
* 6 Menu navigation keys - Menu/Exit/Left/Righ/Up/Down
* Audio
* SD Card
* Telemetry
* Support for PPM/DSM/DMS2 (I think)

Update: May 19, 2015: Added a mini build guide to post #12 along with pre-compiled .hex for MEGA2560
Last edited by elewon; May 19, 2015 at 11:43 PM. Reason: More background info
Sign up now
to remove ads between posts
May 04, 2015, 05:15 AM
Registered User
Better get a STM32F205 $24 board and build yourself a Taranis like radio, no idea why people still hang on the '80s technology that is Atmel 8bit 16Mhz...
May 04, 2015, 03:34 PM
Registered User
elewon's Avatar
Thread OP
Thanks! It's amazing that 80's tech is still so relevant, isn't it?
I think main strength of Taranis isn't electronics but the case design and the HW around sticks and controls. As you said electronics is commodity, firmware is almost free.
I'd much rather buy a Taranis than replicating the electronics with the cheap FS T6 case I have.
Also, I already ordered the MEGA 2560 Arduino and LCD. So I'll have to stick with the plan.
Last edited by elewon; May 14, 2015 at 02:57 PM.
May 08, 2015, 03:57 PM
Registered User
elewon's Avatar
Thread OP
I've been busy but finally things are starting to move.
So, here is my FS T6 with fried main board that's just lying around. I plan to modify it to take the 2560 and the LCD, so I won't have to build a case, hopefully. We'll see how it goes.
The T6 will also be getting more switches and a Pot to match 9XR. Not sure about rotary encoders yet.
Also received my 2560 board and the LCD from amazon. BTW, they took forever to ship it but finally it's here.
Getting exciting
Last edited by elewon; May 11, 2015 at 12:24 PM.
May 09, 2015, 10:09 PM
Registered User
elewon's Avatar
Thread OP
So just wanted to boot open Tx without any controls hooked up. This itself looks like is a big step! I had to download and compile the source code and then I found that the LCD has 0ohm path between VDD/VSS! Lots of debug/soldering/desoldering. Didn't expect it to be so difficult
May 11, 2015, 12:41 PM
Registered User
elewon's Avatar
Thread OP
So the LCD has a 0ohm pull down placed to configure the card for SPI interface and if you flip the switch to make it parallel interface, the 0ohm will short out VDD to VSS!!
Decided to get rid of the little piggyback card that holds the headers/switches and directly solder wires to the LCD board itself. Also removed the 0 ohm and hooked up the LCD to the Arduino.
With that was able to power the board, however LCD was still blank like before . More search online revealed that the LCD I'm using is not supported in OpenTx! However, I was able to find the right driver for my LCD online and compile OpenTx. With that I finally have the LCD working and OpenTx booting on my MEGA2560!!
May 12, 2015, 01:27 AM
Registered User
elewon's Avatar
Thread OP
Alright, more progress on getting the Tx case ready to house the electronics.
Bad news is although the LCD itself is same size as T6, the PCB holding the LCD is way to big to fit in the case. When I ordered the LCD, I had ensured the dimensions match with T6 but didn't think about the PCB dimensions. So I'll have to mount the LCD outside the case rather than inside. Will look bit ugly but no other option for now.
Drilled bunch of holes to fit additional switches and the 3rd pot. Looks like it is taking shape and except for the LCD it should look like a nice Tx.
May 13, 2015, 01:39 PM
Registered User
elewon's Avatar
Thread OP
More progress. Got the LCD mounted on the front panel. Also mounted all the push button switches on the front and back. Since there is no place for the up/down/left/right menu navigation buttons on the front, I decided to mount them on the back so that they are easily accessibly while holding the Tx. Will have to see how it works out however at least for now it feels more natural.
May 14, 2015, 04:39 AM
Slow builder
_AL_'s Avatar
Watching with interest...

May 14, 2015, 12:05 PM
Registered User
elewon's Avatar
Thread OP
Thanks! It helps to know someone's interested
May 14, 2015, 01:16 PM
Registered User
elewon's Avatar
Thread OP
BTW, here is a better picture of the menu navigation keys on the back panel.
Also, notice the cell count! I'm concerned about current draw and don't want the little SMT 7805 regulator to get too hot in the closed space. So going to go with 6 NiMH. Pretty sure even high drop out 7805 will work down to Vin=7V. 6 cell NiMH is roughly 3V less than 8 cells so that's at least 300mW less power to waste and hopefully the regulator will be cooler as well.
2S LiPo was another option too but the battery compartment is designed for AA and I have no LiPo that will fit. Also, for the Tx I prefer NiMH over Lixx and eneloops are good with retaining charge as well.
Last edited by elewon; May 14, 2015 at 01:24 PM.
May 15, 2015, 02:09 PM
Registered User
elewon's Avatar
Thread OP

Build Guide

Alright, since I already have relevant information in this post, I'm going to use it as the build guide.

First of all I'm just borrowing information from others, especially the OpenTx guys. Here are a few links, more links on OpenTx homepage:
- Open Tx download page:

- OpenTx 2560 download page:

Now, there are three aspects of this project - hardware, firmware, and software and here the details for each.

Most important piece of hardware is the computer that will be hooked up to all the controls on the Tx box - the switches, gimbals, and pots. The computer does all the work like generating PPM pulses, menu, reacting to switches and keys etc. The computer is also connected to the LCD screen to display appropriate information. The computer is the MEGA2560 Arduino board. Second piece of HW is the Tx box itself and all the controls you want to have on the box. I have listed various controls supported in post #1 but it's OK to not have some of those controls if you like. For example, you could have just 1 gimbal or no DR switches or no rotary encoders and so on. Just leave those pins on MEGA open or "no connect". Attached is the schematic OpenTx guys have on the 2560 download page and for my purpose I simplified it by not implementing following:
1. trainer port/simulator support
2. SD card
3. Telemetry
4. Audio

This gives me a Tx that's roughly same capabilities as 9XR (minus trainer port). So once you know what features your Tx will have, you just start hooking things up based on the schematic. BTW, you don't need resistor/capacitor (RC) filter on all switches. You also don't need the amplifier shown for various pots. Also, none of the pull ups are required as I'm pretty sure all the inputs pins have pull ups built in. Finally, if you use 5V tolerant LCD none of the voltage dividers on LCD pins are needed. The back light is a simple LED mostly which can be directly driven by the MEGA through a series resistor. Just for reference, attached is the table that shows my implementation details. Finally, Arduino board can be directly connected to 7-12V supply. On board 5V regulator will ensure smooth operation even though the supply voltage changes. A word of caution: on board regulator is quite small so I'd limit the power dissipation to ~500mW. I use 6 NiMH so max voltage is 8.4V (delta of ~3.5V max) and RF module is directly connected to battery rather than using +5V from Arduino board.

So, here are the hardware components you'll need:
- Arduino MEGA2560 board
- 128x64 LCD
- A homemade/old Tx box that will fit Arduino, LCD, and controls
- Toggle switches, push button keys, Pots
- Hook up wire
- Single Row Straight Pin Headers
- Some resistors etc

Firmware is the software that gets flashed in the MEGA2560. It's kind of the program that runs on MEGA2560 computer, so that the Tx box collectively works as a system. For the purpose of this discussion, the firmware is OpenTx. However, theoretically it is possible to flash any appropriate firmware or develop own custom firmware but we'll not go in that discussion.

Once the hardware is all hooked up and ready to be powered on, you'll need to first flash OpenTx before the hardware will start working as Tx. There are two ways to flash the firmware - USB and ICSP. USB method works using just the regular USB port available on MEGA2560 board while ICSP requires an in-circuit programmer like USBASP. I prefer ICSP method because I already have USBASP and I can just use a simple command line to flash the MEGA.

USBASP programmer requires a utility called AVRDUDE that runs on your PC. Here is how you install AVRDUDE:

The next thing is OpenTx binary. This is the file that gets flashed in the MEGA. Currently, the best way to get the binary is to compile it on your PC. Here is the page that describes compilation process for OpenTx for Windows.

Here are the instructions for Linux:

There are a number of options that can be passed on to make. Here are the options I use:

Just in case, I have also attached the binary that I flashed on my system. To summarize, here are the things needed for firmware:
- USBASP programmer
- OpenTx source code
- Setup to compile OpenTx

Finally, the software part. Software is the one that runs on your PC. Although, software is not required for the Tx box to work, it's a nice way to be able to change parameters on your Tx box like models, radio settings etc using your PC. This is done using the Companion9x software. Currently, companion does not support MEGA2560 although version 2.1 onwards we should have the support. So not much write here but will update this post once I have more information.

** Note 04/17/2016: The pin connections table attached below worked for me and is just for an example of how one can simplify the Tx by giving up functionality. Exact same connections, (especially for LCD) may not work for you. Please consult latest schematic for correct connections.
Last edited by elewon; Apr 17, 2016 at 01:17 PM.
May 16, 2015, 05:27 PM
Registered User
elewon's Avatar
Thread OP

All Done!

Great news folks! All done with the wiring! It was more work than I expected but didn't take much longer once I figured out the problem I was facing.
The problems was the male pins on cable I bought were too tall for the front and back cover to fit together. So had to come up with ways to shorten them. Finally, I ended up not using the cable at all and had to use the stranded hook up wire. But the good news is all the electronics fits in the case, although bit messy. However, everything is soldered and insulated with heat shrink so hopefully it will last a long time. Attached is a picture of the internal wiring.
I also made a cable to bring the ICSP header out so it could be housed in the battery compartment. That way I don't have to take the case apart every time I want to update the FW or EEPROM. So going with 6AAs helps here too
Attached are couple (more like 5!) screen shots I took. Need to spend more time with the Tx and I'll upload more pictures and my experience with it. So far very happy with the way it's turned out. Love the inverted color scheme on LCD!
May 17, 2015, 06:22 AM
Slow builder
_AL_'s Avatar
Looking good.

May 17, 2015, 05:53 PM
Registered User
Originally Posted by elewon
Thanks! It helps to know someone's interested
I just came across this post - very interesting as I'm converting my Futaba FX-18 right now


Quick Reply

Thread Tools