RC Receiver to Arduino to Master Bluetooth

Hello guys. We are working on a local STEM project and have a need to actuate a servo via RC receiver. We are newbies in this forum and in arduino coding in general. We have searched for two days now looking for someone that has done something like this before, but all we can find are individual master-slave bluetooth connections, but very little information on how the arduino can accept a receiver’s PWM signal and translate it to an output command via bluetooth. From what we can tell, the slave code does not seem hard, but how to send the command from the master bluetooth module is something that we are struggling to figure out. Any advice or other topics that can help us to figure this out are very much appreciated. We are sure someone has done this before, but can’t simply find clear information about a project of this kind.

Attached is a diagram of what we are attempting to do and the hardware that we are using.

Thanks in advance for the help to this newbie.

Your diagram shows the exact master-slave Bluetooth connection between your two nanos. What are you struggling with? You receive a signal from the RC controller on the master nano (Is that the PWM signal?). Based on that, you send something to to slave nano which controls the servo.

What the two nanos send to each other is completely up to you. For example, the master Nano could receive an RC signal and then transmit the value "1234" to to slave which would then receive the message and turn turn servo to 45 degrees. You could also send the message "gloop". It is only communication between two Nanos that you control.

I'm guessing here... but the Master receives some sort of value based on the RC controller (joystick position or something). You then have to translate that into some message (maybe 0-255) that you send to the Slave. The slave receives this value and applies that to some servo position (0=0, 255=180 degrees)

Thank you for the quick response blh64. What you have described in the response is right along with our findings. Based on what we have found, here is our approach thus far:

Reading the RC input signal into Arduino:
a) call out the channel from the RC receiver and the chosen PWM pin in the arduino.
b) define a deadzone value for when we do not want the servo to move.

Communicating the RC signal to Master Bluetooth:
d) initialize a state to read the data from the serial port
e) in the void setup () section we call out the serial baud rate of the master bluetooth module
f) In the void loop, we check and read data from the serial port
g) We read pulse from the receiver, and covert it into a PWM value from -255 to 255.
h) We add a Serial.write command to send the PWM values read from the RC receiver to the servo

Slave Bluetooth signal to servo output:
i) include servo library <Servo.h> and initialize a state command
j) in the void setup (), call out the Serial.begin baud rate to communicate with the master bluetooth
k) in the void loop () check if there is any data coming into the serial port
l) write the servo state condition based on the PWM value received

If our described approach above is somewhat in the right direction, the questions that we now need answer are:

  • in order to incorporate a level of security in the communication, how do we code the identified PWM signal by the arduino nano to some sort of message that will be read by the slave bluetooth module and execute a simple high and low servo actuation?
  • for anyone that that has done something like it before, will the two bluetooth modules stay connected (say within a range of 10 meters with some level of reliability (understanding that these are cheap devices)? Any stories or information that we should consider are much appreciated. We want to avoid pairing them up manually every time that we power each system (slave & master bluetooth). We are open to suggestions and guidance (especially on the code part…). Thanks!

You read the pulse from the RC receiver. Then you transmit that value to the receiving Arduino together with a channel number so you know which servo it's for. There is no need to convert it to anything and certainly not PWM (and anyway PWM values are 0-255, no negatives).

At the receiving end you write to the servos using servo.writeMicroseconds(xxxx) where xxxx is the pulse length from the RC receiver that you just sent over. That's about it.

For the sending and receiving you use the techniques described in Serial Input Basics

Steve