Electronics Projects

Digital Lux Meter

The device is intended for measuring illuminance in the range 0.025 - 99999 lux. The lower limit is determined by the used sensor MAX44007, while the upper one is slightly less than the sensor's one because no more than 5 digits fit on the LCD screen. Calibration of the sensor is provided by the manufacturer.

Schematic Board layout

I used a graphic 128×32 LCD by several reasons. First, it is easily readable from a significant distance and at wide view angles without throwing shade on sensor. The large 19×32 font is well seen even at low lighting conditions without using the LCD backlight. The backlight is not used at all in order not to affect the measurements. Second, the used LCD draws just 80 μA which is noticeably less than for most character display modules. Third, but not last, the LCD with microcontroller takes just 5 port pins for the SPI protocol and reset. Caps C6 - C13 are needed for the LCD built-in DC-DC converter.

The heart of the device is Silicon Laboratories C8051F304 microcontroller in QFN package. Small package size allows to reduce the device dimensions that practically match the LCD's ones. Reading data from sensor is performed via I2C protocol, which is implemented in the corresponding hardware module within the F304. Timer1 of F304 is used for generating the I2C clock. During communication with sensor the micro-controller runs at 2.5 MHz. However, to speed up the formatting of sensor readings and loading the data into the LCD, the oscillator is boosted up to 20 MHz. This short-term increase of clocking frequency benefits the overall power consumption.

The sensor is configured for operation in automatic mode. In this mode the measurements are taken every 0.8 seconds provided by a timer built into the sensor. After every measurement the sensor requests an interrupt by driving its pin 4 low. To minimize the power consumption the microcontroller, while waiting for an interrupt, enters sleep mode and is clocked by external RC oscillator based on C2. Due to a low frequency of this oscillator (66 KHz) the current consumption falls down to 8 μA. The interrupt requested by sensor wakes the microcontroller up.

Front view Back view

The lux meter is assembled on a printed circuit board of size 30×60 mm, which is designed with Eagle. The sensor is mounted on a small board along with C1 and R4 which, in turn, is placed on the front side of the device. The circuit is powered from CR3032 battery and draws about 130 μA in average. The components on the back side of the board are protected by a plexiglass plate of the same size as the main board. The plate is mounted on on the board on 5 mm high posts. In-circuit programming of the microcontroller is performed via the programming connector XJ1 by using interface C2.

The code is written in assembly language and developed in Silicon Labs IDE equipped with Keil programming tools. The code size is about 1.9 Kb, which allows to use a free version of the software for its compilation.

Downloads


Last modified:Mon, Jan 23, 2023.

12421