Arduino-based mode switch

FILE0080.jpg?width=750First, I used combinations of switches to select the mode of my APM. But IMHO, there is hardly anything more counter-intuitive and if things hit the fan, you can be sure to switch to the wrong mode out of pure hectic.

Next, I replaced a pot of my transmitter with a 6-position switch and variable resistors. That is already better, but to get to one mode, you likely have to switch through other modes. Also, without any markings, again, not very intuitive and it's impossible to see at one glance which mode you are in.

Finally, I hacked together a small board with 6 pushbuttons, 6 LEDs and an Arduino Pro Mini. The Arduino creates an 8-channel PPM stream of which channel 1 contains the data for the mode. The whole thing connects to the trainer port of my 9x. Additionally, I steal 5V from the display output of my FrSky module but theoretically, the Arduino could also be powered by the 3S transmitter LiPo. The program is pretty easy. Check the buttons and set the respective PPM value. The LEDs are not set by the buttons but by the actual value of PPM1 - just to be safe, in case e.g. the Arduino resets or something.

Here's the schematic:

APM_mode_switch_schem.png?width=750I'll attach design files for the PCB and the source code in the comments then.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


  • If you set up your mixing screen like in the pictures it will work. (probably)  I should have posted those pictures here instead of in the messages part. The Arduino program sets the value of PPM-1 to a set number for each output. If it's working you can go to the CHANNELS MONITOR screen (three PAGE button pushes from the main screen) and you will be able to see the values change as you push different buttons. Unless you get into the code you will have to manually match the outputs to your lights and switches once you get it working.

  • I have the arduino wired up and it powers on and the blue led is flashing, so I'm assuming its running the sketch.  I'm not sure about the switch wiring as my arduino pinout doesnt corespond with Stefans.  Also, how do I go about assigning the six switches on The Taranis?

  • Ok, I found all of the points you are referring to, thanks a million for the great explanation.  I will let you know how it goes!

  • On your back board next to the right had ribbon connector is a pattern of six solder pads. In that six pad pattern the left pad is the signal and the lower right, or second from the right is a ground. Those are coming from your trainer port. On your front PCB there is a pattern of four holes in a white square printed box just right of the right plug. The hole with the square shaped solder pad is 3.26 v+ on mine. The test. Turn on the radio and put one probe on the ground point on the back PCB and touch the square framed hole on the front PCB. Hopefully you will see 3.26v. That should give you the three contacts you need to run the Arduino. You might be able to trace them to more convenient places to run the wires from. Be careful with the probes so you don't touch thinkgs you don't want to.

    Good luck

  • no joy, I dont see any lables

  • BALLS...they might be on the other side, I just didn't want to desolder the lcd tabs, ah well, I'll quite being lazy.

  • There aren't any labels around the ribbon cable sockets? Maybe on the back side? Looks like you are going to have to get out the multi meter and find the 3.26 volts (on mine)  and a ground. those are fairly easy to find. I'll trace my signal wire for more clues.

  • I assume you mean this guy.  I dont see any markings on any of the pinouts

  • 3702065479?profile=original

  • There should be a wire on the back cover PCB that is marked TR_PPM. That is the signal. There are also two wire positions marked Vcc and GND next to each other. That's where the 3.26 volts comes from.

This reply was deleted.