- Description
- Features
- Hardware Requirements
- Software Requirements
- Configuration
- Setup
- Usage
- Circuit Diagram
- Troubleshooting
This project implements a joystick controller using ESP-NOW, a protocol developed by Espressif for low-power, peer-to-peer communication between ESP32 devices. The joystick can be used to control various devices wirelessly, making it ideal for remote control applications.
- Wireless Communication: Utilizes ESP-NOW for low-latency communication between ESP32 devices.
- Easy Setup: Simple installation and configuration process for quick deployment.
- Low Power Consumption: Designed for low-power operations, suitable for battery-powered applications.
- Versatile Applications: Can be used for various remote control applications such as drones and robots.
- 2 x ESP32 boards
- 1 or 2 Joystick modules (You may use one joystick for both axes or split X and Y axes across two separate joystick modules)
- 2 x DC motors (for the receiver/car)
- Motor Driver (L298N or BTS)
- Jumper wires
- Power supply for the motors
- Arduino IDE
- ESP32 Board Support (https://dl.espressif.com/dl/package_esp32_index.json)
- WiFi library
- esp_now library
- In
transmitter.ino, replace thereceiverMACarray with the MAC address of your receiver ESP32. - Adjust the
SERIAL_PORTboolean in both files if you want to enable/disable serial debugging. - In
receiver.ino, adjust the following parameters to suit your application:const int DEAD_ZONE = 10;// Set the dead zone to avoid unnecessary movements when the joystick is close to the center.const int numSamples = 100;// Set the number of samples to average for finding the center position of the joystick.
- Install the required libraries in your Arduino IDE.
- Upload the
transmitter.inocode to one ESP32 board (the controller). - Upload the
receiver.inocode to another ESP32 board (the robot). - Connect the joystick module to the transmitter board according to the pin definitions in the code.
- Connect the motors and motor driver to the receiver board as per the pin definitions.
- Power on both ESP32 boards.
- Observe the wireless communication in action as you move the joystick.
-
Issue: Devices do not communicate.
- Solution: Ensure both ESP32 boards are powered and within range. Check the code for correct MAC address and ESP-NOW peer setup.
-
Issue: Joystick is not responding.
- Solution: Verify the connections between the joystick module and the ESP32. Check for any loose wires.
-
Issue: Compilation errors in Arduino IDE.
- Solution: Ensure you have installed the ESP32 board support and the required libraries.
-
Issue: Joystick movements are erratic or unresponsive near the center position.
- Solution: Adjust the
DEAD_ZONEvalue inreceiver.ino. A larger dead zone can help eliminate noise and prevent unintended movements. Experiment with different values until you find one that works well for your joystick.
- Solution: Adjust the
- Implement fail-safe stop on disconnect
Created by NIHAL T P
GitHub: nihaltp
