Arduino and Raspberry Pi Controlled Robotic System with Stepper Motors and Sensors
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a complex circuit involving multiple microcontrollers, sensors, motors, and other components. The circuit is designed to interface various sensors and actuators with microcontrollers to perform specific tasks. The documentation includes a component list, wiring details, and the embedded code used in the microcontrollers.
Component List
Arduino Mega 2560
- Description: A microcontroller board based on the ATmega2560.
- Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0-A15, D21/SCL, D20/SDA, D19/RX1, D18/TX1, D17 PWM/RX2, D16 PWM/TX2, D15/RX3, D14/TX3, D0 RX0, D1 TX0, D2-D13 PWM, AREF, SDA, SCL, D22-D53.
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13.
Stepper Motor (Bipolar)
- Description: A bipolar stepper motor.
- Pins: D, B, C, A.
MG996R
- Description: A high-torque servo motor.
- Pins: GND, VCC, SIG.
Servo
- Description: A standard servo motor.
- Pins: gnd, vcc, pulse.
Raspberry Pi 5
- Description: A single-board computer.
- Pins: Type-C, Micro HDMI 1, Micro HDMI 2, Camera 1, Camera 2, PoE, Fan, PCIe, USB 3.0, USB 2.0, Ethernet, 5V, GND, 3.3v, GPIO 0-27.
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic distance sensor.
- Pins: VCC, TRIG, ECHO, GND.
HC-SR501 Motion Sensor
- Description: A PIR motion sensor.
- Pins: GND, OUT, VCC.
Load Cell - Red/white/black/green
- Description: A load cell for measuring weight.
- Pins: E+, A-, E-, A+.
Stepper Driver
- Description: A driver for controlling stepper motors.
- Pins: ENA, ENA-, DIR-, DIR+, PUL-, PUL+, B-, B+, A-, A+, GND, VCC.
Bi-Directional Logic Level Converter
- Description: A logic level converter for interfacing different voltage levels.
- Pins: HV1, HV2, HV, GND, HV3, HV4, LV1, LV2, LV, LV3, LV4.
Microphone
- Description: A USB microphone.
- Pins: USB.
OAK-D
- Description: An AI camera.
- Pins: USB, Power.
HX711 - Bridge Sensor Interface
- Description: An interface for bridge sensors like load cells.
- Pins: E+, E-, A-, A+, B-, B+, GND - GROUND, DATA (OUT), SCK - CLOCK (IN), 3.3/3.5V Supply.
Power Supply
- Description: A power supply unit.
- Pins: 12V, 5V, GND.
LED Light Strips (Violet)
- Description: LED light strips.
- Pins: VCC, GND.
LCD
- Description: A liquid crystal display.
- Pins: HDMI, USB.
Wiring Details
Arduino Mega 2560
- GND: Connected to GND of stepper drivers, MG996R, Servo, and Bi-Directional Logic Level Converter.
- 5V: Connected to VCC of Servo.
- D0 RX0: Connected to HV1 of Bi-Directional Logic Level Converter.
- D2 PWM: Connected to DIR+ of stepper driver.
- D3 PWM: Connected to PUL+ of stepper driver.
- D4 PWM: Connected to ENA- of stepper driver.
- D5 PWM: Connected to ENA- of another stepper driver.
- D6 PWM: Connected to DIR+ of another stepper driver.
- D7 PWM: Connected to PUL+ of another stepper driver.
- D8 PWM: Connected to SIG of MG996R.
- D9 PWM: Connected to SIG of another MG996R.
- D10 PWM: Connected to pulse of Servo.
Arduino UNO
- 5V: Connected to HV of Bi-Directional Logic Level Converter.
- D8: Connected to OUT of HC-SR501 Motion Sensor.
- D7: Connected to SCK - CLOCK (IN) of HX711 - Bridge Sensor Interface.
- D6: Connected to DATA (OUT) of HX711 - Bridge Sensor Interface.
- D5: Connected to TRIG of HC-SR04 Ultrasonic Sensor.
- D4: Connected to ECHO of HC-SR04 Ultrasonic Sensor.
- D3: Connected to TRIG of another HC-SR04 Ultrasonic Sensor.
- D2: Connected to ECHO of another HC-SR04 Ultrasonic Sensor.
Stepper Motor (Bipolar)
- D: Connected to B- of stepper driver.
- B: Connected to B+ of stepper driver.
- C: Connected to A+ of stepper driver.
- A: Connected to A- of stepper driver.
MG996R
- GND: Connected to GND of stepper driver and Power Supply.
- VCC: Connected to 5V of Power Supply.
- SIG: Connected to D8 PWM of Arduino Mega 2560.
Servo
- gnd: Connected to GND of Arduino Mega 2560.
- vcc: Connected to 5V of Arduino Mega 2560.
- pulse: Connected to D10 PWM of Arduino Mega 2560.
Raspberry Pi 5
- Micro HDMI 1: Connected to HDMI of LCD.
- USB 3.0: Connected to USB of LCD and OAK-D.
- USB 2.0: Connected to USB of Microphone.
- GND: Connected to GND of Bi-Directional Logic Level Converter.
- 3.3v: Connected to LV of Bi-Directional Logic Level Converter.
- GPIO 14: Connected to LV1 of Bi-Directional Logic Level Converter.
HC-SR04 Ultrasonic Sensor
- VCC: Connected to 3.3/3.5V Supply of HX711 - Bridge Sensor Interface.
- TRIG: Connected to D5 of Arduino UNO.
- ECHO: Connected to D4 of Arduino UNO.
- GND: Connected to GND of HX711 - Bridge Sensor Interface.
HC-SR501 Motion Sensor
- GND: Connected to GND of HX711 - Bridge Sensor Interface.
- OUT: Connected to D8 of Arduino UNO.
- VCC: Connected to 3.3/3.5V Supply of HX711 - Bridge Sensor Interface.
Load Cell - Red/white/black/green
- E+: Connected to E+ of HX711 - Bridge Sensor Interface.
- A-: Connected to A- of HX711 - Bridge Sensor Interface.
- E-: Connected to E- of HX711 - Bridge Sensor Interface.
- A+: Connected to A+ of HX711 - Bridge Sensor Interface.
Stepper Driver
- ENA: Connected to GND of Power Supply.
- DIR-: Connected to GND of Power Supply.
- PUL-: Connected to GND of Power Supply.
- GND: Connected to GND of Power Supply.
- DIR+: Connected to D2 PWM of Arduino Mega 2560.
- PUL+: Connected to D3 PWM of Arduino Mega 2560.
- ENA-: Connected to D4 PWM of Arduino Mega 2560.
- B-: Connected to D of Stepper Motor.
- B+: Connected to B of Stepper Motor.
- A-: Connected to A of Stepper Motor.
- A+: Connected to C of Stepper Motor.
- VCC: Connected to 12V of Power Supply.
Bi-Directional Logic Level Converter
- GND: Connected to GND of Arduino Mega 2560 and Raspberry Pi 5.
- HV: Connected to 5V of Arduino UNO.
- LV: Connected to 3.3v of Raspberry Pi 5.
- HV1: Connected to D0 RX0 of Arduino Mega 2560.
- LV1: Connected to GPIO 14 of Raspberry Pi 5.
Microphone
- USB: Connected to USB 2.0 of Raspberry Pi 5.
OAK-D
- USB: Connected to USB 3.0 of Raspberry Pi 5.
HX711 - Bridge Sensor Interface
- 3.3/3.5V Supply: Connected to VCC of