Project showcase
HomeLife Nightstand

HomeLife Nightstand

A night table with a weather station that displays the date and time.

  • 1,196 views
  • 1 comment
  • 6 respects

Components and supplies

Necessary tools and machines

colone drill.
Tap
hexagonal key
ripper
wood chisel

Apps and online services

About this project

I realized this project at the technical school of Lausanne. At the beginning I wanted to create an automatic cotton candy machine, but because of lack of financial means I had to restrain myself to a less ambitious project. Because of that and my passion for home automation I wanted to create a connected home system. Unfortunately I have to see my ambitions down again. Ainci I had the idea to create a bedside table connected... to the electrical network. It displays the time, date, room temperature and humidity.

Code

Date and time weather stationC/C++
Upload this cod on your Arduino and... Yeah
#include <DHT_U.h>
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>
#include "DHT.h"
#define DHTPIN 8 // broche ou l'on a branche le capteur
#define DHTTYPE DHT22 // DHT 22 (AM2302)
#include <Wire.h>
#include <ds3231.h>
#include <LiquidCrystal.h>

 LiquidCrystal lcd(12,11,5,4,3,2);
 
 struct ts t; //dclaration variable t
 DHT dht(DHTPIN, DHTTYPE);//dclaration du capteur
void setup()
{
 Wire.begin();
 DS3231_init(DS3231_INTCN);
 Serial.begin(9600);
 lcd.begin(16,2);
 lcd.setCursor(3,0);
 byte degre[8] = {
   0b00011,
   0b00011,
   0b00000,
   0b00000,
   0b00000,
   0b00000,
   0b00000,
   0b00000
};

 byte pourcent[8] = {
   0b11000,
   0b11001,
   0b00010,
   0b00100,
   0b01000,
   0b10000,
   0b00011,
   0b00011,
 };
 lcd.createChar(0, degre);
 delay(2000);
 lcd.clear();
 lcd.print("Bonjour  ");
 delay(1000);
 lcd.clear();
 lcd.setCursor(3,0);
 lcd.print("Allez-vous");
 lcd.setCursor(4,1);
 lcd.print("bien?");
 delay(2000);
 lcd.clear();
 lcd.setCursor(0,0);
 lcd.print("loading");
 delay(500);
 lcd.clear();
 lcd.print("loading.");
 delay(500);
 lcd.clear();
 lcd.print("loading..");
 delay(500);
 lcd.clear();
 lcd.print("loading...");
 delay(500);
 lcd.clear();
 dht.begin();
}
void loop()
{
 DS3231_get(&t);
 delay(500);
 
 // La lecture du capteur prend 250ms
 // Les valeurs lues peuvet etre vieilles de jusqu'a 2 secondes (le capteur est lent)
 float h = dht.readHumidity();//on lit l'hygrometrie
 float q = dht.readTemperature();//on lit la temperature en celsius (par defaut)
 // pour lire en farenheit, il faut le paramre (isFahrenheit = true) :
 float f = dht.readTemperature(true);
 
 //On verifie si la lecture a echoue, si oui on quitte la boucle pour recommencer.
 if (isnan(h) || isnan(q) || isnan(f))
 {
   Serial.print("</Pas d'information DHT22>");
   return; 
 }
 
 // Calcul de l'indice de temperature en Farenheit
 float hif = dht.computeHeatIndex(f, h);
 // Calcul de l'indice de temperature en Celsius
 float hic = dht.computeHeatIndex(q, h, false);
 
 //Affichages :
 lcd.clear();
 lcd.setCursor(0,0);
 lcd.print("Humidite:");
 lcd.print(h);
 lcd.print("%\t");
 lcd.print(" ");
 lcd.setCursor(0,1);
 lcd.print("Temp. : ");
 lcd.print(q);
 lcd.write(byte(0));
 lcd.print("C");
 delay(5000);
 lcd.clear();
 lcd.setCursor(0,0);
 lcd.print("Date:  ");
 lcd.print(t.mday);
 lcd.print("/");
 lcd.print(t.mon);
 lcd.print("/");
 lcd.print(t.year);
 lcd.print("    ");
 lcd.setCursor(0,1);
 lcd.print("Heure:  ");
 lcd.print(t.hour);
 lcd.print(":");
 lcd.print(t.min);
 delay(5000);
 
 
 
}

Custom parts and enclosures

Bedside table legs (4x)
The four largest parts of the chassis
plan_pied_1_K2ZWichkRW.dwg
Fixing brackets (little) (8x)
The brackets are used to fix the chassis and the Enclosure .
equerres_1_WeWd7gbo6B.dwg
Support
They connect the feet together to form the chassis
soutien_chassis_Oocy8ZE6WP.dwg
Fixing brackets (tall) (8x)
The brackets are used to fix the chassis and the Enclosure .
equerres_2_FiQWlYEJQc.dwg

Comments

Similar projects you might like

DHT11 Humidity + Temperature Sensor with 16x2 LCD display

Project showcase by onatto22

  • 22,132 views
  • 6 comments
  • 40 respects

Rube Goldberg Weather Station with Internet Data Storage

Project in progress by randtekk

  • 9,412 views
  • 7 comments
  • 48 respects

Display Current Weather with Arduino and Python!

Project tutorial by Arduino “having11” Guy

  • 8,400 views
  • 4 comments
  • 19 respects

Arduino Environmental Monitoring

Project showcase by Prajay Basu

  • 16,250 views
  • 1 comment
  • 28 respects

Temperature sensor

Project tutorial by Grant

  • 22,535 views
  • 6 comments
  • 37 respects

Air Surfer

Project tutorial by Anton

  • 35,599 views
  • 27 comments
  • 171 respects
Add projectSign up / Login