2.4 TFT Arduino Weather Station With Multiple Sensors

10,427

23

35

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.

Be the First to Share

    Recommendations

    • Battery Powered Contest

      Battery Powered Contest
    • Plywood Challenge

      Plywood Challenge
    • Plastic Contest

      Plastic Contest

    35 Discussions

    0
    Kishan Hebbar ModsM
    Kishan Hebbar ModsM

    5 months 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

    0
    Lacybad
    Lacybad

    Reply 5 months ago

    I will send it to you ASAP.

    0
    resimail12
    resimail12

    Question 6 months 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?

    0
    Lacybad
    Lacybad

    Answer 6 months ago

    It is the V6 sketch with the ringmeter.

    1
    vrpsia
    vrpsia

    7 months 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.

    Weather Station.jpg
    0
    Lacybad
    Lacybad

    Reply 7 months 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 :/

    0
    js.sqw81
    js.sqw81

    Question 1 year 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.

    0
    Lacybad
    Lacybad

    Answer 1 year ago

    What is the driver IC of the Lcd you use?

    I think it is the first logical suspect.

    Sorry for the late response 🤔

    0
    js.sqw81
    js.sqw81

    Reply 1 year 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.

    0
    Lacybad
    Lacybad

    Reply 1 year ago

    This is what i ment.

    IMG_20191030_070532.jpgIMG_20191030_070607.jpg
    0
    vrpsia
    vrpsia

    Reply 7 months ago

    Can you please share the sketch on my email id ? My email ID is - vrpsia@gmail.com. Thanks.

    0
    Lacybad
    Lacybad

    Reply 7 months ago

    Hello!

    Do you mean the sketch for the Esp32 in the picture above?

    0
    Lacybad
    Lacybad

    Reply 1 year 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.

    0
    js.sqw81
    js.sqw81

    Reply 1 year 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.

    IMG_3359.jpgIMG_3360.jpg
    0
    Lacybad
    Lacybad

    Reply 1 year ago

    First idea: Pls try to change tge screen rotation :)

    0
    js.sqw81
    js.sqw81

    Reply 1 year ago

    It rotates fine(1-4) but all are still mirrored.

    0
    Lacybad
    Lacybad

    Reply 1 year 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.


    0
    js.sqw81
    js.sqw81

    Reply 1 year 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.

    0
    Lacybad
    Lacybad

    Reply 1 year ago

    I am very sorry that i could not help you. Thank you for the kind words. Hope you will have sucess with another lcd. I had made a very similar setup with BME 280 sensor. If you ever need it pls let me know.

    0
    a0905570965
    a0905570965

    Question 9 months ago

    sorry can I ask you how do you solve the flicker when the TFT screen is update?