Introduction: Aurdino Weather Station
Ever wanted to make your very own Aurdino Weather station? Well, now is your chance! Through this instructable, you will learn the basics of how to build an Aurdino Weather Station as well as learn the code behind it. At the end of this project, you will have a fully-functioning weather station which is capable of sensing the temperature and humidity as well as manually blow a DC motor fan. This project will take anywhere from 45 minutes to 2 hours depending on your experience in engineering. Good luck and have fun!
Step 1: Gathering Materials
In this project, you will need the following items:
- Arduino Uno with cable
- DC Motor
- 1 Green LED
- 1 Red LED
- 1 Half Breadboard
- I2C LCD1602 display
- 3-Bladed Trifoil propeller fan for DC motor (Optional)
- Set of wires (preferably different colours)
- 1 DHT 11/ DHT 22 Humiture Sensor
- 1 Pushbutton
- 2 2.20 K resistor
- 1 10k Resistor
- A computer capable of running Aurdino Uno software
- Blade Knife
- Wire Cutter
- USB Power Bank (Optional)
- Box big enough to fit breadboard and Aurdino.
Most of these items are relatively cheap and are easily purchasable from online tech stores or eBay.
Step 2: Giving Power to Breadboard
Ensure all required materials are available and ensure a clean working space is available for you to work on.
The circuit we are about to build needs power and it is taken from the Arduino Uno.
Attach a wire from the +3.3V pin on the Arduino Uno to the positive rail on the Breadboard indicated by a red line. This means that +5V is now available from anywhere on the red line. Attach the negative or GND(Ground) to the blue line on the Breadboard. Now the ground is available on the entire blue line. To make the +5V and GND available on both sides of the Breadboard, use two wires to jump from one end of the Breadboard to the other end. Follow the diagram above to place the rest of the ground and power wires.
Step 3: Attach DHT11 and I2C LCD1602 Display
Attach a wire from Power of the I2C LCD1602 display to +5V pin of Arduino Uno and a wire from Ground of the I2C LCD1602 display to the ground pin of Arduino Uno. Then attach another wire from SDA of the I2C LCD1602 display to Analog pin A4 of Arduino Uno and a wire from SCL of the display to Analog pin A5 of Arduino Uno. Note that the display used in the diagram is not PCB mounted, therefore wiring will be incorrect for non-PCB I2C LCD1602 display.
Now grab the DHT 11 sensor, and attach a wire from the ground of DHT11 to ground pin on Aurdino. Attach a wire from the power of the DHT 11 to the power rail on the breadboard. Finally, attach a wire from the signal socket of the DHT11 sensor to Digital Pin 7. Note that on the diagram above, DHT 11 was not used instead TMP36 sensor was used. However, the wiring is identical to the diagram.
Our LCD and our Humiture sensor now work, with programming we can control how these will work together.
If you are confused on the wire placement, please refer to the diagram above.
Step 4: Connect LEDs and Pushbutton
Now that our display and Humiture sensor it's time to install the LEDs and Pushbuttons. The Pushbutton will control the DC motor. If the pushbutton is pressed then the DC motor will start running, as the DC motor is running, the Green LED will turn on, while Red LED will stay off. If the button isn't pushed then the Red LED will turn on while the Green LED will turn off.
Connect the cathode of the Green Led below the ground wire on A4 of the breadboard. Do the same with the Red Led by placing cathode under the ground wire on A10 of the breadboard. Now place the 2.2K resistor on the anode of the Green and Red LED.
Connect the pushbutton across the bridge of the breadboard as shown on the diagram above. Attach the 10k resistor under Terminal 2a of the pushbutton (bottom right pin). Ensure the end of the resistor is connected to ground wire as seen on the diagram above.
Step 5: Connecting Wires and Adding DC Motor
We are almost done wiring! Carefully connect a wire from the end of the Green Led resistor to Digital Pin 2 on the Aurdino. Similarly, connect a wire from the end of the Red Led resistor to Digital Pin 3 on the Aurdino. Now connect a wire from terminal 2b on pushbutton (top right pin) to Digital pin 4 on the Aurdino.
Now grab the DC motor, and place the positive end on terminal 2b of the pushbutton, right on top of the wire connecting to Digital Pin 4. Place the negative end of the DC motor on row 27, the row which is connected to ground.
The polarity of the motors doesn’t matter. The direction of rotation can be changed by programming.
Step 6: Clean Up and Organize Wires
Cut wires to appropriate lengths, and use appropriate colours for each wire. (Black wire for ground, a red wire for Power, Blue wire for digital pins). Using a black wire, tie up excess wire on the DHT11 sensor and I2C LCD1602 display like a zip tie. You should be able to access all the wires easily after this process.
Step 7: Upload Code Onto Aurdino
Download the Arduino Software on your computer from here. Open up the program and create a new sketch by pressing "Ctrl+N". Label this new sketch "Aurdino Weather Station". Download the Code below and paste it into your program. Plug the USB cable into your computer and into your Arduino. Now save the code by pressing "Ctrl+Shift+S" and press the upload button which is shaped like an arrow facing towards the right. Ensure that all necessary libraries are downloaded and installed ensure this program will work. (LCD library, DHT11 library)
Attachments
Step 8: Add Casing and Test
Using a box, cut out specific pieces to create a casing. The LCD Display will need a rectangular cut of (2 cm x 7cm) on the top of the box. Cut a hole on the left of the box large enough to fit a DHT11 sensor. Do the same on the right of the box to fit the Aurdino USB cable. Cut a hole large enough to fit a DC motor in any desired location, this will be the fan. Poke holes on the bottom side of the box for the Green and Red LED. Finally, create a hole in the box which is directly above the pushbutton. Using a pencil or a screwdriver press the button, from the hole made directly above the button, ensure that button is easily able to be pressed.
Now you are ready to test out the Aurdino Weather Station. Upload the code onto the Aurdino and let it run! The LCD should display the Humidity and Temperature. When the button isn't pressed the Red LED should be on. However, once the button is pressed the DC motor should be running as well as the Green LED.