DFRobot LCD Keypad Shield - Project Showcase - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

DFRobot LCD Keypad Shield


  • Please log in to reply
2 replies to this topic

#1 Mike P

Mike P

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts
  • LocationAuckland, New Zealand

Posted 17 July 2011 - 10:52 AM

Hi Folks,
This is my first contribution to the community so I hope someone finds it helpful.
I took the plunge and bought a Netduino plus from Little Bird in Australia.
I also bought the DFRobot LCD Keypad Shield at the same time so I would have something to display data on and some keys for control. I didn't select very carefully as it uses 8 pins to acheive this and there may have been better choices.
On the whole I am happy with it but because it is designed for Arduino it requires some modification for it to work with Netduino.
The module is the DFRobot DFR0009
http://www.dfrobot.c...t&product_id=51
For those not familiar with this shield it connects to a common 16x2 LCD module using a 4-bit interface. With enable and reset that brings the pin count to 6 pins for the LCD.
The backlight is driven by a 7th pin via a transistor. This is a PWM pin which simplifies adjusting backlight intensity.
So far so good.
The keypad is where the mod is required. It consists of 5 buttons labeled select, up, down, left,right.
The buttons tap into a string of resistors and pull the Analog input pin0 to different voltages depending on which button is pushed. The output is designed for Arduino so the analog levels for the buttons are spaced between 0 and 5v.
The voltage output when the left button is pressed and when no button is pressed is over 3.3v so it will register as 1024.
My first attempt to mod the shield was to pull out the 5v pin and bridge the Vcc to the 3.3V pin. This fixed the keypad OK but the LCD contrast was no good. The text was just readable with the contrast pot at one end of its range. The HD44780 can run on 3.3v but not this LCD module.
So I reversed that mod and looked for another way.
In the end I settled on removing the 2k resistor at the top of the chain that links between 5v and the analog pin0
The 2k resistor is an SMD chip resistor thet is located under the LCD module but it can easily be reached with a soldering iron.
Then I made a new connection with a 1500ohm resistor between 3.3v and the analog pin0.
The resistance change to 1500ohms helps to maintain the even separation of the voltages generated.
With the new setup the switch presses theoretically generate the following ADC values, mine were all within a few counts of these.
None=1024
Select=796
Left=578
Down=397
Up=184
Right=0
If you are coding the thresholds to check against are 90,290,490,690 and 910.
Check the sample code for Arduino to see how it's done.
Here are some photos that should make things clearer.
This one shows the "202" resistor to be removed
Attached File  DSC04881.JPG   119.53KB   222 downloads
This shows where to add the 1500R resistor
Attached File  DSC04884.JPG   184.79KB   242 downloads
This shows the picture from the DFRObot website. My unit looks different but it still functions the same.
Attached File  LCD&KeyPad_Shield.jpg   30.75KB   182 downloads
The library I used was the microliquidcrystal library
The LCD provider settings are below
//Keypad connected to Analog pin 0
AnalogInput keys = new AnalogInput(Pins.GPIO_PIN_A0);
//backlight connected to D10
// create the transfer provider
// Initialize the library with the numbers of the interface pins
PWM backlight = new PWM(Pins.GPIO_PIN_D10);
var lcdProvider = new GpioLcdTransferProvider(Pins.GPIO_PIN_D8, Pins.GPIO_PIN_D9,
         Pins.GPIO_PIN_D4, Pins.GPIO_PIN_D5, Pins.GPIO_PIN_D6, Pins.GPIO_PIN_D7);


#2 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 17 July 2011 - 10:55 AM

Well done!
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#3 edwindaniel991

edwindaniel991

    New Member

  • Members
  • Pip
  • 1 posts

Posted 14 July 2013 - 06:22 PM

Hello, I'm new in the forum and new in the netduino world,I'm from Oaxaca(Mexico) I worked before with arduino and I'm tried to work with netduino, but I can't find some example were DFrobot LCD keypad Shield was use, I seen some  works but i can't find any source code.
 
I hope if you can upload a little example of code, I apreciated very much.
 
I'm sorry for the ortography and my English
 
here is my hardware  ¬¬ in a coke table ?? XD
Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.