Light/temperature Sensor

6,303

38

16

About: My name is Zach Sousa and I'm a Canadian highschool student that has a passion for making.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Parts and Tools

These are the parts and tools needed to make this project:
Thermistor
Arduino
LCD(16x2)
LDR (light dependant resistor)

Step 2: Place Parts on Bread Board

Place your LCD on the breadboard and place the LDR and the thermistor near the LCD.

Step 3: Wire 5 Volts

Wire the 5 volt rail on the breadboard to 5 volts and connect either side of the LDR to the 5 volt rail and connect a side of the thermistor to the 5 volt rail as well.

Step 4: Connect Sensors to Analog Pins

Connect the LDR to analog pin 0 on the arduino and connect the thermistor to analog pin 1 on the arduino.

Step 5: Connect Ground Rail and LCD

Wire the ground rail on the breadboard to the ground pin on the arduino. Now we connect the LCD to the arduino. Use the picture to wire the LCD pins to the arduino. Instead of using a potentiometer you can just wire the ground pins(gnd and r/w) can go directly to ground.

Step 6: Upload Code

Upload this code to your arduino:

/*
LiquidCrystal Library - Hello World

Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.

This sketch prints "Hello World!" to the LCD
and shows the time.

The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/LiquidCrystal
*/

// include the library code:
#include
int light = A0;
int temp = A1;
int tempValue = 0;
int lightValue = 0;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
pinMode(light, INPUT);
pinMode(temp, INPUT);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.

}

void loop() {
tempValue = analogRead(temp);
lightValue = analogRead(light);
lcd.print(lightValue);
lcd.print(tempValue);
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);

}

Step 7: Test

Your LCD now should have sensor values on it
Thank you for viewing this instructable and if you liked it vote for it In the full spectrum laser contest or favorite.

Be the First to Share

    Recommendations

    • CNC Contest

      CNC Contest
    • Make it Move

      Make it Move
    • Teacher Contest

      Teacher Contest

    16 Discussions

    0
    None
    Zach SousaAkin Yildiz

    Reply 4 years ago on Introduction

    No I did not use a specific plant for it. A circular piece of black acrylic goes where the hole is at the top and I have cut outs for the arduino in the back.

    0
    None
    Zach Sousa

    4 years ago on Introduction

    Okay I will keep you updated. Feel free to ask any questions. I can design the laser cut wood case tommorrow. How should we post it? Would you like to post it as your account or mine? Either way both your name and mine will be on it.

    3 replies
    0
    None
    Akin YildizZach Sousa

    Reply 4 years ago on Introduction

    let's do it under your account, it was your idea. we can do it under mine next post.. and I will let you know about how my lcd screen turns out. I am planning on soldering it today and try again, hopefully the screen is functional. talk to you soon

    0
    None
    Zach SousaAkin Yildiz

    Reply 4 years ago on Introduction

    Oh, I forgot to ask what would you like to do? Just tell me what you would like to do and I can get everything sorted.

    0
    None
    Akin YildizZach Sousa

    Reply 4 years ago on Introduction

    we need to be able to read values on the screen. temperature (ntc), light (ldr) and soil water levels (nails). and scroll through them with the knobs on the front. the plant pot can be set on top of the planterbot box. on the side of the box we can have a usb connection to the sensors. please check out the sensory device if you haven't done so yet. I can make 1-2 of these and send them to you if you want.. also there needs to be a usb connection to the arduino as well, for easy access to reprogram. and eventually add a wifi module to save the data online and e-mail the user when it is thirsty or cold..

    IMG_7564.JPGIMG_7573.JPGIMG_7575.JPGIMG_7580.JPG
    0
    None
    Akin Yildiz

    4 years ago on Introduction

    it was the non-soldering the issue, also if you don't have a potentiometer you may never see the letters because the screen is too dark, you have to adjust it pretty sharply. I think we should just keep progressing on this comment bar too. so everyone can see how everything came together :)

    20141016_170047.jpg20141016_181444.jpg
    1 reply
    0
    None
    Zach SousaAkin Yildiz

    Reply 4 years ago on Introduction

    Great! Glad it was just the non-soldering issue. I think that it is a good idea to keep posting on this instructable too. I will finish the laser cut design tonight and cut it at my local makerspace as I am going there tonight anyway. I will probably post a comment again tonight to show off the case design.

    0
    None
    Zach Sousa

    4 years ago on Introduction

    Everything looks good with the code. Would you like to do a collaboration instructable? I have access to a laser cutter... I have been working on something like your project but with a laser cut case. Here is a quick design of it:

    Screen Shot 2014-09-08 at 8.49.10 PM.jpg
    2 replies
    0
    None
    Akin YildizZach Sousa

    Reply 4 years ago on Introduction

    I would be honored to do a collaboration. that design looks very nice and i love the name. how big is that box? is that a 16x2 lcd on it? were you thinking of placing the plant pot on top of the box? also what about the sensors, were you thinking about something like the sensory device I have created..?

    .

    your box looks like an upgraded, digital version of the plant shelf :) let me know what exactly you had in mind. I would love to install the LCD screen data module to the plant box as well. and add buttons to scroll between the temperature, water, light + humidity levels...

    collage3.jpg02.jpg
    0
    None
    Zach SousaAkin Yildiz

    Reply 4 years ago on Introduction

    The dimensions are about 100mm x 100mm x 38mm (4" x 4" x 1.5") and that is a 16x2 lcd. I was thinking about having it enclosed in a acrylic case (possibly black acrylic) or balic birch plywood.