Introduction: Arduino TFT Forecast Weather Station With ESP8266

This project, builds on Wunderground weather forecast via the Internet.

Specs:

1. 3 days weather forecast (Low&High temps, probably of precipitation, condition icons)

2. Current weather conditions (Current temp, feelslike temp, humidity, pressure)

3. Current wind directions & speed with analog gauge meter.

4. Indoor temperature with Dallas 18b20 Temperature sensor.

5. NTP time via Wunderground time server.

Step 1: Materials:

1. Arduino Mega 2560,

2. 7" inch TFT display (I used this display Ebay Link )

3. TFT/SD shield (I used this shield Ebay Link )

4. ESP8266 Serial WiFi module,

5. Logic level converter or use voltage divider. ( Sparkfun Link )

6. Dallas 18b20 one wire temperature sensor.

7. 40 pin Male to Female Ribbon cable (Ebay Link )

8. For 7" LCD case. Maybe use this or another case. (Ebay Link )

9. 256mb to 2gb(maximum) SD card for icon storage. (Must be FAT16 formatted).

10. 9v or 12v power supply or usb cable for power connection.

11. Some wires and soldering iron.

Step 2: Connections :

Connections we make, as shown in picture. After making the connections, we are installing a TFT/SD shield.

I use voltage divider instead of logic level converter. But I would definitely recommend using logic level converter.

Step 3: Lcd Brightness Control (If You Want to Skip This Step!)

CAUTION : May damage the TFT Screen. If you dont want to change the brightness, skip this step.

Remove the resistor of LED_A.

Connect cable as in the picture.

And connect Arduino pin 12 (must be connect PWM pin).

Step 4: Icon Files and Libraries

Necessary libraries :

Henning Karlsen UTFT Library - Link

Henning Karlsen TinyFat Library - Link

Henning Karlsen UTFT_TinyFat Library - Link

Time Library - Link

Timer Library - Link

OneWire Library - Link

Dallas Temperature Library - Link

ArduinoJson Library - Link

Unrar Icons.rar file and copy files to "SdCard" root folder.

Step 5: Sketch File Modifications

First of all edit sketch file for your information :

SSID "Your Ap Name" - For example SSID "Tufan_Home"

PASS "Your AP password" - For example PASS "1234567890"

LOCATION ID "Your location name" - For example LOCATION ID "England/London"

GMT Settings this line : "ntpTime = ((longConv) + 7200);" //7200 = +7200 secs = +2 Hour ;)

If you have connected TFT Brightness PWM pin, uncomment this line --- //analogWrite(tftPwmPin, 250);

Have fun!

Edit Note : (I have uploaded last updated files 28.01.2015)

Comments

author
SimonP99 (author)2016-11-13

I've tried to compile this with the latest IDE build and using the libraries linked and it is using a huge amount of dynamic memory - how can I reduce this to fit on a Mega ? Its using 150% of available dynamic memory

author
Benedito NelsonR (author)2016-09-05

Hello good project

author
ebola0 (author)2015-08-05

Very cool project, I can't wait till I get mine complete! I've got it all built (I used a 5" screen from the same supplier so it works with everything, same 800x480 resolution as the 7") but I'm not getting anything on the screen. When I hooked it up to the terminal I got continuous timeouts trying to connect to api.wunderground.com.

After investigating I found the ip address given was the problem and changed it to 38.102.136.138 and checked and that ip translates to api.wunderground.com but I'm still getting continuous timeouts when it tries to connect just as the previous poster experienced.

---------------------------- (I found turkish on your webpage so I translated this in hopes of a response)

Ben benim tam dönene kadar Çok güzel bir proje , ben can not wait! Ben ama ekranda hiçbir şey alamıyorum inşa tüm ( "Bu , her şeyi ile 7'ye aynı 800x480 çözünürlük çalışır , böylece aynı tedarikçiden ekranı " Ben 5 kullanılır) var. Ben terminale onu bağladım zaman api.wunderground.com bağlanmaya çalışıyor , sürekli zaman aşımına uğrayan var .


Araştırdıktan sonra ben verilen ip adresi sorun bulundu ve 38.102.136.138 bunu değiştirdi ve kontrol ve o ip api.wunderground.com çevirir ama önceki poster deneyimli gibi bağlanmaya çalıştığında ben hala sürekli zaman aşımına uğrayan alıyorum

author
tufantas (author)ebola02015-08-06

Thanks for the Turkish language ;) I will try to solve the problem as soon as possible to examine. Would you send messages in the serial window?

author
ebola0 (author)tufantas2015-08-08

Unfortunately, I can't. I'm not getting the timeout issue anymore but I'm still not seeing anything on the display. I think it's having an issue with my network.

