Arduino ppm signal reader and generator - RC Groups
Thread Tools
Jan 13, 2013, 02:42 PM
Registered User
Hasi's Avatar
Discussion

Arduino ppm signal reader and generator


Hy, I just wanted to share my latest project with you. I wrote two codes in arduino:

The first one generates a fully customizable ppm signal. You can change the number of channels, the polarity, the ppm frame length and the pulse length.
Download: http://code.google.com/p/generate-ppm-signal

The second one reads any kind of ppm signal. It doesn't matter which polarity, which frame length, which pulse length it has. It will still read the signal and put the servo values in an array called ppm.
Download: http://code.google.com/p/read-any-ppm

Please only use this code if you know what you are doing. Donations are kindly accepted (look for the link on google code).
Last edited by Hasi; Oct 25, 2014 at 02:37 PM.
Sign up now
to remove ads between posts
Jan 17, 2013, 02:59 AM
Registered User
So the first one reads for example all the channels from the receiver and then generates a ppm stream?
Jan 17, 2013, 03:05 AM
Registered User
Hasi's Avatar
Quote:
Originally Posted by msev
So the first one reads for example all the channels from the receiver and then generates a ppm stream?
You have to write the part, where it reads the channels, but yes.
Jan 17, 2013, 03:22 AM
Registered User
So you have to know how the signal stream that comes from the rx to the arduino looks like?
Jan 17, 2013, 03:29 AM
Registered User
Hasi's Avatar
Quote:
Originally Posted by msev
So you have to know how the signal stream that comes from the rx to the arduino looks like?
Thatīs just a simple pwm signal. It will be high for about 1000-2000us. 1500us is the middle position and so on...
Jan 17, 2013, 03:33 AM
Registered User
It would be interesting for turnigy 9x receiver users (there must be thousands of them), if you could write some sort of failsafe detection system...Since on some channels it goes blank and on others the signal stays...So on a particular channel bound to some autopilot the arduino would emulate a certain position of a switch (so that it would trigger RTH for example)...Hope you get what I mean
Jan 18, 2013, 06:35 AM
Registered User
rimshotcopter's Avatar
Thank you, Greatly appreciated.
Jan 18, 2013, 10:57 AM
Registered User
Hasi's Avatar
Quote:
Originally Posted by msev
It would be interesting for turnigy 9x receiver users (there must be thousands of them), if you could write some sort of failsafe detection system...Since on some channels it goes blank and on others the signal stays...So on a particular channel bound to some autopilot the arduino would emulate a certain position of a switch (so that it would trigger RTH for example)...Hope you get what I mean
It doesn't sound complicated. If there is anyone else, who would need this, I might write the code for it.

Quote:
Originally Posted by rimshotcopter
Thank you, Greatly appreciated.
You welcome!
Jun 28, 2013, 09:29 AM
Registered User
cool
Last edited by IMATs; Jun 29, 2013 at 12:18 PM.
Jun 28, 2013, 01:52 PM
Registered User
midelic's Avatar
Hasi,
I uploaded the FlySky TX module code here:
https://www.rcgroups.com/forums/show....php?t=1921870
Thanks!
Jun 28, 2013, 03:05 PM
Registered User
Hasi's Avatar
That's the "magic" of open source.
Jun 28, 2013, 03:06 PM
Registered User
rimshotcopter's Avatar
Quote:
Originally Posted by Hasi
That's the "magic" of open source.
+1 to that!
Jul 18, 2013, 03:29 PM
Registered User
HaxK's Avatar
HI, I need to read a PPM stream, add one channel (clone the channel 3 actually) and output a new PPM stream. I've read and tried to mod several PPM reading/writing sketches but yours seems more clear and the PPM reading sketch works fair better than others.

I've mixed both sketches in one and I'm able to read the PPM in but the PPM out doesn't work. I've seen that the
Code:
attachInterrupt(ppm_in_Pin - 2, read_ppm_in, CHANGE);
line is the one who prevents the PPM out to work but without this the PPM IN will not work.

Could you help me with this issue? I'm a newbie with interrupts.
Jul 18, 2013, 10:46 PM
Registered User
Nice code! Can I borrow it for my transmitter project?
Jul 19, 2013, 03:32 AM
Registered User
Hasi's Avatar
Quote:
Originally Posted by HaxK
HI, I need to read a PPM stream, add one channel (clone the channel 3 actually) and output a new PPM stream. I've read and tried to mod several PPM reading/writing sketches but yours seems more clear and the PPM reading sketch works fair better than others.

I've mixed both sketches in one and I'm able to read the PPM in but the PPM out doesn't work. I've seen that the
Code:
attachInterrupt(ppm_in_Pin - 2, read_ppm_in, CHANGE);
line is the one who prevents the PPM out to work but without this the PPM IN will not work.

Could you help me with this issue? I'm a newbie with interrupts.
Both codes will not work together, because both use timer1, but in a different way. You'll have to write your own for that.



Quote:
Originally Posted by patolin
Nice code! Can I borrow it for my transmitter project?
Shure! Feel free to use it!


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion DIY PPM generator PPM reader and PPM expander Dennis Frie FPV Talk 63 Sep 12, 2016 03:01 PM
Question PPM to TX problem with arduino generated PPM Nase DIY Electronics 65 Jul 22, 2016 06:42 PM
Discussion Help: arduino ppm values to th9x slave rcpilotp51 DIY Electronics 6 Mar 04, 2012 05:13 AM
Question generate PPM signal for "Nine Eagles" Transmitter Nase Radios 3 Aug 27, 2010 06:04 PM
Discussion Generate a PPM signal fkendoul UAV - Unmanned Aerial Vehicles 0 Dec 15, 2007 09:22 AM