in this week we are asked to build a smart circuit by using arduino so i decided to make fire alarm i made this idea after i saw it on You tube but i replace led with RGB led and put buzzer
requirements
Build and Program a smart circuit using an Arduino UNO which reads a signal from an input component
using code blocks
tinker cad : use it as software to build the circuit virtual to void any problem and made the code blocks
breadboard : to but other components on it
RGB led: it light ( red - green - blue ) depending on the pin i use
arduino uno : it is the microcontroller i use
jumper wires ( male - male ) : Used to make electrical connections between components on the breadboard or other terminals.
lm 35 sensor : it is for sense the change of temperature
buzzer : make a sound
resistance : to Limits the current flow in a circuit
adaptor 9 v : it modify the volt to 9 v to protect components
cable of arduino : it attach to pc and arduino to upload the code or starting arduino
arduino ide : to to the code text on it and upload it to arduino
resistance 330 : to limit current
input
lm 35 sensor : it sense the change of temperature
output
RGB led : that will light red when temperature more than 23 degree and when it is less it will be green
buzzer : that will make noise when it reach 23 degree
microcontroller
arduino uno : that control all the circuit
tinker cad
i use tinker cad to test the circuit to avoid destroy any component
first step i insert the components i need such as (breadboard / arduino / buzzer / RGB led / LM 36 ) i insert LM 36 because this is the available model
then put the RGB led into breadboard and attach a resistance to the cathode /attach jumper wire to the most left pin to light red then attach it to digital pin 8 in arduino / the pin beside cathode in RGP to light green to digital pin 9 in arduino
insert LM35 and attach it to the breadboard / the left pin connected to the power of circuit and most right pin connected to ground of the circuit middle pin connected to analog pin A4 in arduino
insert buzzer connect negative of it to the ground / positive to digital pin 4
code blocks
after i assembly the component i start made code blocks that order to light RGB with green color if temperature less than 23 and when it sense temperature more than 23 change color to red and buzzer work with specific tone until temperature back less than 23 color back green and buzzer turned of
i start to to put bread board and component such as i do in tinker cad after that i attach cable of arduino to laptop and to arduino
download the code from tinker cad and get the code of LM 35 model from website instructables and upload all that on arduino ide
then write the code on it and upload it to the arduino
connect negative of it to the ground / positive to digital pin 4
after i write the code i upload it to arduino
Title of Media
The main issue was coding. I didn’t know that Tinkercad uses the LM36 temperature sensor instead of LM35, which caused the temperature readings to be incorrect.
Rewatched tutorial videos and realized that Tinkercad has a different sensor version (LM36 instead of LM35).
Researched the correct code for the LM35 sensor and found the correct way to convert the sensor reading to Celsius on the Instructables website.
Fixed the issue by correcting the temperature conversion formula in the code.
Title of Media
Title of Media