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):
- RES1: 16MHz Resonator
- MCU1: ATTiny2313-20, 5V
- IC1: 7805-style power regulator
- T1,T2,T3,T4 NPN transistor such as 3904
- R1, R2, R3, R4 470Ω
- R7,R8,R10: Pull-down resistors of 100kΩ
- Photocells: Simple LDRs (light-dependent-resistors)
- POT1,2,3: 100k POTs
- C1: 100μF, C2: 10μF capacitors
- RFTrans: 2400 MBps SAW transmitter module
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...[...] Light Sensor [...]