I'm powering the arduino off of an adjustable output ac adapter at 7.5V. When it's connected just to the adapter the blue led on the esp8266 is on (indicating that it's connected from what I understand). I've assigned a static IP address to the mac address of the esp8266 and when I monitor it I get confusing info... I see a very large number of ARP requests but they are all getting dropped by the firewall because of a null source ip address. I'm not very great at coding but it doesn't look like the esp8266 is getting an ip address or anything via dhcp and is getting rejected by the firewall?

I can't do anything with the terminal as when I connect the usb cable to the arduino the blue led on the esp8266 goes out. I'm guessing when I plug in the usb cable that it can't power the screen and the esp8266 off of the (powered) usb hub that it's connected to. I'm not sure though, is the serial monitor using the same uart as the esp8266 or am I confusing things?

In both scenarios I can see the screen powered on by the slight glow of the backlight but nothing ever comes up on it. I know the screen works as I ran the demo from the library and it displays just fine.

--------------------------------------------------------------------------

Ne yazık ki, ben yapamam. Artık zaman aşımı sorunu alamıyorum ama hala ekranda hiçbir şey göremiyorum. Ben benim ağ ile bir sorunu yaşadığını düşünüyorum.


Ben 7.5V bir ayarlanabilir çıkış AC adaptör kapalı arduino güç var. Sadece mavi esp8266 led adaptöre bağlı olduğunda (ben anladığım kadarıyla bağlantılı olduğunu gösteren) üzerindedir. Ben esp8266 mac adresi statik bir IP adresi atanır ettik ve ben kafa karıştırıcı bilgi almak onu izlemek ... Ben ARP istekleri çok sayıda görmek ama hepsi nedeniyle null kaynak güvenlik duvarı tarafından bırakılan alıyorsanız IP adresi. Ben kodlama çok iyi değilim ama esp8266 dhcp yoluyla bir ip adresi ya da bir şey oluyor ve güvenlik duvarı tarafından reddedilen oluyor gibi görünmüyor?

Ben mavi esp8266 led arduino için usb kablosu bağladığınızda olarak terminalden dışarı gidiyor bir şey yapamaz. Ben ekran ve bağlı oluyor (powered) usb hub kapalı esp8266 güç olamaz usb kablosu taktığınızda ben tahmin ediyorum. Ben seri monitör esp8266 aynı UART kullanan ya da ben bir şeyler kafa karıştırıcı duyuyorum, ama emin değilim?


Her iki senaryoda da ben arka ışık hafif kızdırma tarafından desteklenmektedir ekranı görebilirsiniz ama hiçbir şey üzerinde çıkageldi. Ben kütüphaneden demo koştu ekran çalışıyor ve gayet güzel görüntüler biliyoruz.

author
tufantas (author)ebola02015-08-09

Actually , even if the connection timeout, image on the screen should be . so we need to resolve this situation before . What were you doing compile with Arduino version ?

author
ebola0 (author)tufantas2015-08-09

1.65, now that you mention it, it wouldn't compile originally. I had to change homett.c and rain.c and refresh.c, they had I think prog_uint16_t for the array type and it was choking on that and I searched the web and found a quick 'fix' to change them to const uint. I'm guessing that's the issue here?

author
tufantas (author)ebola02015-08-10

Please try to compile Arduino 1.0.5 IDE (with the original files), i have not tested yet for 1.65. I think the problem will be fixed.

author
ebola0 (author)tufantas2015-08-10

Unfortunately it's still not working =( I compiled and uploaded it in 1.05 (no issues with the .c graphics files this time). It's still not displaying anything.

Just to verify, all that I changed in the code was putting in my AP, the pw for the AP, I changed the IP to the one I found for api.wunderground.com (38.102.136.138), and I set my location code to the one I found for my zip code (USAZ0166). I'm wondering if the location code is incorrect and that's keeping it from running?

I'm not seeing anything in the terminal window but when the usb is connected the blue led is off on the esp8266 but it goes on when I disconnect the usb and it's running off the AC adapter.

author
ebola0 (author)ebola02015-08-10

also, i have the 5" screen from the vendor but it's still the same 800x480 resolution as the 7", I really don't think that's the problem but I'm really not too sure

author
tufantas (author)ebola02015-08-11

If you are using Coldtears 5" , you must change the following line : "UTFT myGLCD(CTE70, 38, 39, 40, 41);" CTE50 should write instead CTE70 .

author
ebola0 (author)tufantas2015-08-13

<addendum> The arduino just completely gave up this morning but not before revealing the power to be the issue, namely the chinese board couldn't do it so I'm ordering a real arduino mega and will report back.

I unhooked the esp and powered it up on usb power and the display came to life showing the internal temperature just fine. When i reconnected the esp it started to get really hot and then I think something overheated or gave up because now the arduino is totally dead. Go Go China =\

author
Davero56 (author)ebola02016-02-16

You need a separate regulator for the esp8266 3v3 power as it draws much more current that the arduino 3v3 pin can supply hrnce the overheating of the on board regulator.search ou ams 117 3v3 800ma regulator on ebay.

author
ebola0 (author)Davero562016-02-17

that makes perfect sense, I have an ld 33v that I'm pretty sure is rated at 800ma. I hook that up to the 5v line on the Arduino mega, correct?

author
Davero56 (author)ebola02016-02-17

Connect to a 5v supply direct, dont rely on the 5v reg on the mega as that cant supply enough current either if you are using a raw higher voltage to the mega.

author
ebola0 (author)Davero562016-02-18

do i need to connect the ground on the esp (from it's power supply) to the ground on the arduino (powered via usb)? I'm not exactly clear on what to do with seperate grounds. If I'm powering the arduino from the same power supply do I need to have a wire connecting the grounds then?

author
ebola0 (author)Davero562016-02-18

do i need to connect the ground on the esp (from it's power supply) to the ground on the arduino (powered via usb)? I'm not exactly clear on what to do with seperate grounds. If I'm powering the arduino from the same power supply do I need to have a wire connecting the grounds then?

author
ebola0 (author)tufantas2015-08-12

I changed it to CTE50 as specified but still not working.

I just tried the 3.3v line for the esp8266 and nothing changed except the blue light on the esp started flickering as if it was having trouble drawing power so I switched it back to the voltage regulator and the 5v line.

Does it make sense that I'm not seeing anything, and I mean not a thing on the serial port? Why does the blue light on the esp8266 go out when I plug in the usb port?

The only thing different from when I first managed to get the timeout errors was the screen wasn't hooked up correctly and I don't think it was drawing power.

Could it be this arduino mega isn't a good clone? I got it off of ebay and for far less than the retail of a mega so I know its a knock-off. Should I think about replacing the mega? I've noticed this board gets really really hot over by the power pins.

author
FlipFlop (author)2015-10-05

I was not able to make this work with the Spankfun Logic Level Converter with the connection showed by the author so I contacted Sparkfun and this is the reply I got from them.

My Question:

FlipFlop wrote:

Are the connections to the logic level converter correct in the attached

pic? I bought 3 of your logic level converters form www.xxxxxxxxxxx.com in
Pakistan, so far I have tried one in this configuration and nothing
happens, no lights in the LLC and the esp8266 does not power up. If I
connect the same esp8266 with the Chinese version of the LLC both LLC and
esp8266 power up and I can see the esp8266 transmitting in my wifi analyser
app for android. Will your LLC work with only ground and no VCC connection?
Kindly help at your earliest.
Thank you
FlipFlop

Sparkfun's reply:

OCT 05, 2015 | 08:26AM MDT
Liz G replied:

Hello,

Thank you for contacting us! The Logic Level Converter also needs connections at the HV (Higher Voltage) and LV (Lower Voltage) pins so that it can accurately shift the signal levels. Without these connections, the board will not work as expected. So, in addition to the connections you have, you will need to connect the HV pin to 5V and the LV pin to 3.3V. For more examples and information about using the LLC, have a look at the Hookup Guide: https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide

Best regards,
Liz

Technical Support
SparkFun Electronics, Inc.
6333 Dry Creek Parkway
Niwot, CO 80503
E-mail: techsupport@sparkfun.com

author
ebola0 (author)2015-08-15

I got a new mega (genuine, definite differences) but still no luck. Is there any debugging lines I could enable or anything so I could get an idea of whats going on and how far it's getting?

It displayed properly once, it showed the gui layout and the indoor temperature registered properly too. (The esp8266 was unhooked at the time. This was on the old board)

author
вовап (author)2015-08-06

Thanks to good project

author
вовап (author)2015-08-05

Is it possible to converta sketch to screen 2.8 "?

author
tufantas (author)вовап2015-08-06

Yes it is possible but drawings need to be re-coded and replace pictures for different resolutions. I will soon prepare for different resolution versions.

author
ebola0 (author)вовап2015-08-06

I'm not certain but I think as long as it's compatible with the libraries and the shield I think you'd be ok but I'm not sure if all the graphics would scale with the different screen resolution. The 5" screen I got is the same resolution as the 7". The ebay seller with the screens and shield has a 2.8" screen here

http://www.ebay.com/itm/2-8-inch-TFT-LCD-module-32...

but I really don't know if it'd work or not?

author
вовап (author)2015-08-06

The display2.8 " image is superimposed

author
вовап (author)2015-07-12

What isthe firmwareused to ESP8266

author
tufantas (author)вовап2015-07-13

I used firmware 0.9.2.2

author
FlipFlop (author)2015-06-25

This needs more detailed explanation. Where does the other end of the 40 pin male to female connect? It would have been better if you had given more details on the libraries and icon files. Other than that it's a great project and I am going to try to build it with whatever limited instructions you have provided here. Thanks.

author
ta1dr (author)2015-02-04

Güzel bir proje olmuş başarılar...

author
tufantas (author)ta1dr2015-02-04

Teşekkür ederim.

author
EasyIoT (author)2015-01-29

Nice project. I'm building very similar project - ESP8266 touch screen thermostat with EasyIoT library, but your graphic display is nicer. I will look in your code to get some ideas :)

About This Instructable

61,418views

183favorites

License:

More by tufantas:Arduino TFT Forecast Weather Station with ESP8266
Add instructable to: