Go Down

Topic: SainSmart LCD Shield question (Read 7 times) previous topic - next topic

GlassCurtain

Hey guys! I'm somewhat new to the Arduino. I have the Uno. I'm working on making a thermostat. I have a digital humidity and temp sensor (DHT11) hooked up on my breadboard. I can read humidity and temp just fine plugged up to D2 pin on the Uno. But now I'm using the sainsmart LCD keypad shield 1602 and can't get a read from the DHT11. I think I'm reading the shield pinouts correctly. I'll post the pinout. If I could get confirmation that I'm using the correct pin on the LCD shield I'd appreciate it! I'm using pin 5 on J5.

Also, in my program I just need to define the input pin on the uno not on the shield, correct? As I understand it the shield just pulls the pins up from the Uno.

Thank you for you time!


floresta

Quote
But now I'm using the sainsmart LCD keypad shield 1602 and can't get a read from the DHT11.

I hope you are not using the LCD4Bit library recommended by Sainsmart.  If you are then try switching to the LiquidCrystal library supplied with the IDE.  You will need to invoke it with:

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);      // use these values with the Sainsmart Keypad Shield


Quote
As I understand it the shield just pulls the pins up from the Uno.

Correct.  But you can't use any of the pins that are used by the devices on the shield.  These are called out under 'Pin Allocation' in the readme.txt file and include pin 10 and Analog pin 0 in addition to the six pins mentioned above.

Don

GlassCurtain


I hope you are not using the LCD4Bit library recommended by Sainsmart.  If you are then try switching to the LiquidCrystal library supplied with the IDE.  You will need to invoke it with:

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);      // use these values with the Sainsmart Keypad Shield


I am using the LiquidCrystal library. and I've invoked it with the correct pins. But I'm not even trying to write to the LCD yet. I just want to get the DHT to display its data in the serial monitor while I'm plugged up to the LCD shield. For now, I'm just trying to verify that data is getting to the shield and that I'm on the correct pin.


Correct.  But you can't use any of the pins that are used by the devices on the shield.  These are called out under 'Pin Allocation' in the readme.txt file and include pin 10 and Analog pin 0 in addition to the six pins mentioned above.

Don


Ok I've verified that the D2 pin is not used by the LCD.  Thank you for your reply, Don!

floresta

Why don't you give us some more information.  You haven't mentioned a pull-up resistor for your sensor and you haven't told us what sketch you are using.

How did you read the temperature and the humidity before you tried using the LCD?

What does display on the LCD?
(a) Blank
(b) A row of boxes
(c) Incorrect data
(d) Hieroglyphics


Don


GlassCurtain


Why don't you give us some more information.  You haven't mentioned a pull-up resistor for your sensor and you haven't told us what sketch you are using.


Sorry about that. I have a resistor connecting between the power pin and the data pin on the DHT11. I'm just using the sketch that came with the DHT11. I have added the liquidCrystal library and invoked the correct pins for the LCD.



How did you read the temperature and the humidity before you tried using the LCD?


I have the DHT11 on my breadboard. power and ground on the arduino running to the power and ground rails on my breadboard. Then, ran the data pin to D2 pin on the arduino. And just did a Serial.println() of my variables. And checked I was getting accurate data in the serial monitor. So I just assumed that all I had to do is run power, ground and data to the corresponding pins on the shield and I should still see data coming through the Serial monitor.



What does display on the LCD?
(a) Blank
(b) A row of boxes
(c) Incorrect data
(d) Hieroglyphics


Don


Just a row of boxes show on the LCD. But I'm not trying to write the data to the LCD yet. I am trying to figure out why I'm not getting data pulled up to the shield. Just as a test I did an lcd.print() of my variable and the LCD is displaying the same result as when I used Serial.println(). The sensor is just returning the value 0.00.

Again, I keep everything the same, remove the LCD shield and plug directly into the arduino and I get correct data.

Thank you! --Aaron

Go Up