Campus: midrand faculty: information tecnology


// Finally, a delay of 1 second is added before the loop repeats to avoid overwhelming the sensors with frequent readings



Download 1.08 Mb.
Page3/4
Date25.08.2023
Size1.08 Mb.
#61919
1   2   3   4
RASPBERRY PI CODE
// Finally, a delay of 1 second is added before the loop repeats to avoid overwhelming the sensors with frequent readings.


STEP 3 : ASSEMBLE THE BOARD


Following the above image, the layout is relatively simple.
Remember a static free work station is highly recommended. If you're an avid electronics enthusiast and don't have an ESD wristband or work mat, get one. If this is your
first, and maybe only project, a large piece of metal such as a power supply case can work fine.
Now, lets begin!
First off, attach your LCD screen to the bread board. Have the opening pins spaced from left to right as shown above. For simplicity, the left-most pin, based off the
orientation above, we'll refer to as pin 1, moving right to pin 2, pin 3, and so on.
Provide power to the breadboard by running one wire from the 5V pin to the + rail on your breadboard and another wire from the GND pin on the Arduino to the other long
rail on your breadboard.
Press the potentiometer into place. Run a wire from the power rail to the outermost pin, then another wire from the ground rail to the other outermost pin. Connect a wire
running from the middle pin to pin 3 on your LCD screen.
Run a wire from the gnd rail to the left-most pin on your LCD, then run another wire from the power rail to pin.
Now for the rest of the LCD connections:
Connect pin 4 to pin 12 on your Arduino
Connect pin 5 to pin 11 on your Arduino
Connect pin 6 to the GND rail.
Connect pin 11 to pin 5 on the Arduino
Connect pin 12 to pin 4 on the Arduino
Connect pin 13 to pin 3 on the Arduino
Connect pin 14 to pin 2 on the Arduino
Connect pin 15 to the GND rail
and finally, Connect pin 16 to the power rail.
Now to the buttons. The process can be repeated 3 times, the only difference is where the data pin goes.
Connect the power rail to one leg of the button, then on the 2nd leg, run a data wire to pin 7 on the Arduino. On that same leg, run a 10k ohm resistor to the GND rail.
Repeat the process 2 more times, running the data wires to pins 8 and 9 on the Arduino, respectively
Press the temperature sensor into the breadboard.
With the flat side facing you, run a wire from the power rail to the left-most pin, run a wire to the GND rail on the right most pin, and run a final wire from the center pin to
pin A0 on the Arduino.
Press a LED into place, with the long leg pressed into pin 13 on the Arduino.
Double check all of your connections, comparing it to either the text above, or the photo above.


Download 1.08 Mb.

Share with your friends:
1   2   3   4




The database is protected by copyright ©ininet.org 2024
send message

    Main page