loading
Guys, I wanna share my weekend project on creating a clock with humidity and temperature sensor,
It's using DHT11 sensor, RTC DS1307, LCD 16x2 and Arduino Mega 2560,

Keep reading and good luck

Step 1: Prepare All the Parts Needed.....

In this experiment I need to use this parts :

1. Arduino Mega 2560 board
2. RTC DS1307
3. LCD 16 x 2
4. DHT11 sensor
5. 4K7 Resistor
6. 10K trimpot for LCD brightness

Step 2: Connection to Arduino Board :

Here's the connection to arduino board :
//init DHT11 sensor
#define DHT11_PIN 6

// Init the DS1307
DS1307 rtc(20, 21);

// Init the LCD
//LiquidCrystal lcd(22, 24, 26, 28, 30, 31);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

Step 3: The Main Loop for Displaying .....

Here's the main loop for displaying, I used Arduino 022..

void loop()
{
  // Display time centered on the upper line
  //lcd.setCursor(4, 0);
  //Read the temperature and humidity
   int chk = DHT.read11(DHT11_PIN);
  lcd.setCursor(0, 0);
  lcd.print(rtc.getTimeStr());
  //Read temp sensor
   double temp = Thermister(analogRead(0));  // Read sensor
   //Read Humidity
   //DHT.humidity,1
   //Read Temperature
   //DHT.temperature,1
   //print screen
   lcd.setCursor(9,0);
  //lcd.print(temp);
   lcd.print(DHT.temperature,0);
   lcd.print("C");
  //Display Humidity
   lcd.setCursor(13,0);
   lcd.print(DHT.humidity,0);
   lcd.print("%");
 
  // Display abbreviated Day-of-Week in the lower left corner
  lcd.setCursor(0, 1);
  lcd.print(rtc.getDOWStr(FORMAT_SHORT));
 
  // Display date in the lower right corner
  //lcd.setCursor(6, 1);
  lcd.setCursor(3, 1);
  lcd.print(",");
  lcd.setCursor(4, 1);
  lcd.print(rtc.getDateStr());

Step 4: Test and Enjoy My Project.....

Test and enjoy my project.....
Let's watch the video...


Thanks for reading and good luck for your experiment.....
<p>use </p><p>lcd.print((char)223); //degree sign<br> lcd.print(&quot;C&quot;); to display degree C ;)</p>
Hi, Very nice project. Keep up. Can you please help me too? Based on this instructable : https://www.instructables.com/id/Environmental-Mushroom-Control-Arduino-Powered/ I have an arduino code written by anthony to control relays for humidifier and heater used with sensor dht22. can you modify the code to use with sensirion sensor - sht75? Thank you.
How could we connect LCD's connection to Arduino? How; that you didn't show us.
is there a place that we may get the code?

About This Instructable

19,743views

61favorites

License:

More by arick:2cm height 7 Segments 6 Digits AVR Clock  with 4 digits thermometer  Speaking clock with AVR DIY Online Bulb Controller 
Add instructable to: