Alarm System
This alarm system takes an LCD display 4 led's, 4 330 resistors, 1 230 resistor, and 1 ultrasonic distance sensor. The purpose of this circuit is to be an alarm system and it also displays how far you are from the sensor and it warns on how close you are to it.
Supplies
LCD display 4 led's, 4 330 resistors, 1 230 resistor, and 1 ultrasonic distance sensor.
Powering Your Breadboard
for step one you need to put a ardunio motherboard and also a breadboard and after that you need to give the power to the breadboard to do this you put a connect the 5 volt pin to the postive side of the power grid for the breadboard and you put the ground pin to the negtive side of the power grid.
Powering the Ultrasonic Distance Sensor
The second step you need to do is to hook up your ultrasonic distance sensor and you also need to power it. to do this you plug in the ultrasonic sensor into the breadboard and there is going to be 4 pins the 1st pin is the power the second pin is the trigger and this needs to be connected into digital pin 3 and the reason that it's called trigger is. is becuese the way that the ultrasonic distance sensor works is by putting out a ultrasonic sound that humans can't hear and the other thing that it does is that it detects the sound that bounced of an object in front of the ultrasonic sensor and based off of that it gives us a distance. the third pin is for echo which is when the sound comes back you are going to need to connect that into 4th digital pin and the last pin is for ground which means it need's to be connected to the ground side of the power grid.
Hooking Up Your Lcd Display
for the LCD display it is going to be off the bread board because it's to big to go on it. for the pins im going to tell you were to put them for the first 2 pins they are ground and power so plug them into ground and power. the third pin also goes to ground and the 4th pin goes to digtalpin number 11 for the 5th pin you put that in ground the 6th pin goes to digitalpin 12. after the 6th pin you need to skip next 4 pins so for the 11th pin you put that in digitalpin number 5 for pin number 12th you put that into digitalpin 6th. for the 13th pin you put that in digital pin 7 and for 14th you put that into digitalpin 8. for the 15th pin you put that in a resistor 230 ohms resistor that is connected to power and the last pin is for ground.
Green,yellow,orange and Red Led's
this the second last step and to do this you need to have 4 330 ohms resistors. starting off with the green led the cathode need's to be connected to a a resistor that's connected to digitalpin number 13 and the anode need's to be connected to power. with the yellow led the cathode need's to be connected to a a resistor that's connected to digitalpin number 9 and the anode need's to be connected to power. with the orange led the cathode need's to be connected to a a resistor that's connected to digitalpin number 2 and the anode need's to be connected to power. with the red led the cathode need's to be connected to a a resistor that's connected to digitalpin number 10 and the anode need's to be connected to power.
The Code
for the code I have done it for you all you need to do is to download the file and put apply it to your code.