![:rolleyes:](http://forums.netduino.com/public/style_emoticons/default/rolleyes.gif)
![Attached File](http://forums.netduino.com/public/style_extra/mime_types/gif.gif)
![Attached File](http://forums.netduino.com/public/style_extra/mime_types/zip.gif)
![]() |
  | |||||||||||||
![]() |
|
![]() |
||||||||||||
![]() LCDKeypad 16x2 HD44780 Shield
Started by adi, Sep 06 2010 09:27 PM
11 replies to this topic
#1
Posted 06 September 2010 - 09:27 PM
Hi
This is a Clock / Calendar application on a 16 x 2 LCD Keypad shield. I was hoping to use all the keys to configure the date, but I quickly ran into the 5v / 3.3v analog issue with the keypad, rendering the keys useless without modification to the board. However I noted from one of the posts that it was ok to use the analog input as a 5v digital input, which then responds to the right button key press. The challenge was then to create an application which could be configured with one key!
My application starts with a welcome screen demonstrating static, moving text and custom characters. The Clock / Calendar is displayed and updates each second. After pressing the right button, it enters setup mode. Pressing the button again increments the currently selected item ( indicated by a blinking cursor ). Not pressing the button for 4 seconds moves the menu on to the next item. The first item toggles the back light and is indicated by a 'Bulb' custom character.
The bulk of the LCD keypad shield driver can be found elsewhere..(FEZ), but I have also added my own enhancements to make it easier to use as well as custom character storing method based on a heap of reasearch and experimentation
![]() ![]() ![]()
#2
Posted 21 November 2010 - 09:39 PM
Works very good. Thanks for sharing.
Ben Zijlstra
#3
Posted 21 November 2010 - 10:17 PM
Can you elaborate on the keypad/analog input issue?
#4
Posted 02 December 2010 - 05:12 PM
Hi Bill,
The four direction buttons + select share one analog channel and they are distinguished in code by the voltage they return. however they are using 5v supply and Netduino expects 0 - 3.3v for analog, so most of the buttons return the same value.
To make it work you could cut the track and give it a 3.3v supply or make a voltage divider to change the output voltage...i think that's it??
Shame for such a handy shield, i wonder if the fez shield is 3.3v and all the buttons work?
#5
Posted 03 December 2010 - 04:13 AM
Hi guys,
I have this shield also and have found the buttons to be troublesome (read: broken) due to the 5v problem. I've looked at the schematic (http://www.robotshop...d-schematic.pdf) and the actual board. The way the board is designed it looks really hard to break the power track coming from the 5v to the analog circuit - but it might be possible to do something at the point where the tracks come back to the Analog input pin.
Would it be as simple as adding a series resistor here to drop the voltage from 5.0 to 3.3? or would I have to use something like this:
http://en.wikipedia....Voltage_divider
Shaw
#6
Posted 09 January 2011 - 08:52 AM
Has anyone found a way to use all of the buttons on this DFRobot LCD & Keypad shield?
#7
Posted 10 January 2011 - 03:08 PM
I think a voltage divider circuit is probably the way to go, and using only 2 resistors, should be the most affordable. I'm a decade or so out from that last time I used any of this EE knowledge, so hopefully I'm getting this correct (been breaking out my old circuits textbook at night to refresh my memory). Hopefully someone can chime in if I'm off on any details here...
I think using a 12k and an 18k resistor should get you the correct ratio (~1.5 ) to divide 5v down to 3.3v. With the 12k resistor in series on the analog line of the shield buttons, and then after that parallel out the 18k resistor to ground... lcdboard ----> 12k R ----------> Netduino analog in | | 18k R | Ground (Hopefully that shows up right..the 18k resistor line is split out after 12k R, before netduino in.)
#8
Posted 10 January 2011 - 03:16 PM
...and I suppose 1.2k/1.8k would work just as well.
#9
Posted 07 February 2011 - 12:25 AM
I managed to get this project working using a Sparkfun Logic Level converter.
However, while debugging I noticed that the voltage levels didn't appear to be in the "expected' range. From the original code in LCDKeypadDriver.cs
I found my range was 0, 110, 230, 360, 510, 630 Not sure why these are so inconsistant either. I would have expected these to be "scaled" evenly in the 0-1023 range
#10
Posted 07 February 2011 - 12:40 AM
Hi
The level converter is not supposed to scale a signal. It is just converting the high logic level to another voltage.
Sparkfun says this: "Does not work with an analog signal."
/Jan Olof
#11
Posted 07 February 2011 - 04:06 AM
From the schematic there are both Tx and Rx channels. The Rx channel is a simple voltage divider (although it is a 2:1)
#12
Posted 17 July 2011 - 11:41 AM
Hi All,
I've documented a simple mod to this DFRobot LCD Keypad Shield (DFR0009) The mod gets the keypad working as intended. http://forums.netdui...-keypad-shield/ I put the appropriate analog values into the code provided at the beginning of this thread. The thresholds are chosen to be about mid way between one expected value and the next and are typically 90-100 counts from the expected values so it should be quite reliable. /// <summary> /// Gets an enumeration of the key press at the current time. /// Can only be used if the LCD has been initialised with the true parameter. /// </summary> /// <returns></returns> public static Keys GetKey() { if (!analogInitialised) throw new Exception("Analog input is not Initialised"); int i = AnKey.Read(); if (i > 910)//expected value = 1024 return Keys.None; if (i < 90)//expected value = 0 return Keys.Right; if (i < 290)//expected value = 184 return Keys.Up; if (i < 490)//expected value = 397 return Keys.Down; if (i < 690)//expected value = 578 return Keys.Left; //expected value = 796 return Keys.Select; } 0 user(s) are reading this topic0 members, 0 guests, 0 anonymous users | ||||||||||||||
![]() |
||||||||||||||
![]() |
|
![]() |
||||||||||||
![]() |
This webpage is licensed under a Creative Commons Attribution-ShareAlike License. | ![]() |
||||||||||||
![]() |