SMALL - Telemetry SMALL - Radio
Thread Tools
Old Jan 13, 2013, 02:42 PM
Hasi is offline
Find More Posts by Hasi
Registered User
Hasi's Avatar
Austria, Stmk., Graz
Joined Sep 2011
587 Posts
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).
Hasi is offline Find More Posts by Hasi
Last edited by Hasi; Oct 25, 2014 at 02:37 PM.
Reply With Quote
Sign up now
to remove ads between posts
Old Jan 17, 2013, 02:59 AM
msev is offline
Find More Posts by msev
Registered User
Joined Sep 2010
2,449 Posts
So the first one reads for example all the channels from the receiver and then generates a ppm stream?
msev is offline Find More Posts by msev
Reply With Quote
Old Jan 17, 2013, 03:05 AM
Hasi is offline
Find More Posts by Hasi
Registered User
Hasi's Avatar
Austria, Stmk., Graz
Joined Sep 2011
587 Posts
Quote:
Originally Posted by msev View Post
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.
Hasi is offline Find More Posts by Hasi
Reply With Quote
Old Jan 17, 2013, 03:22 AM
msev is offline
Find More Posts by msev
Registered User
Joined Sep 2010
2,449 Posts
So you have to know how the signal stream that comes from the rx to the arduino looks like?
msev is offline Find More Posts by msev
Reply With Quote
Old Jan 17, 2013, 03:29 AM
Hasi is offline
Find More Posts by Hasi
Registered User
Hasi's Avatar
Austria, Stmk., Graz
Joined Sep 2011
587 Posts
Quote:
Originally Posted by msev View Post
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...
Hasi is offline Find More Posts by Hasi
Reply With Quote
Old Jan 17, 2013, 03:33 AM
msev is offline
Find More Posts by msev
Registered User
Joined Sep 2010
2,449 Posts
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
msev is offline Find More Posts by msev
Reply With Quote
Old Jan 18, 2013, 06:35 AM
rimshotcopter is online now
Find More Posts by rimshotcopter
Registered User
rimshotcopter's Avatar
United States, CA, Los Angeles
Joined Aug 2009
11,728 Posts
Thank you, Greatly appreciated.
rimshotcopter is online now Find More Posts by rimshotcopter
Reply With Quote
Old Jan 18, 2013, 10:57 AM
Hasi is offline
Find More Posts by Hasi
Registered User
Hasi's Avatar
Austria, Stmk., Graz
Joined Sep 2011
587 Posts
Quote:
Originally Posted by msev View Post
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 View Post
Thank you, Greatly appreciated.
You welcome!
Hasi is offline Find More Posts by Hasi
Reply With Quote
Old Jun 28, 2013, 09:29 AM
IMATs is offline
Find More Posts by IMATs
Registered User
Joined Nov 2009
3 Posts
cool
IMATs is offline Find More Posts by IMATs
Last edited by IMATs; Jun 29, 2013 at 12:18 PM.
Reply With Quote
Old Jun 28, 2013, 01:52 PM
midelic is online now
Find More Posts by midelic
Registered User
midelic's Avatar
Joined Apr 2012
4,641 Posts
Hasi,
I uploaded the FlySky TX module code here:
http://www.rcgroups.com/forums/showthread.php?t=1921870
Thanks!
midelic is online now Find More Posts by midelic
Reply With Quote
Old Jun 28, 2013, 03:05 PM
Hasi is offline
Find More Posts by Hasi
Registered User
Hasi's Avatar
Austria, Stmk., Graz
Joined Sep 2011
587 Posts
That's the "magic" of open source.
Hasi is offline Find More Posts by Hasi
Reply With Quote
Old Jun 28, 2013, 03:06 PM
rimshotcopter is online now
Find More Posts by rimshotcopter
Registered User
rimshotcopter's Avatar
United States, CA, Los Angeles
Joined Aug 2009
11,728 Posts
Quote:
Originally Posted by Hasi View Post
That's the "magic" of open source.
+1 to that!
rimshotcopter is online now Find More Posts by rimshotcopter
Reply With Quote
Old Jul 18, 2013, 03:29 PM
HaxK is offline
Find More Posts by HaxK
Registered User
HaxK's Avatar
Joined Dec 2012
56 Posts
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.
HaxK is offline Find More Posts by HaxK
Reply With Quote
Old Jul 18, 2013, 10:46 PM
patolin is offline
Find More Posts by patolin
Registered User
Joined Jul 2010
313 Posts
Nice code! Can I borrow it for my transmitter project?
patolin is offline Find More Posts by patolin
Reply With Quote
Old Jul 19, 2013, 03:32 AM
Hasi is offline
Find More Posts by Hasi
Registered User
Hasi's Avatar
Austria, Stmk., Graz
Joined Sep 2011
587 Posts
Quote:
Originally Posted by HaxK View Post
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 View Post
Nice code! Can I borrow it for my transmitter project?
Shure! Feel free to use it!
Hasi is offline Find More Posts by Hasi
Reply With Quote


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 62 Dec 09, 2014 04:07 AM
Question PPM to TX problem with arduino generated PPM Nase DIY Electronics 64 Oct 15, 2014 11:16 AM
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