The idea of the final project is to integrate all what we have learned during this course. For this we are required to make a small weather station with a display and inclosed in a casing or a box.
-Microcontroller or microcontolled board for example SatshaKit.
-DHT11 Humidity and Temperature Sensor.
-BMP180 Barometric Pressure Sensor.
-LCD Display 12864B.
-Switch R13-66A3-02.
-9V Battery .
-Box.
I started by making the box after taking the measurments of all the system components.
I decided to go with the dimensions of 8*10*6 cm.I also added an opening for the lcd screen.
For the corners I plan to draw them in Draftsight and then import them to FreeCad as I did before in the 3D design and printing project. This is how they look.
I used Cura to slice the model
Here are the settings for Cura:
Layer height 0.15 --> As very high quality is not critical for this.
Wall thickness 1
Top/Bottom thickness 1
Infill denisty 25%
Print speed 70
Travel speed 150
Support placement Touching build plate
Support Pattern Grid
Support Denisty 25% --> I could have gone with less than this but since it was too little supports it didn't make much of a difference in printing time.
Support Z Distance 0.3
Support X/Y Distance 1
Build Plate Adhesion Type Brim
Brim Width 5
Here are the settings for the laser cutter:
Power 100
Frequency 100
Speed 5
This is how all the parts of the box look like.
This is how it looks after assembly. Because of the accurate kerf it was perfectly fitting so I did not have to use any glue to hold the parts together.
Microcontroller:
I will be using my version of SatshaKit which is similar to Arduino Uno in performance as a brain for this project.
Display:
Display 12864B V2.0.
-Here is the pinout for it.
-Here is a test code
-Here are some more information
Here is the output:
Sensors:
Temperature and humidity sensor: DHT11
-The DHT11 has three lines: GND, +5V and a single data line. For example in the picture shown GND should be connected to the right most pin, the signal line should be connected to the left most pin and the +5v should be connected to the middle one.
-Here is the test code
-And here are all the information about the sensor you could possibly need
Here is the output:
After blowing the sensor:
Barometric Pressure sensor: SparkFun BMP180
-This is how to connect it
-Here is the test code
-And here are all the information about the sensor you could possibly need
Here is the output:
Power:
Thanks to the voltage regulator circuit on the board I can connect it directly to 9v battery.
I will be using Arduino IDE to develop the code for this project.
I started by trying to test each of the system components using a single sketch for each and then integrating all of them into one final code.
throughout this project we will need to add a lot of libraries so I figured it would be better to explain it once rather thank doing it for each library.
Adding libraries
This is how to do it for example for the DHT11 Sensor
-First step is to download the .zip file of the library.
-Second step Open the Arduino IDE go to sketch, Include library and then click add .zip.
-Final step Go to where you downloaded the file choose it and click Open.
Integrating the code
While integrating the code I noticed the issue that the display can only display characters so all of the sensors output which are double values should be changed to a string and this string should be saved in a character array to be displayed by the LCD.
From double to string
I found a function on the internet to make this conversion and this is the code.
String to characters
There is a function already existing in Arduino to do this all you need to do is to define a character array to store the characters in as a buffer until they are displayed.
One other issue is that I was getting false values for both pressure and altitude.
Negative pressure
This is because the pressure output of the sensor was in millibar this value is too large to be stored in a character array element so the easiest solution was to divide this value by 1000 and display the pressure in bars instead of millibars.
False altitude
I was getting unstable readings for the altitude in meters once I changed to feet by multiplying 3.28084 I got more stable values probably this is because the other values were too small.
Here is how the system looks before putting it inside the box.
And here is everything.
Here is a video of the station working: