Introduction: 2.4 TFT Arduino Weather Station With Multiple Sensors
A portable Arduino weather station with a TFT LCD and a few sensors.
Step 1: The Story
Recently i had a little free time to play with arduino.
Found a sketch on the internet a few months ago with a TFT LCD with a DHT sensor and a RTC. So i wired it up, made some modifications to the sketch to work. After uploading it was working terrible!! So after 4 hours i realised it is pointless to suffer with it. I thought i will make a weather station for myself that i will use at my home.
Let's start!
Step 2: Parts Needed
The parts needed:
- Arduino uno or Mega2560 (already had)
- 2.4 tft lcd with Ili932x or 9341 IC (already had)
- DHT11 (already had)
- DS18b20 (already had)
- A 4 pin light sensor LDR (analog and digital)
- Some jumper wires (already had)
- Arduino IDE and the correct libraries
So at this time it was no cost for me.
Step 3: Hardware Setup
Well it was no big deal. The chinese Arduino clones are not always bad. When the board has a second line where you can solder the pins, that makes a bit more moving space with the wiring.
So i soldered the pins the opposite way (to look down) to make job easier. See the photo.
At this moment we got 3 5V , 3 3.3 V and a couple of GND pins.
You can now connect multiple sensors to the board this way.
The DHT sensor is connected to Digital 11.
Temperature sensor is connected to Digital 10.
LDR is connected to Analog 5.
Digital 12 and 13 is free. So you can still add 1 sensor if you want. (I want)
Because of the LCD no I2C sensors can be connected to the board. Lcd needs the A4 pin for RESET.
Sad, but true.
Step 4: Software
Download the libraries and the sketch.
I am uploading the libraries for this project.
The SPFD5408 library is very good to drive our 2.4 TFT lcd, but i think it is only good for ILI932X ;9340 ; 9341 IC.
2019.01.05.!!
A Small update! Now the Arduino is displaying the dew point!
The heat index is displayed both Celsius and Fahrenheit.
2019.01.06!!
The Mcufriend version is now reporting the values to the Serial monitor.
Step 5: Let's See What We Have Made
Our Arduino is diplaying the values from the sensors with 1000ms update rate.
What we see:
- The temperature from the DHT sensor in the ring meter
- Humidity on the upper right corner
- Temperature from the DS18B20 sensor
- Heat index in Fahrenheit
- Light intensity in percentage (still a bit buggy)
- Temperature in Fahrenheit
- Dew point in Celsius
- Absolute humidity calculation
But! We still have 2 digital pins free, so there is still room for a little improving to maximize the capabilities of our Arduino board.
I am planning a few (and visual) upgrades to this weather station in the near future to make it work and look better. As soon as i have enough free time of course......
The 3rd version is for McuFriend compatible displays. I had a 1580 and 5408 IC driver display which i did not use for almost 2 years. So i made some modification to work with them. I uploaded my modified McuFriend library.
Step 6: Compiling Errors
Recently i am having compiling errors with Arduino IDE (and not just me). This is an often returning problem.
If you have a compiling error with this sketch please copy it out to a new Arduino window and try again.
This works for me, hope it will for you too.
Because of the ESP Core i am still sitting on Arduino IDE 1.6.13.
Why not upgrade? Just because this version is very convenient for me.
Step 7: Done!
You are done.
Use it as you like.
Thanks for reading my instructable.
37 Comments
6 months ago
I am very thankful to the author for posting a great temperature display
Question 2 years ago
Hallo, leider vermisse ich den Schaltplan.
2 years ago
hi can you help me in updating the ui ?
i got only lines i tried running v6
but its not comming full screen and i can also see previous code's ouput
can i get the graphics like you please ?
my email. readgear400@gmail.com
thanks in advance and i really loved the project
Reply 2 years ago
I will send it to you ASAP.
Question 2 years ago
Hello, I made this great project, too, thank you. But on the display I only see seven lines and not the graphic surface. I have not yet connected the sensors, is this the reason?
How can I change the look of the display?
Answer 2 years ago
It is the V6 sketch with the ringmeter.
3 years ago
Hi ! Thanks for this great project. It is working fine. But, I want to add Rotor encoder to know wind direction & a DC motor to measure wind speed. Pls. suggest how to do it. I a beginner.
Reply 3 years ago
Hello!
Well i don't have much experence with the rotary encoder, because i don't use it. The first advice i can give is this instructable:
https://www.instructables.com/id/8-Bit-Digital-Weather-Vane/ As i see wind direction is measurable with it.
It is possible to measure wind speed with a DC motor i think but not sure.
Pls take a look for example:
https://www.hackster.io/achindra/diy-anemometer-wind-speed-sensor-device-84a2e3
https://www.instructables.com/id/Easter-Egg-Anemometer-Wind-Speed-Meter/
Basically it is an analog reading process. The approx wind speed / dc motor rpm and generated voltage /current/ .
To be honest i did not think of this before :/
Question 3 years ago
Thanks for the great project, I am in the process of building it but I am getting a mirrored screen on both of the V6_Dew_Point. Any info on how to fix this would be appreciated.
Answer 3 years ago
What is the driver IC of the Lcd you use?
I think it is the first logical suspect.
Sorry for the late response 🤔
Reply 3 years ago
Thank you for your response, I ran LCD_ReadReg sketch from MCUFREIND_kbv library and with a little research I believe I have a ILI9340.
Reply 3 years ago
This is what i ment.
Reply 3 years ago
Can you please share the sketch on my email id ? My email ID is - vrpsia@gmail.com. Thanks.
Reply 3 years ago
Hello!
Do you mean the sketch for the Esp32 in the picture above?
Reply 3 years ago
Than i suggest that you should replace with tft.begin (0x9340); or 9341. If it does not solve your problem i will try to investigate it. I have ili9340 controller LCD as well, but the only issue i had was inverted colors. My other lcd with this controller with ili9341 settings operates like a charm. Waiting for your reply.
Reply 3 years ago
Hope this helps. (0x9341) is the only one that gives me anything, I tried changing tft.begin (0x9341) to tft.begin (0x9340), and all the other suggested numbers in the sketch and all I get is a white screen with those other numbers. Thank you, let me know if anything else is needed that will help get this solved.
Reply 3 years ago
First idea: Pls try to change tge screen rotation :)
Reply 3 years ago
It rotates fine(1-4) but all are still mirrored.
Reply 3 years ago
Pls try to edit SPFD5408_Adafruit_TFTLCD CPP file.
This part
writeRegister8(ILI9341_SLEEPOUT, 0);
delay(150);
writeRegister8(ILI9341_DISPLAYON, 0);
delay(500);
// *** SPFD5408 change -- Begin
// Not tested yet
//writeRegister8(ILI9341_INVERTOFF, 0);
//delay(500);
writeRegister8(ILI9341_INVERTOFF, 0); Pls uncomment this line like this, save it and give it a go.
This is the best idea i have.
Reply 3 years ago
That unfortunately did not do the trick, but thank you for your help and its still an awesome project that I will be building. Thanks again.