Making Code for Weather Station
-
Hi,
I'm new to the mysensors community and have a question about compiling the needed code.
I have ordered several parts to make my own Weather Station:
Serial Gateway:
- Arduino Nano USB V3.0
- NRF24L01+ Wireless Tranceiver
Weather Station:
- Pro mini Arduino 3.3V
- BH1750FVI Digital Light Intensity Sensor
- BMP085 Digital Baromatic Pressure Sensor.
- DHT22 Digital Temperature and Humidity Sensor
- Rain Weather Module Detection Sensor
Later on I would like to add a Wind sensor to make the weather station complete.
I can see on the forum and website that there are several codes for the sensor. But what to do when you will connect all the sensors together?
Thnx for the help so far.
Greetings Brutus.
-
@Brutus Hi Brutus, welcome to the forum. You need to take the different sketches and combine them into one sketch. Sometimes this is not straight-forward as certain sketches are designed for the sensor to go to sleep for a period of time, some, like the DHT22, can only send data periodically, etc. If you search the forum, others have posted details about their weather stations, so you can check those first and potentially use their sketches as starting points. If you run into issues with your own sketch once you have developed it, post it here and the board members will jump in and try and help out.
Cheers
Al
-
I have already merged the sketch for a dht-22 and a bmp085 sensor. You can take the sketch as a starting point
https://github.com/windkh/mysensors/blob/master/WeatherStationSensor/WeatherStationSensor.ino
Always have look at the memory consumption of your sketch. Merging too many sketches into one will eat up your memory very quickly.
-
Here is some imspiration from my weather-sensor (without rain though): My outdoor weather sensor
-
@sundberg84 nice project. I noticed that the code in your weatherstation makes use of the buggy forecast algorithm. You should update your sketch to have reliable data in future.
-
THanks. I din but forgot to update the post.
-
Thnx guys for all your answers.
I will look into the possibilities to merge some sketches.
@Heinz Most people use less sensors then I will do. U think that it will not fit on the Arduino Nano ?
Greetings.
-
@Brutus
Yes, memory on the nano is limited. I already ran out of memory when merging ketches, but fortunately the compiler tells you that at compile time.