Hardware Design

Wireless Ambient Lighting Control System

Pratik Panchal (pp423@cornell.edu), Kedar Vidvans (knv25@cornell.edu)
M.Eng, School of Electrical and Computer Engineering,
Cornell University 


Hardware Design: 

The hardware is functionally seggregated and sub-divided as follows:

1. Main Unit: The following hardware sections resides at the main unit:

a. Controller
b. PIR motion sensor
c. LED lamp and drivers
d. HMI - keypad
e. Communication module and data driver. 

a. Controller: ATMEGA16L controller is used with a crystal of 8.00 MHz as the main onboard controller. It has 16kB of flash program memory, 1kB of RAM and 512 bytes of flash EEPROM. With mulitple peripherals and more i/o pins, it was a suitable component for the project. The controller has The programming lines have been brought to a 3x2 header for connection with the programmer. An onboard reset button is provided to reset the system. 

b. PIR motion sensor: A PIR motion sensor is digitally interfaced with the controller at pin D7. The sensor has 3 pins; Vcc, gnd and output. The output is driven high if a motion is detected; else it is low. A pull down resistor of 10k is connected to this pin since, the sensor could source the current but couldn’t sink. The output delay is approximately 500 ms which is acceptable since the control is not time critical. The timing diagram of the sensor is shown in figure 2.


PIR timing diagram
Figure 2: PIR Timing Diagram


The sensor consist of infrared sensor element, which detects the change in infrared rays emitted by human body.The sensitivity and range of this sensor element is increased by a translucent fresnel lens. The output of the sensor element is passed through filters, amplifier and comparator circuits to produce a smooth square wave form.

Figure 3: PIR Internal block diagram

The motion sensor introduces additional versatility to the control system by switching off the lights when no human presence is detected. The software handles the timings between the events of sensor output and switching controls. For the purpose of demostration, we kept a time out of 1 minute, but for actual practical purpose, 7 to 10 minutes timeout can be used.

c. LED lamp and driver: LEDs are increasingly used for general purpose lighting purpose due to their reduce power consumption and decreasing cost. Moreover an LED can be easily and efficiently controlled by PWM as opposed to firing control in case of incandescent lamps. We used three, 3W super bright white leds in series as a light source. A series resistor of 10 ohm was used as a current limiter and to make sure that we don’t burn up the LEDs. The whole series assembly was powered at 12.0 VDC, at which we observed the voltage across each led was approximately around 3.4V. This was lower than the maximum rating of 3.6V and hence was sufficient for our lighting need. The LEDs were stuck on a cardboard box and the leds arranged as vertices of a triangle. The snapshot shows the LED lamp assembly.

Due to higher voltage (12V) and higher amperage consumption (approx. 600mA) of the LED lamp, it is necessary to employ a driver to drive the lamp.

Driver Design: We used a switching MOSFET BUZ73 to drive the LEDs. The mosfet is switched through the transistor stage an optoisolator 4N35, whose LED stage is driven directly from the microcontroller port pin PB3. The LED stage of optoisolator has 75 ohm of current limiting series resistor. The use of optoisolator also allows to have different potential references for the controller and the LED lamp. Since, we were extracting 12V and 5V from same supply, this wasn’t necessary. Figure 4 shows the led lamp and driver circuit.

Figure 4: LED lamp and driver


d. HMI - keypad: We have used a combination of push buttons and state - switch as a keypad to the system. Three pull-up switches provide the functionalities of increment, decrement and ok. A two state switch provides the functionality of selecing between auto and manual mode. Two LEDs on this switch gives a visual indication of mode selected. The cirucit diagram is shown in figure 5.

Figure 5: Keypad Schematic


e. Communication module and data driver: We used a 433MHz transmitter receiver pair for the wireless communication. The pair works on OOK modulation. A low pass filter is requried at its input terminals for nullilfying effect of noise in the power supply. We used a simple hardware NOT circuit using 2N3904 general purpose transistor, as a data driver, to invert the data received. This is done since the transmitter itself is sending inverted data. A 17 cm of wire was used as an antenna. The schematic is shown in figure 6.


Figure 6: Receiver module and data driver


The complete assembled board is shown in the snapshot 1 and the LED lamp assembly in snapshot 2.

Snapshot 1: Main unit assembly
Click the image to enlarge


Snapshot 2: LED lamp assembly
Click the image to enlarge


2. Sensor Unit: The following hardware sections resides at the sensor unit:

a. Controller
b. LDR light sensor
c. Communication module and driver.

a. Controller: The microcontroller setup is same as in discussed in the main unit. Since the sensor unit is powered up from batteries, we used ATMEGA16L which can work at low voltage also. We have used 4 AA size batteries, each of 1.2V, in series to power up the sensor board.

b. LDR light sensor: We used a LDR to detect the light intensity. LDR output is fairly linear, except at extremes. We noted that the LDR output varied from 0 ohm, at bright intensities to upto 20k at complete darkness. Since, our workable range was around 3k range, we connected a 3k resistor in series to make a voltage divider circuit and hence to obtain an approximately linear range.

c. Communication module and driver: The steady state (no transmission) state of controller is high; i.e. the line is high when there is no transmission. The 433MHz transmitter module has highest power consumption while transmitting a logic 1. To lower the energy, we used a NOT gate made up with a general purpose 2N3904 switching transistor and used it as the data driver. The output is given to the transmitter module. A 17 cm wire is used an antenna. This is optional, but adding the antennal increased the range of transmission. The schematic is shown in figure 7.

Figure 7: Transmitter module and data driver


The sensor unit assembly is shown below in snapshot 3.

Snapshot 3: Sensor Unit (without the battery pack)
Click the image to enlarge


General notes:

We used a general purpose PCB, for both, main unit and sensor units to assemble the circuit. We noted that a 22uF capacitor across the power lines was effective and nullified any effects of power fluctuations.
We provided the battery with a jumper so that while in development, we can work on the power supply and can isolate the battery at that time.


Disclaimer: This work has been done as term work for the course ECE4760 Digital System Design using Microcontroller, at school of Electrical and Computer Engineering, Cornell University by Pratik Panchal and Kedar Vidvans under guidance of Prof. Bruce Land. Readers can use the presented work on this site as long as they acknowledge the source. The work is presented in as-is condition and If used, no liability is borne by either the authors or the school.



web counter
Comments