Arduino UNO-Based Ultrasonic Sensor and Color Detection System with Audio Feedback
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves multiple sensors and modules connected to an Arduino UNO microcontroller. The primary components include three HC-SR04 Ultrasonic Sensors, a TCS3200 color sensor, an LM2596 voltage regulator, a DFPlayer MINI MP3 player, a speaker, and a 2x 18650 battery pack. The circuit is designed to measure distances, detect colors, and play audio based on the sensor inputs.
Component List
HC-SR04 Ultrasonic Sensor
- Pins: VCC, TRIG, ECHO, GND
- Description: Ultrasonic distance sensor used to measure the distance to an object.
- Purpose in Circuit: Distance measurement.
TCS3200 Color Sensor
- Pins: GND, OUT, S2, S3, VCC, LED, S0, S1
- Description: Color sensor used to detect the color of an object.
- Purpose in Circuit: Color detection.
LM2596 Voltage Regulator
- Pins: IN, OUT
- Description: Step-down voltage regulator.
- Purpose in Circuit: To provide a stable voltage supply to the components.
DFPlayer MINI
- Pins: VCC, BUSY, RX, USB -, TX, USB +, DAC_R, K2/ADC_KEY, DAC_L, K1/ADC_KEY, SPK1, IO 2, GND, SPK2, IO 1
- Description: MP3 player module.
- Purpose in Circuit: To play audio files.
Speaker
- Pins: +, -
- Description: Audio output device.
- Purpose in Circuit: To output sound from the DFPlayer MINI.
2x 18650 Battery Pack
- Pins: vcc, gnd
- Description: Battery pack providing power to the circuit.
- Purpose in Circuit: Power supply.
Arduino UNO
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
- Description: Microcontroller board.
- Purpose in Circuit: Central control unit.
Resistor (1k Ohm)
- Pins: pin1, pin2
- Description: Resistor with 1k Ohm resistance.
- Purpose in Circuit: Current limiting.
Wiring Details
HC-SR04 Ultrasonic Sensor 1
- VCC: Connected to Arduino UNO 5V
- TRIG: Connected to Arduino UNO A3
- ECHO: Connected to Arduino UNO A2
- GND: Connected to Arduino UNO GND
HC-SR04 Ultrasonic Sensor 2
- VCC: Connected to Arduino UNO 5V
- TRIG: Connected to Arduino UNO A0
- ECHO: Connected to Arduino UNO A1
- GND: Connected to Arduino UNO GND
HC-SR04 Ultrasonic Sensor 3
- VCC: Connected to Arduino UNO 5V
- TRIG: Connected to Arduino UNO A5
- ECHO: Connected to Arduino UNO A4
- GND: Connected to Arduino UNO GND
TCS3200 Color Sensor
- VCC: Connected to Arduino UNO 5V
- GND: Connected to Arduino UNO GND
- OUT: Connected to Arduino UNO D12
- S2: Connected to Arduino UNO D10
- S3: Connected to Arduino UNO D11
- S0: Connected to Arduino UNO D8
- S1: Connected to Arduino UNO D9
LM2596 Voltage Regulator
- IN: Connected to 2x 18650 Battery Pack vcc
- OUT: Connected to Arduino UNO Vin and GND
DFPlayer MINI
- VCC: Connected to Arduino UNO 5V
- GND: Connected to Arduino UNO GND
- RX: Connected to Resistor pin2
- TX: Connected to Resistor pin2
- SPK1: Connected to Speaker +
- SPK2: Connected to Speaker -
Speaker
- +: Connected to DFPlayer MINI SPK1
- -: Connected to DFPlayer MINI SPK2
2x 18650 Battery Pack
- vcc: Connected to LM2596 IN
- gnd: Connected to LM2596 IN
Resistor 1 (1k Ohm)
- pin1: Connected to Arduino UNO D6
- pin2: Connected to DFPlayer MINI RX
Resistor 2 (1k Ohm)
- pin1: Connected to Arduino UNO D5
- pin2: Connected to DFPlayer MINI TX
Code Documentation
Arduino UNO Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a basic template for the Arduino UNO. The setup() function is used to initialize any settings or configurations, and the loop() function contains the main logic that runs repeatedly. Currently, the code does not contain any specific logic or functionality.