LED Badge

LED Radiation Badge


One of the themes of my haunted house was an alien invasion, I wanted to make some interesting badges we could wear. This one is a simulated radiation detector, with an led bar graph that counts up and resets, Looking like there is a rise in radiation. I happened to have access to a card printer so I designed and printed a few cards to try out.

I used a PIC18F2550 micro controller because it has enough outputs to control the LEDs I want, It is easily programmed in basic and has a small foot print, it can also be run on 3 volts. All you have to do is connect the output pins of your micro controller to the positive pins of the LEDs of the segment graph. I wanted the smallest parts count possible for this project, and with only 5 parts making up the circuit it works well. The card is still almost flat and can worn with out a problem. The 10k pull-up resistor is placed directly on top of the chip and solder directly to the pins, and the pic chip is connected directly led chip. I glued on a single 2032 button cell holder on the card to power the lights and the chip.

To wire the lights up, you connect the negative side all together, Each of the lights positive pins will connect to one pin of the micro controller so that it can address each one individually.

I used swordfish compiler to program the chip, because I like coding in basic. The program is very simple and is designed to turn the lights on and off.

CODE:

This is the code that I used to control the Badge, all it does it set up the pins on the micro controller and then turns them on and off in which ever order it is programmed in.

Device = 18F2550
Clock = 8
Config FOSC = INTOSCIO_EC

Include “utils.bas”

Dim LED1 As PORTB.7
Dim LED2 As PORTB.6
Dim LED3 As PORTB.5
Dim LED4 As PORTB.4
Dim LED5 As PORTB.3
Dim LED6 As PORTB.2
Dim LED7 As PORTB.1
Dim LED8 As PORTB.0

// Start Of Program…
OSCCON = %01111111 // Sets up the internal oscillator
SetAllDigital // Make all Pins digital I/O’s
// Make the LED pin an output and Low(LED1)
Low(LED2)
Low(LED3)
Low(LED4)
Low(LED5)
Low(LED6)
Low(LED7)
Low(LED8)

While True
LED1 = 1
DelayMS(200)
LED1 = 0
DelayMS(200)
LED1 = 1
DelayMS(200)
LED1 = 0
DelayMS(200)
LED1 = 1
DelayMS(200)
LED1 = 0
DelayMS(200)
LED1 = 1
DelayMS(200)
LED1 = 0
DelayMS(200)
LED1 = 1
DelayMS(200)
LED1 = 0
DelayMS(200)
LED1 = 1
DelayMS(600)
LED2 = 1
DelayMS(600)
LED3 = 1
DelayMS(600)
LED4 = 1
DelayMS(600)
LED5 = 1
DelayMS(600)
LED6 = 1
DelayMS(600)
LED7 = 1
DelayMS(600)
LED8 = 1
DelayMS(600)
LED8 = 0
DelayMS(100)
LED8 = 1
DelayMS(100)
LED8 = 0
DelayMS(100)
LED8 = 1
DelayMS(100)
LED8 = 0
DelayMS(100)
LED8 = 1
DelayMS(100)
LED8 = 0
DelayMS(100)
LED8 = 1
DelayMS(100)
LED8 = 0
DelayMS(100)
PORTB = %00000000
Wend

What you will need:
1. Printed Badge of your choosing
2. PIC18F2550 (PICKIT 2 or other programmer)
3. 10 Segment LED Bar graph
4. 10 K Resistor
5. 2032 3 volt battery and holder
6. glue
7. Tools, Soldering iron, wire cutters
8. Wire

Finished:


Any questions or comments email: HauntHacker@Outlook.com