Smart Mood Display Circuit
This week's assignment required us Build a simple smart circuit that contains at least TWO action components that you can control wirelessly.
This project involves designing a smart circuit that displays the user's mood using two action components:
An LCD screen – Displays a mood-related message (e.g., "Happy 😊", "Sad 😔", "Excited 🎉").
An RGB LED – Changes color to match the displayed mood (e.g., blue for sad, green for calm, red for excited).
The circuit is wirelessly controlled, allowing the user to update their mood remotely via a smartphone app, a web interface, or a Bluetooth module.
Inspiration
The idea for this project was suggested by a friend, which inspired the development of a simple yet engaging way to express emotions through a visual and interactive display.
firtizing: Used as a virtual software to build the circuit.
Breadboard: Used to place and connect various electronic components.
Arduino Uno: The microcontroller used to control the circuit.
Jumper Wires (Male-Male / Male-Female): Used to make electrical connections between components on the breadboard and other terminals.
9V Adapter: Regulates the voltage to 9V to protect the components.
Arduino Cable: Connects the Arduino to a PC for uploading code or powering the Arduino.
Arduino IDE: A software platform used for writing and uploading text-based code to the Arduino.
LCD: Displays messages based on sensor readings.
RGB led : Changes color to match the displayed mood (e.g., blue for sad, green for calm, red for excited)
Bluetooth module :
Bluetooth module : will allow you to control the LCD and RGB LED wirelessly from a smartphone or computer.
Output Components:
LCD: Displays a message when the ultrasonic sensor detects a specific distance.
RGB : change the color and control it by phone
Arduino Uno: Controls the entire circuit.
I used firtizing to test the circuit before building it physically, ensuring that no components would be damaged. I chose Fritzing over Tinkercad because:
It provides a wider range of components that Tinkercad does not have.
It allows for a more detailed and realistic simulation of the circuit.
Steps:
Inserting Components:
I added the required components, including a breadboard, Arduino Uno, Bluetooth module ,RGB led , LCD
Wiring the Power Connections:
Connected VCC (5V) from the Arduino to the positive rail of the breadboard.
Connected GND from the Arduino to the negative rail of the breadboard.
Bluetooth Wiring:
VCC → Positive rail
GND → Negative rail
RX pin : to TX pin in arduino
TX pin : to RX pin in arduino
LCD Wiring (4 Pins):
VCC → Positive rail
GND → Negative rail
SDA → Pin A4 on the Arduino
SCL → Pin A5 on the Arduino
RGB
Red Pin → Pin A0 (Arduino)
green Pin → Pin A1(Arduino)
GND → Negative rail
Breadboard and Component Setup:
Place the breadboard and components.
Connect the LCD:
VCC to 5V on the Arduino
GND to GND on the Arduino
SDA to A4
SCL to A5
Connect the RGB
Red Pin → Pin 9 (Arduino)
green Pin → Pin 10 (Arduino)
GND → Negative rail with resistance
Connect the bluetooth module :
VCC → Positive rail
GND → Negative rail
RX pin : to TX pin in arduino
TX pin : to RX pin in arduino
Connect the adapter to the breadboard and plug in the Arduino cable to upload the code.
Code Functionality:
This Arduino code controls an LCD display and two LEDs (Red & Green) based on serial input received via Bluetooth or USB communication. The LCD displays messages based on the received command.
.
Wire.h is required for I2C communication.
LiquidCrystal_I2C.h is used to control the LCD display.
RED_LED is connected to Analog Pin A0.
GREEN_LED is connected to Analog Pin A1.
The LCD is configured with the I2C address 0x27.
It is a 16x2 LCD (16 columns, 2 rows).
Serial communication is initialized at 9600 baud rate.
LEDs are set as outputs.
LCD is initialized and starts with the message: "ba3d el eid".
A "System Ready..." message is sent to the Serial Monitor.
The code checks if data is available on the serial port.
Reads the incoming character.
Uses bitwise AND (& 0x7F) to remove unwanted characters.
Green LED is turned ON at full brightness.
Red LED is turned OFF.
LCD displays: "Fe Ramadan".
Green LED is turned OFF.
Red LED is turned ON at full brightness.
LCD displays: "Happy Ramadan!".
Both LEDs are turned OFF.
LCD displays the default message: "ba3d el eid".
The LCD message remains for 3 seconds before the system clears it.
Title of Media
I couldn't find the Bluetooth module and LCD in Fritzing for simulation.
I asked a friend, and he told me that I could download them as FZZ files and import them into Fritzing.
After testing, I discovered that the issue was related to the code and the LCD model I was using.
I searched in the Arduino Hub and found the correct library: LiquidCrystal_I2C. To ensure proper communication, I also added the Wire.h library.
Ref 1 ( iquidCrystal-i2c)
https://forum.arduino.cc/t/i2c-lcd-module-using-wire-h/1153363/5
Ref 2 ( Wire.h)
https://forum.arduino.cc/t/wire-h-library-and-lcd-i2c/202480
Title of Media
Title of Media