Chosing a pull down resistor for an LDR: Axel Benz formula

LDR_circuitIn deciding on the value of the pull down resistor in a voltage divider with an LDR, one needs to take in account the range of light levels one wants to measure.
If you want to have the sensor in a bright area and use a 10KΩ pull-down, it will quickly saturate. That means that the voltage over the pull-down resistor will soon be 5V and you will not be able to differentiate between kinda bright and really bright. In that case, it is better to replace the 10KΩ pull-down with a 1KΩ pull-down, but then it will not be able to detect dark level differences as well but it will be able to detect bright light differences better. This is a trade-off that you will have to decide upon!

You can also use the “Axel Benz” formula by first measuring the minimum and maximum resistance value with a multimeter and then finding the resistor value with: Pull-Down-Resistor = squareroot(Rmin * Rmax), this will give you slightly better range calculations.

axel benz

 

Nokia 5110 display on Arduino

P1050310 The Nokia 5110 LCD module is a small and cheap LCD with a lot of graphical possibilities and is quick to add to projects that need a display. The programming of the display is a bit difficult but there are a number of very good libraries available. Adafruit ofcourse has a library that is available here: here you will also need to install the GFX library that library is a bit slow but a faster hardware SPI library by Snigelen is available here: here.
Some additions to the Adafruit library have been made by avdweb
The arduino playground has a library: here
A library is also available: here
A further fast libray is available here with explanation here
Also a library by Henning Karlsen

The display driver is a PCD8544 chip, and it runs at 3.3V so you will need a 3.3V supply handy. Logic levels must be 3.3V to prevent damage so you must use some kind of level shifter (such as a 4050) or some resistors. It is possible to use a number of different lines to hook up the LCD. Normally it is 5 lines, but a configuration with 4 or even 3 lines is possible The Nokia 5110 LCD has 5 control lines; the interface is of the type SPI. Mostly, when no other SPI devices are used, the chip select can be connected to the GND, so 4 control lines remain.

As said, it is possible to use only 3 control lines, by connecting the Nokia reset pin to the Arduino reset. This works only when the serial monitor is used, not with a standalone Arduino.

Another possibility is to generate a reset pulse on power up automatically, with a RC combination, to save one control line to the Arduino. This solution doesnt seem to be reliable though. The proper functioning seems to also depend on the capacitor across the 3.3V supply. Using only 4 or 3 lines of course only makes sense if your library allows that, otherwise the pins may not be connected but will be in use by your program.

nokia5110

nokia5510-4050

Example of connection with resistors and 4 control lines

Nokia5110-2

Nokia51110-3

handy article