Showing posts with label LED. Show all posts
Showing posts with label LED. Show all posts

Sunday, December 18, 2011

Individually Addressable and Dimmable Christmas Lights


This project was inspired by a Radio Shack print advertisement or similar article showing how to make a strand of Christmas lights using LEDs and an Ethernet cable connected to an Arduino controller.  I stole the idea and created the rest from scratch.


Christmas LED Shield
I found some large 1cm diameter LEDs that look like jelly beans at a local surplus electronics warehouse, and swapped out a black Ethernet cable that was in use in my house.  Having just completed assembly my Arduino Duemilanove kit, and being the middle of December, assembling Christmas lights seemed like the logical next project.  Originally I was going to place the LEDs 11 inches apart to use up the entire length of Ethernet cable, but my wife talked me into having them closer together, so after making cuts in the outer covering at 11 inches, I made additional cuts halfway between them, now every 5.5 inches. 

Curtain Rod Installation
The point of using an Arduino is addressing the individual LEDs.  As the Ethernet cable has eight wires, that could accommodate seven LEDs (seven lines of power, one common ground), so the original plan was to include seven and the Christmas Light Shield shown does support seven LEDs.  But the Arduino Duemilanove supports exactly six PWM (pulse width modulation) outputs at D11, D10, D9, D6, D5, and D3, so I settled on a six LED strand.  Each light can be individually dimmed to a resolution of 256 values (0=off, 255=bright).  This allows the lights to chase, flash, dim, and perform other light patterns.  Two inputs (in addition to reset) were added to the shield to control the nine patterns of the lights programmed into the Arduino.



The shield was built on a empty prototype PCB, with an attached RJ45 jack and corresponding breakout board.  The lines of the Ethernet jack were wired to the PWM ports using 500K resistors.  The switches were wired to inputs at D2 and D8 with 18K pull down resistors, and those circuits are wired to 5V when the switches are pushed.  The RJ45 jack turned out to be a great way to connect and disconnect the wires.

Merry Christmas!

Tuesday, October 11, 2011

Indoor/Outdoor Thermometer Shield for Arduino

This is a dual thermometer shield for Arduino.  It has ports for two temperature sensors (LM135, 235 or 335).   One sensor is local, and another can have an extended length of three conductor wire and encased in shrinkwrap tubing for weatherproofing.  The shield alternately displays the state of each of the temperature sensors in Fahrenheit. 

The temperature sensor portion of the circuit is tiny, less than a quarter square inch.  The majority of the circuit area is for the seven segment LED drivers.  The LED circuit includes 74HC4511 (one 7-segment led driver), 74HC138 (demultiplexer for led selection), and two 74HC04 chips (logic inverters).  Only one LED segment is lit at any one time, using interlacing it appears that all three are lit at once.  Using the 7-segment driver, only the digits 0-9 can be displayed, no negative numbers.

Voltage regulation is very important for this circuit, as a change in voltage will result in a change of reading.  Potentiometers are included for calibrating the sensors.

Headers are included for SPI and 5V power, to support a custom Ethernet adapter and custom SD card adapter.  Using pass-through connectors for supporting a shield on top of this one was not a priority.  A jumper is provided for running the circuit at 3.3V, but 5V operation is preferred for LED brightness; and due to the 74HC chips, the logic is compatible with any 3.3V Arduino that can source 5V power.  This shield was built on a ProtoShield and has been successfully tested with the 5V Diavolino (Arduino Duemilanove clone), 3.3V chipKIT Max32, and 3.3V GHI Electronic's Panda II.



Shield working with PIC32 based Max32
Now logging to SD card with Panda II board

Monday, September 19, 2011

Car Alarm

This summer an opportunistic small time thief has been roaming our neighborhood stealing ipods from unlocked cars.  To discourage them messing with our vehicles, I built this circuit and installed it in my wife's car.  We use a rechargable 9V battery and recharge/replace it about every two days.  This project was fast to develop and satisfying to see in action.




Build #2 with battery inside

Wednesday, September 14, 2011

LED Bar

In bread boarding a micro controller circuit, one of the most popular components is an LED.  Light up an LED to indicate power connected, turn it on or off based on a mode change, or flash an LED to indicate the CPU is working.  Because LEDs are typically rated for less current than a CPU or power supply can provide, they require a current limiting resistor to keep them from burning out. 


One of my tasks in learning about new processors, is to see if I can configure every line as an output port, and if I can run the CPU at its maximum speed.  I set up an integer counter in my code, and bit shift the value into all the output lines I care about.  Using this LED bar, I can insert it into the breadboard next to the CPU pins, flip the switches off to lines I don't want to bother or mess with (like crystals, voltage regulator configuration, USB lines, etc.) and if everything works out right, watch the lights blink on and off in binary code.

The LED bar has nine LEDs in a row encased in green plastic, with 18 pins (upper pins are the cathode and the lower pins are the anode).  Nine current limiting resistors connect the cathodes to ground through eight switches.  The rightmost LED is used to indicate power and bypasses the switches; the jumper in the upper right is the ground (top) and power (bottom) connections.  These components are placed on a mini circuit board with pins so it can sit upright on a breadboard.