Auto Light

by Suraj Grewal in Circuits > LEDs

662 Views, 0 Favorites, 0 Comments

Auto Light

1511346265229637873418.jpg
Auto Light-test
IMG_20171016_211044851.jpg
1511346294639991847243.jpg

This circuit switches on it's light when it detects 'darkness'

it uses

attiny13a

irf830 mosfet

a potentiometer (I had 10k ohm in my case)

and an array of leds with appropriate resistor.

The Hardware.

advanced.png
for polarities.png
for loads with requirment greater than 5v.png

The pcb can be made in 2 different ways for 2 different purposes

the first is for external light

the second is for LEDs soldered onboard.

the third picture describes how one should connect the board for external light source.

The ldr should be in the shadow of the light source of this circuit but able to sense ambient light,in order to prevent it from triggering itself off and make itself flash.

the attachment contains fritzing files for you to modify the layout,if you need to.

Downloads

The Code & Uploading It

for programming.png
for usage.png

The code simply turns the attiny13a into a comparator and copaires the voltage coming from potentiometer and ldr

Solder the microcontroller ic first.The image shows the pin diagram to help program attiny13a after it's been soldered onto the board.I used this metod to program it. I used avrdude commandline software to upload the code (.hex file) onto it it,but you can also use ponyprog2000.

Then slolder the rest of the components and refer to second photo.

the code was written in atmel studio and can be easily modified to suit your needs