rtc-lamp

Public

dilshan/rtc-lamp

Loading…

Description

Imported from GitHub: dilshan/rtc-lamp · commit f55f95e · license MIT

Description

Real-time clock based automatic LED lamp

README

RTC based automatic LED lamp

This is real-time clock based automatic LED lamp which we originally designed to use as night light. This lamp can programmed to turn on and off at the specific time of the day. For example, it can program to turn on at 6 PM on each day and to turn off at 4 AM next day.

Prototype version of LED lamp

The core component of this project is PIC16F883 MCU and it's firmware is developed using MikroC Pro for PIC. We select this MCU because of it's 7 KB flash memory, I2C, UART, E2PROM and built-in 8-bit and 16-bit timers. In this system we use DS1307 RTC because of it's availability in the market and lower external component count.

LED module

This lamp is designed to work with commonly available 7W LED panels. In our prototype design we use 7W 24V warm-white LED module to test this system. To drive other LED modules change value of the R5 resistor of the current limiter circuit.

7W LED module used in prototype build

LED modules, heat-sink and lamp enclosures are now commonly available in the market but make sure to use good quality 24V - 28V LED module with this circuit. During our prototype we found lot of defective LED modules in the market.

Battery backup

This unit is designed to work with 24V - 3A power supply unit. 3V button cell is required as back power source of DS1307 RTC. Supplied PCB is designed to work with CR2025 or CR2032 type button cells.

Circuit assembly

For this project we use commonly available, less expensive electronic components and PCB is designed for "through-hole" type components.

Both Q1 (STP55N06) and U4 (LM7805) required heatsinks. If heatsink is shared between both devices make sure to use proper isolation in either Q1 or U4 (or both).

J3 to RS232 pin mapping for DB-9 connector is listed in below:

J3DB9
Pin 1Pin 2
Pin 2Pin 3
Pin 3Pin 5

Firmware

PIC16F883 firmware is developed using MikroC Pro for PIC. Compiled HEX file is available at release section of this repository.

Programming the system

This system is designed to program using RS232 serial port. User can modify system time, light start and end times by connecting this system to any computer through RS232 serial port. To program and view system information user can use any serial terminal application like minicom, putty, etc. with baud rate of 9600.

Once system is connected to the host PC it can switch to programming mode by sending Enter or Space key stroke through the serial terminal.

If host PC is not equipped with serial port, use USB to RS232 converter cable / module. During our tests we use couple of USB to RS232 converters (such as FT232 and CH340) without any issues.

Bill of materials

IdComponentQty
U1PIC16F883-IP1
U2DS13071
U3MAX2321
U4LM78051
Q1STP55NF061
Q22SC9451
D16A101
Y132.768 Crystal1
BT1CR2025 or CR2032 battery holder with battery1
R1, R2, R34.7K3
R4, R610 K2
R52.2R - 3W1
C14.7 MFD / 16V1
C2, C3, C4, C510MFD / 16V4
C60.33MFD / 63V1
C7, C9, C10, C110.1 MFD / 63V4
C8470 MFD / 35V1
F112V 1A Fuse1
L1VK200 - 3 turns1
BZ1KXG1203C or 5V DC PCB mount buzzer1
J12.54mm - 2 Way, 1 Row PCB header1
J22.54mm - 3 Way, 1 Row PCB header1
J3, J45.08mm - 2 Way PCB terminal block2
7W 24V/28V LED module and heatsink1
3mm Red LED1
DC 50V Rocker switch1
DB9 Female Connector1
Panel Mount DC Power Socket1
TO-220 heatsink2

Datasheets

License

This is an open hardware project and all it's source code are released under the terms of MIT license. Schematics, PCB designs and other resources are released under the terms of Creative Commons Attribution 4.0 international license.

Comments

No comments yet. Be the first to ask about this board.

Askabout this board