Go large with 16x2 character LCDs!
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
1 GND 2 +5V 3 contrast pot wiper (with other sides of pot connected to GND and +5V respectively) 4 Arduino D7 5 GND 6 Arduino D8 11 Arduino D9 12 Arduino D10 13 Arduino D11 14 Arduino D12 15 +5V 16 GND
Once you've got the LCD wired up, it's a good idea to give it a quick test before proceeding, so grab the built in HelloWorld example from File->Examples->LiquidCrystal. The Adafruit tutorial uses different pins than the Arduino default, so we'll need to tweak the code slightly; instead of:
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
we need:
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
for the way we wired it. Compile and Upload the sketch, and you should see a lovely hello, world! on your LCD. If not, hit me up in the comments and I'll try to help you figure out what went wrong! 💙
Now that we know the LCD is working, let's have a look at the temperature. I'm using the commonly available, inexpensive, DHT11. It's not the fastest or most accurate way to measure temperature, but it's cheap, and good enough for our purposes. Hook the middle (out) pin on the DHT11 to digital pin 2 on the Arduino, and the + and - pins to 5V and GND respectively. You'll need to install the Adafruit DHT sensor library as well as its dependency, the Adafruit Unified Sensor library - if you've not done this before, Adafruit has an excellent walk-through. With the libraries installed, we can run another quick test sketch like we did for the LCD: open File->Examples->DHT->DHTtester and uncomment this line (15 at the time of writing) by removing the leading forward slashes:
#define DHTTYPE DHT11 // DHT 11
then comment out this line (16) by prefixing it with two forward slashes:
//#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
and give it a quick Compile. If you run it, chances are you won't see the expected output on the serial monitor, but as long as it compiled OK, we should be good for now.
Create an account to leave a comment. Already have an account? Log In.
Become a member to follow this project and never miss any updates
About Us Contact Hackaday.io Give Feedback Terms of Use Privacy Policy Hackaday API Do not sell or share my personal information