Replicating "Old-School" Texting With an Arduino, a 4x4 Numerical Keypad, and a 16x2 LCD
by Clayton Ford in Circuits > Arduino
14726 Views, 28 Favorites, 0 Comments
Replicating "Old-School" Texting With an Arduino, a 4x4 Numerical Keypad, and a 16x2 LCD
Hello! This is a tutorial to produce a text-composition device using an Arduino with text storage and return capabilities to the serial console. In its current form it is not particularly useful, and is more of an entertaining exercise, but the hardware setup and code may be expanded upon or incorporated into other projects as a relatively cheap way to compose text. With the addition of a GSM or 3G shield, and minor code changes and additions, this setup could actually be used as a simple text-sending phone.
Here is a video demo of most of the functionality, including text entry, line wrapping, screen-clearing, spaces, backspaces, serial output, and the end of composition menu, featuring the re-display of stored text upon backspacing, as well as the capability to output a final message and clear the display and storage.
You will need:
An Arduino (I used an Uno R3)
A 16x2 LCD (with or without backlight, your choice. Different sizes could be used with accommodations made in the code)
A breadboard, male-male and male-female jumpers (depends on how permanent this will be, and what headers are where)
5x 2k ohm resistors
1x 240 ohm resistor
The resistor values are not nessisarily set in stone, the 2k ones could most likely be subbed with anything 1k-5k, and the 240 could be anything 100-500, but I make no guarantees that those will cooperate (they probably will though). One of the 2k's and the 240 are used for creating a voltage divider for the contrast on the LCD. Normally this is accomplished with a potentiometer, so substitute as you feel fit.
Hardware Setup
Code
I've attempted to comment this code extensively, but if anything in it remains unclear, please do ask! I've attached the .ino file to make uploading the code simple.
Note: I wrote this code before I had a handle on Object-Oriented Programming, and so the structure and organization of the code could certainly be better, but it still does function perfectly. I would update the code, but I no longer have the hardware on-hand and so would not be able to test it sufficiently. It is my hope, however, that the lack of OOP will make the code simpler to follow for Arduino beginners.