3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Build your own (cheap!) multi-function wireless camera controller.

Step 17LCD, the Intervalometer and ADC

LCD, the Intervalometer and ADC
«
  • DSC_5503.jpg
  • DSC_5502.jpg
  • DSC_6567.jpg
  • DSC_5771.jpg
  • DSC_5767.jpg
  • DSC_5770.jpg
  • DSC_5772.jpg
Now we get to the fun bit.

You first need to solder some leads onto the LCD. It should have solder pads for the purpose and if you are careful, shouldn't cause you too much trouble. Don't take off the protective film over the screen, it protects against flux spattering and you may damage it if you take it off before you finish.

The pins on the LCD are as follows:

1 GND
2 VCC
3 Contrast
4 RS
5 R/W
6 E
7 DB0
8 DB1
9 DB2
10 DB3
11 DB4
12 DB5
13 DB6
14 DB7
15 LED+
16 LED-

Connect GND to ground, VCC will go to the +5V rail.

The contrast pin should go straight to ground too, though in many diagrams it's connected to a potentiometer (i've never seen the point).  It's worth mentioning that you should check with a resistor to see what value you need.  My red LCD is happy with ground, my blue LCD (the one i ended up actually using) required a small resistor.

LED+ should be connected via a 2.2k resistor to the +3V rail and LED- to ground. You can simply wire it straight to the voltage rail, however it will draw 30mA all the time. With a resistor in series, you will limit the current significantly - of the order of around 15-20x less - without much degradation in brightness (it's more than acceptable to use in the dark).

The LCD library uses a 4-bit interface, so we only need four pins. Thus we disregard the first four data pins and only use DB4..7. DB4,5,6 should be connected to pins 2,3 and 4. DB7 on the other hand will be connected up to pin 14. The reason for this is as follows: we need PD2 (pin 5) as an external interrupt pin*. On other microcontrollers such as the ATMega88, you can use (almost) any pin as an external interrupt, but this way you can use either the Mega8 or the Mega88/168.

You should then connect RS to PD6, pin 12 , R/W to PD5, pin 11 and E to PD4, pin 6 .

If you want to use different ports, look in lcd.h and change the definitions!

That's all you need for the LCD, now onto some more buttons. You're going to need to wire up another 5. These are mode and the four directional buttons. Wire up a button to each of pins 15-19.  The process should be the same as in the previous step, so i haven't provided needless pictures for each one.

Finally, load up and run the full application as provided in step 12/13.

When you run the program, you should be shown a "splash" screen and the the first shooting mode, manual triggering. To take a picture, press shoot (as before). Press mode to cycle between menu options. For the interval timer, you may set the value of each unit of time using the up/down buttons and switch between units using left/right - hopefully intuitive...!

The next section deals with the ADC (which should be enabled by the code below).

This is the code that will stay on your chip!

*In this revision i planned to use external interrupts but never did, however the code is still written for this pin configuration.

« Previous StepDownload PDFView All StepsNext Step »
2 comments
Oct 15, 2009. 3:25 PMflemron says:
'You should then connect RS to pin , R/W to pin and E to pin .'

what are these pins?

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
15
Followers
1
Author:Whiternoise
I'm a third year physicist at Warwick University, dabbling in electronics and photography and currently seeing what interesting combinations you can make with the two :)