Picture of Arduino

From the minds of http://arduinotronics.blogspot.com

UPDATE: Added our SpeakEasy Text-To-Speech (TTS) Shield to make this a "Talking" Weather Station!

UPDATE: Added a 4 port relay board for device control

UPDATE: Added Dew Point and Heat Index calculations

SainSmart sent me a 1.8" TFT LCD (ST7735R), and I decided to upgrade my Weather Station / Thermostat. This time around, I used the slightly less accurate but much less expensive DHT-22 (AM2302) temperature / humidity sensor. I also received a BMP-085 barometric pressure sensor, but it appears dead. More on that in the near future. Tighten your seat belt, and here we go:


Arduino Uno
10k Ohm Resistor
Relay Board (optional)
Male / Female Jumpers (very helpful)

Step 1: Connections

Picture of Connections

Connect the DHT-22 sensor and the LCD display as per the schematic. There are also connections on the left side of the display for the SD card, and we will address that at a future edit for logging purposes. Just use the connections on the right side of the display for now.


(S)ignal to Arduino Pin 2
+5 to Arduino +5vdc
G to Arduino Ground
10k Resistor between S and +5vdc

ST7735R LCD:

VCC to Arduino +5vdc
Gnd to Arduino Ground
SCL to Ardiuino Pin 13
SDA to Arduino Pin 11
CS to Arduino Pin 10
DC to Arduino Pin 9
Reset to Arduino Pin 8

blackcamo5 months ago

cheapest arduino stuff - please check https://sites.google.com/site/arduinouk/

c_droner1 year ago


I was having the same problem as madmoonfish was having, and I don't understand where to get the DHT library. If you could help me out, that would be great!

sspence (author)  c_droner1 year ago
Just updated the code page with the link to the DHT library, and fixed the 3 includes that did not paste properly.
peter6961 sspence8 months ago
can you please tell me what to include, sketch is saying error class tft has no member named background, stroke, text in various sections of t he code.
Ive installed the gfx amd st7735 libraries but im just not too sure how to make them work, the errors look like to not me, im missing a library or something! ? im not sure.
Please help!
Im going to use this for an automated greenhouse. :-)
my screen came in the mail today but all I get is a white backlight :-(
sspence (author)  peter69618 months ago

< and > symbols get dropped when pasting in the code. Went back and fixed.

#include <SPI.h>

#include <ST7735.h>

peter6961 sspence8 months ago
I forgot to ask, in the code for your screen I noticed your using BLACKTAB witch is the S version, but you talk about using the R version witch is the screen I ordered wich is GREENTAB I think there is also a BLUETAB version that they sell.
do I just replace BLACKTAB with GREENTAB in the code?
thank you for your help, its very much appreciated. :-)
sspence (author)  peter69618 months ago

I went back and looked at my code, and don't see "blacktab", "greentab" etc. what line of code are you referring to? The code should work on any ST7735

peter6961 sspence8 months ago
im sorry that is from another code, ignore that. very sorry for the confusion.
ill try the updated code soon. if it still doesn't work ill reinstall the IDE
peter6961 sspence8 months ago
thank you very much for replying, ill try it in a few hours.
my back went out thismorning so cant sit, wish there was a sketch download link.
if its not too much to ask can you please email me the code?
thank you. once again
kurtee2 years ago
That did the trick!
Glad to see that my display is working properly.
Many thanks for the write up!
sspence (author)  kurtee2 years ago
Sorry for the confusion. I need a version control system :-)

I'm trying to put this together and have a bit of a problem in the wiring.

In the code talking about the TFT the following pin assignments are mentioned:

CS to Arduino Pin 10

DC to Arduino Pin 9

Reset to Arduino Pin 8

and from this link talking about the relay http://arduinotronics.blogspot.com/2013/01/working-with-sainsmart-5v-relay-board.html

the following code is given:

int relayPin2 = 8; // IN2 connected to digital pin 8

int relayPin3 = 9; // IN3 connected to digital pin 9

int relayPin4 = 10; // IN3 connected to digital pin 10

are these two sharing the same pins?

sspence (author)  dleec451 year ago

Change the relay pins to whatever pins you have available.

c_droner1 year ago

Okay, how would I hook the pressure sensor up to this project. Where would it go into the sketch?

c_droner1 year ago

Hello again,

Although my sensor is working and I am receiving accurate info, the screen is real dim, nothing like in your video. Is this something you would know how to fix?

Many thanks

sspence (author)  c_droner1 year ago
check your brightness and contrast resistors.

Hi. I was wondering if you can help me. I am planning on using this (minus talking part) for a homemade incubator. Am trying to set-up the code, but I get an error. The part hi-lighted is "DHT dht(DHTPIN, DHTTYPE);" with the error "'DHT' does not name the type." I would be grateful for your thought, as search this problem has come up with no easy fix.

Great and inspiring instructable!

sspence (author)  madmoonfish1 year ago
Sounds like you are missing the dht library.
sspence (author)  sspence1 year ago

Updated the code with a link to the libray, and fixed the 3 includes that did not paste properly.

Aargh! I thought they were ok as they were showing up in my library. I even tried 3 different DHT libraries previously (which all showed up!) So what did was updated my arduino software to current version. Re-done the dht sensor files and now all works fab! Thanks very much! Just need to setup my relays and all will be up and running. Thanks again :D

kurtee2 years ago
Ok, something seems to be wrong!
You are showing CS, DC an RST to be pins 10,9 and 8.
In your code CS=10, DC=11 and RST =13
Also ,are the SCL clock and SDA data line coded from the libraries.
When I scope 13 it does not seem to be reset because it popping like a clock signal!
Very confused!!
sspence (author)  kurtee2 years ago
Good catch. Originally, we did software SPI (any pins can be used), then switched to hardware SPI (for faster performance), and forgot to update parts of the instructable. All should be fixed now.
Do I need to call the different code examples any particular name....kinda new at this...thanks
sspence (author)  dleec451 year ago
any name you would like, within arduino naming conventions.
Ask previous question about naming requirements of programs as haven't done this much and now I'm confused with how do you load all 4 programs to get everything to work? Any help appreciated...thanks
sspence (author)  dleec451 year ago
to load a sketch on an arduino, you use the arduino IDE, open the sketch to upload or type the code, and click the upload button. you can only have one sketch loaded at a time. Learning to use the Arduino IDE is beyond the scope of this tutorial. See http://arduino.cc/en/Guide/HomePage
Thanks sspence for the reply....I do understand that only one sketch can be loaded at a time but I'm trying to use all the features of this project with the relay and don't know how one accomplishes this.....any suggestions?
sspence (author)  dleec451 year ago
yes, you add the various features to one big sketch, like I did in the tutorial.

I've looked at doing this but I'm just not a programmer so I don't know how to pull this off.....thanks for your replies

ramzi bash1 year ago
tank you veryyyyyyyyyyyyyyy much