nRF24L01 wireless servo remote
Build it step by step
0 of 5 doneSolder the capacitors
Fit a 10 µF capacitor right across each radio's VCC and GND pins (minus to GND). This fixes most nRF24 problems.
Wire both radios
VCC to 3V3 (never 5V), GND, CE D7, CSN D8, SCK D13, MOSI D11, MISO D12.
Build the remote
Pot on A0. Upload with TRANSMITTER 1.
Build the receiver
Servo on D9. Upload with TRANSMITTER 0.
Test the link
Power both, turn the knob, then walk away with the remote until it stops.
How do you build a nRF24L01 wireless servo remote?
Turn a knob on one Arduino Nano and a servo on another Nano follows wirelessly over a 2.4 GHz nRF24L01+ link, with a fail-safe if the signal is lost. You need Arduino Nano × 2, nRF24L01+ Radio Module × 2, Electrolytic capacitor 10 µF × 2, Potentiometer 10 kΩ, SG90 Micro Servo, Breadboard 400 points (half size) × 2 and Jumper wires male to female (40 pcs). It takes 5 steps and about 90 minutes.
- Level
- Intermediate
- Time
- About 90 min
- Parts
- 7
Parts list
- Development BoardsBuyArduino Nano × 2
- WirelessBuy
- PassivesBuyAcross each radio's power pins
- PassivesBuy
- Motors & ActuatorsBuySG90 Micro Servo × 1
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| nRF24 VCC / GND (both boards) | Nano 3V3 / GND, 10 µF across them | 3.3 V only |
| nRF24 CE / CSN | Nano D7 / D8 | Radio control |
| nRF24 SCK / MOSI / MISO | Nano D13 / D11 / D12 | SPI |
| Remote: pot outer pins / wiper | 5V and GND / A0 | Knob |
| Receiver: servo signal / red / brown | D9 / 5V / GND | Output |
Code
Arduino IDE, board "Arduino Nano". Install "RF24" by TMRh20. Upload once with TRANSMITTER 1 to the remote and once with 0 to the receiver.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
#define TRANSMITTER 1 // 1 for the remote with the knob, 0 for the receiver with the servo
#include <SPI.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte ADDR[6] = "EL001";
#if TRANSMITTER
void setup() {
Serial.begin(9600);
if (!radio.begin()) Serial.println("Radio not responding");
radio.setPALevel(RF24_PA_LOW);
radio.openWritingPipe(ADDR);
radio.stopListening();
}
void loop() {
int v = analogRead(A0);
bool ok = radio.write(&v, sizeof v); // true when the receiver acknowledged
Serial.print(v); Serial.println(ok ? " sent" : " no ack");
delay(20);
}
#else
#include <Servo.h>
Servo arm;
unsigned long lastRx = 0;
void setup() {
Serial.begin(9600);
arm.attach(9);
if (!radio.begin()) Serial.println("Radio not responding");
radio.setPALevel(RF24_PA_LOW);
radio.openReadingPipe(1, ADDR);
radio.startListening();
}
void loop() {
if (radio.available()) {
int v; radio.read(&v, sizeof v);
arm.write(map(v, 0, 1023, 0, 180));
lastRx = millis();
}
if (millis() - lastRx > 1000) arm.write(90); // fail-safe: centre if the link is lost
}
#endifTest checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Remote serial monitor | Numbers with "sent" when the receiver is on, "no ack" when it is off |
| Turning the knob | The servo follows within a fraction of a second |
| Receiver switched off and on | Link recovers by itself |
| Remote switched off | Servo centres after 1 s |
If it does not work
"Radio not responding"
Check the SPI wires and CE/CSN, and that VCC is 3.3 V.
Always "no ack"
Add the 10 µF capacitors, keep the boards at least 1 m apart for the first test, and check both use the same address.
Short range
RF24_PA_LOW is for the bench. Use RF24_PA_HIGH, or the PA+LNA module with an external antenna and its own 3.3 V regulator.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the nRF24L01 wireless servo remote?
Arduino Nano × 2, nRF24L01+ Radio Module × 2, Electrolytic capacitor 10 µF × 2, Potentiometer 10 kΩ, SG90 Micro Servo, Breadboard 400 points (half size) × 2 and Jumper wires male to female (40 pcs). Electrolytic capacitor 10 µF × 2: Across each radio's power pins.
How long does the nRF24L01 wireless servo remote take to build?
About 90 minutes for a intermediate maker, in 5 steps.
How do I know the nRF24L01 wireless servo remote works?
Remote serial monitor: Numbers with "sent" when the receiver is on, "no ack" when it is off. Turning the knob: The servo follows within a fraction of a second. Receiver switched off and on: Link recovers by itself.
Radio not responding: what should I check?
Check the SPI wires and CE/CSN, and that VCC is 3.3 V.
Always "no ack: what should I check?
Add the 10 µF capacitors, keep the boards at least 1 m apart for the first test, and check both use the same address.
Short range: what should I check?
RF24_PA_LOW is for the bench. Use RF24_PA_HIGH, or the PA+LNA module with an external antenna and its own 3.3 V regulator.
