PCB ‐ Microcontroller - RoboFEIatWork/electronics GitHub Wiki

🧠 PCB - Microcontroller

We use two units of the ESP32-WROOM-32E-N8 module as the main controllers of the robot.
Both microcontrollers are powered directly via USB, connected to the computer. No external voltage regulators are used for them on the PCB.


🔀 Role of Each ESP32

🅰️ ESP32 #1 – Control Unit

This ESP32 is responsible for sending all the control signals required for the robot’s operation. It communicates with the PC via ROS2 and performs the following tasks:

  • Sends PWM signals to motor drivers
  • Controls PWM for the LIDAR (optional)
  • Controls LED indicators (currently disabled due to time constraints)

🔁 Motor PWM Behavior

The analog PWM signal sent to the motor drivers defines the direction of wheel rotation, following the table below:

Voltage Range Behavior
0 V to 1.25 V Wheel rotates backward (reverse)
Exactly 1.25 V Wheel remains stationary
1.25 V to 3.3 V Wheel rotates forward

🅱️ ESP32 #2 – Feedback Unit

This second ESP32 handles all the feedback and sensor readings, and forwards the data to the PC via ROS2.

It is responsible for:

  • Reading encoder signals from all wheels
  • Receiving battery voltage and current feedback
  • Initially, it was planned to receive LIDAR data, but after evaluation, we decided to connect the LIDAR directly to the PC, as it simplified power supply and communication handling

📌 Summary

Feature ESP32 #1 (Control) ESP32 #2 (Feedback)
Powered by USB
ROS2 Communication
PWM to motor drivers
LED control ✅ (disabled)
LIDAR PWM control
Encoder input
Battery feedback (ADC)
LIDAR serial connection ❌ (initially planned) ❌ (moved to PC)