Reading RC Receiver values (version 2)


in a previous post I briefly showed how to read the sum signal of a receiver that is able to output the signal. Although the code works quite well there are several issues with the code:

  1. calling pulseIn(SignalPin, HIGH) blocks until the corresponding pin is set to HIGH, which is a major waste of time, because no other calculations can be performed in the meantime
  2. I noticed that every now and then the readings start to glitch causing unwanted noise

To cope with the first issue I used  Arduino's external interrupt feature that calls a callback function for every rising edge. In addition I wrapped it in a class and defined it as a library for easy usage.

[update: 2013-07-28][update: 2013-08-02]

However, the glitches persisted. Figuring out this issues caused a lot of headaches. To come straight to the point, the signal voltage level is not 5V but 3.3V! This caused the signal detection to occasionally misinterpret a 3V signal as LOW.

In the end the solution is rather simple. I used a p-channel MOSFET I had in my spare-part box and used it as a switch to drive 5V with the signal as input at the gate pin. This way the MOSFET acts as an inverter for the incoming signal while translating it to the 5V level. As I currently lack the time to draw a nice circuit please have a look at the following image I found via image search: circuit

I will probably switch to a RX/TX or bi-directional level converter that I have left over. They are smaller in size and I do not need the capability of switching 10A that the MOSFET currently supports.

I removed the MOSFET and used a level converter designed by Adafruit and distributed by Watterott. (alternative)

I haven't published the code to one of my repositories, since I need to review and clean it up a bit. I promise I will do that in the near future though 🙂

You can find the definition of the Receiver class in my repository

Share on Google+Share on RedditTweet about this on TwitterShare on Facebook

3 thoughts on “Reading RC Receiver values (version 2)”


    Some time ago I have got a similar problem. After some experimenting with microcontrollers I choosed to use a dedicated microcontroller board for rc signal readings every time i deal with many rc inputs, initially I've used my own code. Later(>2009) I've used this off the shelf board
    Low cost and effective


    1. Thanks for the link, this really looks like an interesting off-the-shelve solution!
      Maybe I should go for a solution like this instead of fiddling around with the Arduino 😉

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.