Building a timelapse slider rail with Arduino - Part 3 - LCD Display
Hey there,
This post goes into how I have set up a 16x2 LCD display to be used with my time-lapse rail. The LCD will display a number of menu items that allow you to configure the slider as well as starting and stopping the motion. I'll go through both the menu API and how I set up the buttons to navigate in a future post.
Previous parts are here
https://steemit.com/photography/@markangeltrueman/building-a-timelapse-slider-rail-with-arduino-part-1
https://steemit.com/photography/@markangeltrueman/building-a-timelapse-slider-rail-with-arduino---part-2---stepper-motor-1510869489-2758267
It is possible to connect an LCD directly to the Arduino but the problem with this is that it uses at least 6 data pins on the Arduino, which doesn't leave enough for the other functions I need from the Arduino. To get around this, I decided to use a 74HC595 bit shift register chip. These chips allow you to pulse values into the chip on a single pin and then "latch" the value in place before outputting it. There are 8 output pins which give plenty of flexibility. You can also chain these chips together so you can get 8,16,24,32 bit outputs from just a few Arduino pins. Clever stuff.
Here is a schematic created in Fritzing (a great program if you want to do this kind of thing)
As you can see there are just 3 wires coming out of the Arduino (apart from 5v and GND) and they all go into the 595 chip. The chip then has 6 outputs into the LCD, 4 for data, 1 to enable the LCD and 1 to switch the mode of the LCD from "command" mode to "data" mode. Command mode is used to move the cursor, clear the screen etc. Data mode is enable to actually take the data sent in on the 4 (in this case) data pins and display it.
In case you are wondering what the LCD pins do, this is a good page (i wont copy and paste the detail here)
http://www.circuitstoday.com/interfacing-lcd-to-arduino
In terms of Arduino code, you can't get any simpler. You need to include a couple of libraries, one for the LCD and one called SPI (serial peripheral interface), which tacks on the ability to use the 74HC595 chip.
The output from this is shown in this video
And here is a quick video showing how altering the resistance through the potentiometer changes the brightness of the lcd text. You can change the backlight brightness by either altering the value of the resistor in place on the breadboard, or by replacing that resistor with a potentiometer too, but i prefer to just leave it with a 680 ohm resistor which gives a good level of light.
In the next part, I'll go through how to set up the Arduino to accept input from 4 different buttons on a single pin and touch on my custom menu API
Thanks for looking
Mark
Most interesting project @markangeltrueman, hardly can wait to see the final product and the movies made with it :)
@originalworks
The @OriginalWorks bot has determined this post by @markangeltrueman to be original material and upvoted(1.5%) it!
To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!
Cool. :)
Full support @markangeltrueman!