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

Arduino Uno R3 and DFPlayer Mini-Based Interactive Color Sensor with Audio Feedback

View and Edit Project In Cirkit DesignerImage of Arduino Uno R3 and DFPlayer Mini-Based Interactive Color Sensor with Audio Feedback

Circuit Documentation

Summary

This circuit is designed to interface an Arduino Uno R3 with various components including a DFPlayer Mini, a PAM8403 amplifier, a TCS3472 color sensor, multiple pushbuttons, a toggle switch, a TRRS 3.5mm jack breakout, a loudspeaker, and a Type-C power bank module. The Arduino Uno R3 serves as the central microcontroller, controlling the DFPlayer Mini for audio playback, reading inputs from pushbuttons and a toggle switch, and interfacing with the TCS3472 color sensor for color detection.

Component List

Arduino Uno R3

DFPlayer Mini

Toggle Switch

TCS3472 Color Light-to-Digital Converter with IR Filter

Pushbutton

PAM8403

TRRS 3.5mm Jack Breakout

Loudspeaker

7.4v Battery

Type-C Power Bank Module

Wiring Details

Arduino Uno R3

DFPlayer Mini

Toggle Switch

TCS3472 Color Light-to-Digital Converter with IR Filter

Pushbutton

PAM8403

TRRS 3.5mm Jack Breakout

Loudspeaker

7.4v Battery

Type-C Power Bank Module

Documented Code

#include <EEPROM.h>
#include <Adafruit_TCS34725.h>
#include <Wire.h>
#include <DFPlayer_Mini_Mp3.h>
#include "SoftwareSerial.h"
//#include "DFRobotDFPlayerMini.h"
static const uint8_t PIN_MP3_TX = 3; // Connects to module's RX
static const uint8_t PIN_MP3_RX = 2; // Connects to module's TX
SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX);
// Create the Player object
//DFRobotDFPlayerMini player;

int tb1=4;
int tb2=5;
int tb3=6;
int tb4=9;
int tb5=8;
int tb6=7;
int tb7=10;
int tb8=11;
int tb9=12;

int bc1;
int bc2;
int bc3;
int bc4;
int bc5;
int bc6;
int bc7;
int bc8;
int bc9;

Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_4X);

byte R=0;
byte G=0;
byte B=0;
byte Ra;
byte Rb;
byte Ga;
byte Gb;
byte Ba;
byte Bb;

int nilai;
char kal;

void setup() {
  pinMode(tb1,INPUT_PULLUP);
  pinMode(tb2,INPUT_PULLUP);
  pinMode(tb3,INPUT_PULLUP);
  pinMode(tb4,INPUT_PULLUP);
  pinMode(tb5,INPUT_PULLUP);
  pinMode(tb6,INPUT_PULLUP);
  pinMode(tb7,INPUT_PULLUP);
  pinMode(tb8,INPUT_PULLUP);
  pin