I have this humidity project that Im moving onto a pcb. But when i connect it to the power and after uploading the proper sketch (the one that worked fine on the breadboard), the lcd only displays empty boxes for each position, the ones that show up by default when there is no data to display.
Here is the project:
So far Ive tested for continuity on all lcd wires including + and -.
Ive tested continuity for all wires going to the dht11 sensor. Here is the code:
#include <LiquidCrystal.h>
#include "DHT.h"
//for hdc1080
#include <Wire.h>
#include "ClosedCube_HDC1080.h"
//for lcd
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
//for dht22 grove pro
#define DHTPIN A1 // what pin we're connected to
#define DHTTYPE DHT22 // DHT 22 (AM2302)
DHT dht(DHTPIN, DHTTYPE);
//for hdc1080
ClosedCube_HDC1080 hdc1080;
void setup() {
lcd.begin(16, 2);
Serial.begin(9600);
Serial.println("DHTxx test!");
dht.begin();
hdc1080.begin(0x40);
}
void loop() {
//printVolts();
//if using hdc1080
print1080();
//if using grove dht11...
printTempUndHum();
}
void printVolts(){
int sensorValue = analogRead(A0); //A0 V-Divider
float voltage = sensorValue * (5.00 / 1023.00) * 1; //x1 if 3.7V or x2 if divider used (12KΩ)
lcd.setCursor(0,0);
lcd.print("V=");
lcd.print(voltage); //print v to LCD
lcd.print(" V");
if (voltage < 3.50) //warn low V
{
//digitalWrite(led_pin, HIGH);
}
}
//If using DHT11/Grove for T&H
void printTempUndHum(){
float h = dht.readHumidity();
float t = dht.readTemperature();
lcd.setCursor(0,0);
lcd.print("T=");
lcd.print(t);
lcd.print("C");
lcd.setCursor(7,0);
lcd.print("H=");
lcd.print(h);
lcd.print("%");
}
void print1080(){
float h = hdc1080.readHumidity();
float t = hdc1080.readTemperature();
lcd.setCursor(0,1);
lcd.print("T=");
lcd.print(t);
lcd.print("C");
lcd.setCursor(7,1);
lcd.print("H=");
lcd.print(h);
lcd.print("%");
}
