Light Sensor

Overview

The light sensor is a three-channel digital sensor which periodically transmits the state of the three channels to the master device every thirty seconds. Uses range from ambient light sensors to external LED-detectors (I use one to determine whether the boiler from my house heating system is on) or any other circuit that returns a digital state.

It is based around an attiny2313 MCU. Since this MCU does not have analog input pins (only an analog comparator), the circuit uses transistors to switch the individual channels on or off depending on the resistance of the light sensor. A pot is used to calibrate the sensitivity for each channel individually.

Three status LEDs display the state of each channel, a fourth (LED1) blinks when data is wirelessly transmitted. A DIP switch is used to set the device id.

The firmware send a TX32 (data) command which contains one data byte. The data byte contains the state of the three sensors in the lower three bits (one bit per sensor).

Required Hardware

The circuit uses the following hardware (links go to Sparkfun, you can also easily get this from Digikey, Mouser, etc):

All of the components can easily be mounted on a breadboard for prototyping.

Circuit

Grab the Eagle diagram or image thereof.

Firmware

The firmware is built around the common Catrpillr libary and can be found right here. See the software section for details around firmware and uploading firmware.

Comments

One Response to “Light Sensor”

Trackbacks

Check out what others are saying about this post...


Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!