Arduino TFT Forecast Weather Station With ESP8266

85K20433

Intro: 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)

33 Comments

Hello, would a Tft 2.4 Display - Shield - Touch Screen - Colorful work?
Which could be used instead of the Dallas 18b20 one wire temperature sensor, DHT22 or another? Would you change the code? Thanks
how can I preview the icons on a computer?

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

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

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?

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.

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 ?

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?

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.

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.

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

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

<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 =\

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.

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?

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.

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?

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?

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.

More Comments