In this instructable I have documented how to build an LED sign with a darkness / light sensor and a PWM dimmer circuit built in.
I got bored over Christmas and soldered together a quick project inspired by the youtube intro video intro's for "GreatScott!". I fancied putting my own name in lights, but I thought soldering a 150+ LED's in parallel isn't that challenging, so I thought I'd make it a bit more interesting.
My LED signs have a dark/light sensing circuit to switch on at night and turn off in the day. I also later added a PWM circuit to adjust the LED brightness (the LED's I had in my junk bin ended up being super bright :-S). Most of this build is from stuff that I already had rather than sourcing new things to save money, so before you ask why I used X component instead of Y......now you know :-)
Step 1: Circuit Concepts
There are many different ways light/dark circuit's can be built, the most common methods use one of the following circuits (All three use an LDR or light dependant resistor on it's input):
- A 555 timer with a transistor on pin 3
- A LDR as part of a voltage divider which triggers an NPN transistor
- A voltage comparator (op-amp / comparator IC)
Since I had soooo many assorted op-amp's and comparators in my parts bin I decided to use an LM311. The comparator simply compares the input voltages on it's inputs. The output is high when the inputs are the same/greater, and or low when one input is lower than the other. In my case when the LDR voltage is higher than the reference voltage set by the potentiometer, the output is pulled high, activating a small relay, which activates the brightness controlled LED's. A capacitor is placed in the circuit to prevent rapid switching of the relay when the input voltage is oscillating above and below the reference voltage. A MOSFET could be used here but again I had loads of small relays left to use so I used one of those instead.
For the PWM circuit I used the classic 555 timer vary the voltage to the LED's (see attached schematic).
Note: In the PWM schematic Rload is the LED Matrix you want to control, in the brightness schematic Rload is technically the PWM circuit in this case, but you could switch the load directly if you like.
Step 2: Build a Test Circuit
From the schematics I built test circuits on two separate breadboards and tested initially using a single LED. Right hand side is the dark/light detector, and the left hand side is the PWM circuit. The brightness detector circuit switches the whole circuit on/off and the PWM circuit adjusts supply voltage to the LED matrix.
My intention was to power off a 5V, 1A mobile phone charger through a micro usb breakout connector. The circuit was prone to rapid switching close to it's switching point (particularly at dusk when light levels are of an intermediate brightness) so I placed an unnecessarily large 2200uF capacitor across the transistor to hold the switching voltage during voltage dips. Depending on the amount of current your load sinks will determine it's effective load resistance and thus forms part of an RC network with the capacitor. The amount of time the capacitor holds the charge voltage can be found using the time constant formula t = R x C. You should be able to calculate a suitable value using this formula. In reality you should keep energy storage components like capacitors as low as possible to minimise unnecessary power consumption.
I used Loch-Master to space out a name I wanted to solder my 5mm LED's to. I like to use 2.54mm pitch longitudinal strip-board (a.k.a veroboard). All LED's are soldered in parallel (this is not good practice, where possible you should limit the current to each individual LED with a separate resistor).
Step 3: Assembly
The following step involves a unnecessary amount of hot glue. It is perfect for lazy people like me who just want to join things quickly.
Once I had plotted the name out using Loch-master I soldered all the LEDs in parallel. Both PWM and brightness circuits were soldered on one piece of stripboard. The LDR was separated from the main circuit on flying leads so that the sensor itself could be glued into a hole on the front of the bezel. These were then mounted onto a piece of insulating PVC, which was then itself glued onto the back of the LED matrix.
Knowing the dimensions of the LED matrix from Loch-Master I made a black PVC bezel to surround the LED matrix and make it look pretty. I made a template to fit onto an A4 page so this could be printed on paper and placed over 5mm black foamboard. I then taped down the template using masking tape and carefully cut out the middle and the edges with a craft knife. I also made a matching one without the cut-out in the middle for the back. The surround was then offered up to the LED matrix and simply glued on. Both the circuits were then glued to the back of the LED stripboard (notice that these have been separated using some PVC).
Finally a back panel was added by using M3 screws inserted from the front and black spacers (stand-off's) fixed into them. This allowed the back panel to be threaded on top and held in place by six M3 nuts and washers.
Step 4: Enjoy!
I hope you enjoyed this sporadic weekend project. There is alot of room for improvement on this as it was just a bit of fun, but I hope I've inspired you to make your own. You could use just the PWM circuit on it's own and vary the brightness of the LED's depending on the light levels depending on the time of day.
The circuit principles can be used for other cool things like thermostats (swap the LDR with a thermistor) or motor variable speed controls with the PWM circuit.