Arduino LCD Photoresistor

by petersone in Circuits > Arduino

425 Views, 1 Favorites, 0 Comments

Arduino LCD Photoresistor

Screenshot_20221214_012343.png
Screenshot_20221214_012617.png
Screenshot_20221214_012722.png

This Simple Arduino LCD photoresistor can be used for many things. For example I used it to let people know what the name of a room was and if it was open or closed if you couldn't tell. It was able to let you know if it was open or closed all based off of the light levels coming from that room. If it was dark it would print to the LCD monitor that it was open and if it was light, well you guessed it, it would print to the LCD closed. Based off of the easy 7 step instructable I have made you should be able to make this in no time.

Supplies

Screenshot_20221214_013049.png

In order to make this on tinker cad all you will require is a working computer with the ability to have a USB plug in and access to google.

Getting to TInkercad

Screenshot_20221214_014030.png

Step 1 In order to start this project your going to need to get a computer probably the one your on should work and your going to go to tinkercad. https://www.tinkercad.com/circuits.That is the link to get to the circuits page which is where your going to need to get in order to start designing and messing with the Arduino. Once your there your going to want to make an account and then from there on your going to want to get to where it says "+ New" Your going to click that and then click CIRCUIT. You have then arrived in the black tinkercad page that should like the picture above.

Getting the Pieces in Place

Screenshot_20221214_014554.png

Once you have completed the steps above your going to want to click on starters and then a drop down menu should appear. Once that menu is there you should click on Arduino and then scroll down to the starter that is labeled " LCD". Your then going to want to click on that and then from there your going to want to bring your mouse over to you blank canvas and click on the screen tp where you want your Arduino LCD to be placed. You can then adjust it to however you would like it and where it looks good.

Setting Up the Breadboard

Screenshot_20221214_015032.png

You know have the basics of the Arduino LCD placed onto your canvas. You are now going to want to click the drop down menu again and click on the components tab labeled "All". Your then going to want to either search "Breadboard" or just scroll down to the white board labeled breadboard. Your going to want to place that onto your canvas adjacent to your Arduino.

Setting Up the Photoresistor

Screenshot_20221214_015522.png

Your now going to scroll up to your components again and find a resistor and a photo resistor your going to want to place them onto the board exactly as how they are placed in the image above. Your then going to click on the photoresistor and go into the upper right hand corner and where it says resistance and your going to type in 4.70.

Equipping the Wires

Screenshot_20221214_015750.png

Now that you have the simple parts done your going to start with the wiring. Your going to want to follow the wiring steps exactly as they are done in the image above. The color of the wires doesn't matter you can change them to any color you want you can also change the location of the breadboard and LCD depending on how you want it to look.

Completing the Coding

Screenshot_20221214_020345.png
Screenshot_20221214_021737.png
Screenshot_20221214_021718.png

The coding is probably the hardest part of this if you don't know what your doing. So your going to start off with going to the coding tab and changing the first block "On Start" to the first image above. Your going to find those extra pieces in the coding tab labeled "Output". Next your going to go to the output tab find the block labeled "Print to serial monitor ---- With newline" Your going to put that at the top of the forever yellow block. Your going to next go to input and click on the block saying "read analog pin A0" your going to put that block where it says "hello world". Your then going to complete the rest of the coding based off of the second image. I will also explain most of it here. You will be able to find all of the blue blocks in the tab labeled "Output". All of the yellow blocks in the tab labeled "Control". Once you have reached the part where you are required to add in green and yellow blocks you may be confused. What your going to do is click on the tab labelled "Math" and your going to drag the block that looks like the third image into the "IF" spot in the yellow block. Your then going to get another purple block from the "Input" tab. Your going to put the block that says "Read analog pin A0" into the left side of the math block. The number on the right side of the math block is the sensitivity of the photoresistor the lower you go the less sensitive it will be. Your then going to complete the rest as following the second image.

Finalizing Your Arduino LCD

Through out the code you will notice spaces you can type words In my example I used words like Bathroom and open and close which is what I was using this for. To tell if the bathroom was open or closed based off of the light level in the room. Whatever you are going to or use this system for rather if its just for fun or for an actual purpose you can change those words in relation to what they are used for. Like you can change bathroom to Classroom or other stuff like that. Your final project should look like the images in the beginning of the instructions.