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

Comments

  • Yes, mine is new.  I ordered it a couple of months ago, it's the plus version, rev 0.3

  • I say Hmm.... I'll take my radio apart later tonight and see if we can find some common markings. Is your radio the new one? The plus or something like that? Mine is an "old" one but the PCB is probably printed with common markings. 

  • 3702065113?profile=original

  • Mine has ribbon cables

  • I am just getting around to wire this up.  But my board does not look like yours

  • Again, thank you so much, I appreciate your time helping me with this.  I am new to Arduino myself, but I have loaded Stefan's code on the mini and seems to works very well.  If I can ever return a favor, just let me know. I have a laser engraver/cutter:)

  • First off a disclaimer. I have not had to play with the Arduino coding. I've looked at it and modified it but have not written a program from scratch. I've put Stefan's code in several radios and haven't had to modify it. That's a great little piece of code. Thank you again Stefan.

    The momentary toggle switches will work just fine as long as you have a LED to tell which one is active and I see you do.

    You don't need a regulator because the radio voltage at those points is 3.26v, perfect for the Vcc input (I think, double check your Mini input). I think the Vcc on any Mini will take 3.5v directly but any higher and you have to use the RAW hole. The RAW hole goes through an on-board regulator on some Mini's. I blew the regulator off the board I'm using (with high voltage) but it still works on Vcc.

    The signal goes into the #10 hole at the bottom right of the picture.

    And I don't know if the Trainer port still works. I think the TR1 Source is the Trainer port but I also seem to remember that there are two Trainer Sources.

  • Seems there are a few different versions of the pro mini.  I just want to make sure I do this correctly.  Can you show me via this picture where I connect the signal pin, thanks!  This is the one I have,3702052920?profile=original

  • Ps, can you give me a link where you got your step down voltage regulator, thanks.

  • Thank you so much for that pic, now I can see whats going on!  And thanks for the other info on how to set it up, I appreciate that.  Ill keep u posted on how it turns out.  I thought about using push buttons, but decided on using frsky momentary toggles.  Thanks again not2fast!

This reply was deleted.