Circuit Documentation
Summary
This document provides a detailed overview of a circuit that integrates a Raspberry Pi 3B with various sensors and actuators, including a DS18B20 temperature sensor, MPU-6050 accelerometer and gyroscope, QMC5883L magnetometer, L298N DC motor driver, and two DC motors. The Raspberry Pi serves as the central microcontroller, interfacing with the sensors and controlling the motors.
Component List
Raspberry Pi 3B
- Description: A versatile single-board computer used as the central microcontroller.
- Pins: 1, 3, 5, 7, 9, 11, 13, 15, 17, 21, 23, 25, 27, 29, 33, 37, 39, 40, 38, 36, 34, 32, 30, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2(5V), 19, 28, 31, 35
DS18B20
- Description: A digital temperature sensor.
- Pins: signal, GND, vcc
MPU-6050
- Description: A 6-axis accelerometer and gyroscope.
- Pins: VCC, GND, SCL, SDA, XDA, XCL, AD0, INT
QMC5883L Magnetometer
- Description: A 3-axis magnetometer.
- Pins: VCC, GND, SCL, SDA, DRDY
L298N DC Motor Driver
- Description: A dual H-bridge motor driver.
- Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
Resistor
- Description: A 4700 Ohm resistor.
- Pins: pin1, pin2
- Properties: Resistance: 4700 Ohms
DC Motor (Motor 1)
- Description: A DC motor.
- Pins: pin 1, pin 2
DC Motor (Motor 2)
- Description: A DC motor.
- Pins: pin 1, pin 2
Wiring Details
Raspberry Pi 3B
- Pin 1: Connected to VCC of DS18B20, Resistor pin1, L298N DC motor driver 5V, QMC5883L Magnetometer VCC, MPU-6050 VCC
- Pin 3: Connected to SDA of QMC5883L Magnetometer, MPU-6050 SDA
- Pin 5: Connected to SCL of QMC5883L Magnetometer, MPU-6050 SCL
- Pin 6: Connected to GND of DS18B20, L298N DC motor driver, QMC5883L Magnetometer, MPU-6050
- Pin 7: Connected to signal of DS18B20 via Resistor pin2
- Pin 13: Connected to IN4 of L298N DC motor driver
- Pin 15: Connected to IN3 of L298N DC motor driver
- Pin 16: Connected to IN2 of L298N DC motor driver
- Pin 18: Connected to IN1 of L298N DC motor driver
- Pin 22: Connected to ENA of L298N DC motor driver
DS18B20
- GND: Connected to Raspberry Pi 3B Pin 6, L298N DC motor driver GND, QMC5883L Magnetometer GND, MPU-6050 GND
- signal: Connected to Raspberry Pi 3B Pin 7 via Resistor pin2
- vcc: Connected to Raspberry Pi 3B Pin 1, Resistor pin1
MPU-6050
- VCC: Connected to Raspberry Pi 3B Pin 1
- GND: Connected to Raspberry Pi 3B Pin 6
- SCL: Connected to Raspberry Pi 3B Pin 5
- SDA: Connected to Raspberry Pi 3B Pin 3
QMC5883L Magnetometer
- VCC: Connected to Raspberry Pi 3B Pin 1
- GND: Connected to Raspberry Pi 3B Pin 6
- SCL: Connected to Raspberry Pi 3B Pin 5
- SDA: Connected to Raspberry Pi 3B Pin 3
L298N DC Motor Driver
- GND: Connected to Raspberry Pi 3B Pin 6
- 5V: Connected to Raspberry Pi 3B Pin 1
- IN1: Connected to Raspberry Pi 3B Pin 18
- IN2: Connected to Raspberry Pi 3B Pin 16
- IN3: Connected to Raspberry Pi 3B Pin 15
- IN4: Connected to Raspberry Pi 3B Pin 13
- ENA: Connected to Raspberry Pi 3B Pin 22
- OUT1: Connected to pin 2 of DC Motor (Motor 1)
- OUT2: Connected to pin 1 of DC Motor (Motor 1)
- OUT3: Connected to pin 2 of DC Motor (Motor 2)
- OUT4: Connected to pin 1 of DC Motor (Motor 2)
Resistor
- pin1: Connected to vcc of DS18B20, Raspberry Pi 3B Pin 1
- pin2: Connected to signal of DS18B20, Raspberry Pi 3B Pin 7
DC Motor (Motor 1)
- pin 1: Connected to OUT2 of L298N DC motor driver
- pin 2: Connected to OUT1 of L298N DC motor driver
DC Motor (Motor 2)
- pin 1: Connected to OUT4 of L298N DC motor driver
- pin 2: Connected to OUT3 of L298N DC motor driver
Documented Code
Raspberry Pi 3B Code
sketch.ino
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
documentation.txt
