Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino-Controlled NRF24L01 Wireless Potentiometer Data Transmission System

View and Edit Project In Cirkit DesignerImage of Arduino-Controlled NRF24L01 Wireless Potentiometer Data Transmission System

Circuit Documentation

Summary

This circuit is designed to read analog values from multiple potentiometers and transmit the readings wirelessly using an NRF24L01 transceiver module. An Arduino Micro (Rev3) serves as the central microcontroller, interfacing with the potentiometers and the NRF24L01 module. The Arduino is powered by a 9V battery and regulates the voltage to 5V for the potentiometers and 3.3V for the NRF24L01. The potentiometer readings are sent over SPI to the NRF24L01, which transmits the data to a remote receiver.

Component List

Arduino Micro (Rev3)

Potentiometer (x6)

NRF24L01

9V Battery

Wiring Details

Arduino Micro (Rev3)

Potentiometer

NRF24L01

9V Battery

Documented Code

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(9, 10);  // CE, CSN pins
const byte address[6] = "00001";  // Communication address

int potPins[6] = {A0, A1, A2, A3, A4, A5};  // Potentiometer pins
int potValues[6];  // Array to store potentiometer readings

void setup()
{
  Serial.begin(9600);
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MIN);
  radio.stopListening();
}

void loop() 
{
  for (int i = 0; i < 6; i++) 
  {
    potValues[i] = analogRead(potPins[i]);  // Read potentiometer values
  }
  radio.write(&potValues, sizeof(potValues));  // Send potentiometer values
  delay(100);  // Delay for communication
}

This code initializes the NRF24L01 module and reads the analog values from six potentiometers connected to the Arduino Micro. The values are stored in an array and transmitted wirelessly to a receiver. The radio object is configured with CE and CSN pins connected to digital pins 9 and 10, respectively. The setup function initializes serial communication for debugging, sets up the radio, and stops listening to prepare for sending data. The loop function reads each potentiometer and sends the array of values through the radio module.