For this week I needed to use Arduino IDE to build my circuit's code with written text .
I wanted to design a color recognition game for toddlers that helps them link colors to their name based on their teacher instructions .
I also used TINKERCAD to simulate the wiring of my circuit but unfortunately I couldn't find the Bluetooth module in TINKERCAD , that forced me to use figma to insert bluetooth module to my circuit wiring diagram .
This week I wanted to simulate a smart corridor system that opens and closes the door automatically then it turns the corridor's light on while you're moving around .
I needed to use these components :
Arduino Uno
breadboard
male-male jumpers wires
Bluetooth module
RGB LED
330 ohm resistor
buzzer
first of all I wanted to create and try my circuit normally without Bluetooth . I wired the common of the RGB LED to a resistor that already connected to the ground of the breadboard . then I used male male jumpers to wire the rest of the pins to the Arduino . Red pin to pin 2 of the Arduino then blue and green to pins 3 and 4 in order .
I also fixed the buzzer to the breadboard and wired its ground to the breadboard ground and its positive pin to Arduino pin's number5.
I tested the wiring using a simple code and then it was time to control the circuit wirelessly using the Bluetooth module.
I fixed it to the breadboard as shown and used jumpers to wire its RX and TX to the TX and RX of the Arduino in order . ( remember to unwire them while uploading the code to avoid Bluetooth module getting burnt and also add resistors to these 2 pins I used 330 ohm resistance ).
Then I wired the VCC to the the 5 v pin pf Arduino and the GND to the ground of the breadboard .
Wiring Diagram ...
I created a character called encomingData ( forgive my spelling mistake :) ) . I also defined RGB pins as individual pins . The red color is connected to pin 2 m green to pin 4 ,blue to pin 3 and finally the buzzer on pin 5 ( Analog pin) .
After that I defined the pins as INPUTs and started to create my if conditions as shown .
I forgot to disconnect RX and TX pins of Bluetooth module while uploading the code to my Arduino board and that causes a disconnection between the Bluetooth and mobile . I thought it got burnt but I tried to use it again after a while and fortunately it worked .