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

Sunday, January 18, 2015

Space Sombrero

For Halloween I decided to put some LEDs controlled by an MSP430 on a sombrero. Unfortunately, I did not finish in time to take it to the Halloween party at our hackerspace but I did finish working on it the last week.

The LEDs are soldered in three 4x4 matrixes, one matrix for each color. My plan was to combine red, green, and blue into one point diffused with ping pong balls. In the end I skipped the diffusers. The LEDs are bright enough on their own. They are taken from a string of Christmas tree lights so the total of 48 LEDs cost about a dollar. Something like NeoPixels (WS2812) would have been better for this project but would have been much more expensive.


Each color is run by its own 74HC595 shift register, so only one LED per color can be on at a time. This reduces apparent brightness when several LEDs are driven by PWM but is still brighter than using only one matrix for all the LEDs. With a 1k resistor they are very bright, which I noticed when experimenting with them before. Everything is controlled by a small PCB. Each matrix is connected to a Cat5 ethernet cable which has four twisted pairs, exactly enough to multiplex 16 LEDs. The two knobs control speed and color of the patterns and a button switches between patterns. Altogether the hardware is really simple, though there were some headaches soldering the board. The legs of the potentiometers are very weak so I soldered header pins to the back of them for stability. They are really sturdy now but Vcc was shorting through the body of the potentiometers. Once I fixed that, there still showed only about 4k resistance between ground and Vcc. A tiny fleck of solder on the metal body of the power switch was also causing a short. After fixing that there was still a 33k resistance between ground and Vcc. Desocketing and unsoldering narrowed it down to the L4931 voltage regulator. Several other L4931s I measured had the same resistance. After putting everything back together, it worked fine.

The potentiometers and knobs for them came from my local electronics store. They are logarithmic, although linear would work much better for communicating speed to the microcontroller. Converting the curve mathematically seemed pretty tricky, so I used a look up table of a few measured values instead. After soldering the potentiometers onto the board, I realized that the seven values I measured were not enough, so I plotted them on a graph and extrapolated more points. The values I came up with work pretty well, though when changing colors the distances between points don't feel exactly even. The next time I use potentiometers like this I will try to do a lot more exact measuring before soldering them so the points will be more even.

Here is a short video of a few patterns I programmed in. You can see how the speed and color knobs work. There is a lot of room left in the flash for more patterns but this is enough to consider the project finished.


Thursday, November 27, 2014

Progress Report (Sort Of)

So I have not updated my blog in a while. Grad school is keeping me pretty busy. Most of what I do with electronics now is related to the local hackspace I joined. I was able to use some tools there to shorten the bolts for the case of my RPN Scientific Calculator and I also have access to a laser cutter and 3D printer that I eventually want to use to make keys for it. One of the members there and I decided to start on a project together. We have not made enough progress yet to post about but we did finish a schematic of what we plan to do. For this we have both EPROMs and EEPROMs. The EPROMs have a small window and can be erased with UV light, though the lamp we have does not seem to be working. They would also need a higher voltage source to write them and I want to make a voltage multiplier when time allows. If I can get that working, it might also help me with another project that needs -27 volts for LCD contrast.

Another neat thing I have experimented with at the hackerspace is the Spark Core. One of our members was able to get a hold of several of these for us. These tiny little boards let you connect a microcontroller to Wi-Fi pretty painlessly. This would work really well for a project idea I have that I have not started on yet. One thing I don't like is the Arduino-like environment used to program them with but I think I could get used to it since I would probably use my own microcontroller for everything but Wi-Fi. Another idea would be to simply use the CC3000 chip the board uses without the Spark Core board, though that may be too complicated to be worth it. It seems that the newer Spark Photon uses a different chip which could be easier to use by itself, though Spark Photons are not scheduled to ship until March.

One thing I have been working on on my own is a sombrero with LEDs. It was supposed to be part of a Halloween costume, but I did not finish it in time. Each color (red, green, and blue) is soldered as a 4x4 matrix that has its own shift register. It might have been possible to solder all 48 LEDS (16 each of red, green, and blue) as a 6x8 matrix and use one less shift register, but this way lets me keep each LED on three times longer. NeoPixels would have worked well for this project but just one of them costs almost as much as all of the LEDs. The board for controlling everything is finished. Now all the LEDs just need to be sewed to the sombrero and the firmware written to control their flashing. In order to save time I only soldered buttons to the board for controlling the patterns of the LEDs, but I do have some nice potentiometers I bought that I now have time to use instead. Reading their value with an MSP430 worked great on the first try and I displayed it on my one wire debug display.

Friday, March 8, 2013

Reusing LEDs

Before I got a hold of the red LEDs I used in the 3x3 LED matrix, I was having a hard time finding a local source for LEDs of any kind. When the holidays rolled around I had a look at some of the Christmas tree lights that were for sale and for a few dollars I bought a string of 100 white lights that look like this:



As you can see from the picture, the head is concave. This type is easy to see from a distance but doesn't look very good on a breadboard. The string of lights this LED came from consists of four seperate strands. The first few LEDs on each strand have resistors soldered to their legs as you can see here. This makes them convenient to plug into a breadboard, even though concave LEDs don't look very good up close.

Later on I found a similar string with frosted convex LEDs. Each of the four strands of 25 LEDs was a different color. I bought several boxes and in the end I paid less than 3 cents per LED! The first few lights on each strand also have resistors soldered to the legs:



One thing I found very interesting about these LEDs is that they grow very brightly. The resistors soldered to the legs are Orange-Black-Red-Gold. This should mean that they are 3000 ohm resistors. In order to get 20mA out of these LEDs I would need around 60 volts. However, when hooked to the 3.6v of my LaunchPad they glow very brightly. By my calculations, if the forward voltage of the LEDs is around 2 volts, the LEDs should be using less than 1mA when the supply voltage is 3.6v. Clearly something isn't as it seems!

Hopefully, I can repurpose some of these LEDs to make a matrix. This should be convenient since they already have wires soldered to their leads. Since each string has four different colors, I don't have enough LEDs to make a large matrix of only one color. My plan now is to combine a red, a green, and a blue LED together to make one RGB pixel. Like other matrixes I saw on the internet, I tried ping pong balls as diffusers. Here is the result using four of the colored LEDs and one of the white ones:



They seem to diffuse very well but ping pong balls here are too expensive to be used for a whole matrix. Once I find a better way of diffusing light, I can move on to soldering the matrix.

Wednesday, March 6, 2013

3x3 LED Matrix

A friend of mine recently asked about making a small LED sign for his business that can scroll text. It seems that buying such signs is pretty expensive. To give him a little demonstration of how it would work I made a small 3x3 matrix of LEDs using a 74HC595 shift register. Using multiplexing it is possible to run a 4x4 matrix with only one shift register but I didn't have that many matching loose LEDs on hand. I was able to draw some simple patterns using an MSP430 and even do some PWM to dim the LEDs.



One thing that surprised me was that the cheap red LEDs I used burned out almost instantly when hooked up to the supply rail without a resistor. Running an LED without any kind of current limiting is of course a bad idea but it was a surprise that these failed so quickly. Others I have experimented with worked without any noticeable damage for a few seconds when hooked up to the few 100mA that the MSP430 LaunchPad can source.

Also, although these LEDs appear to be identical and were bought at the same time from the same store, one of them seems to glow at least twice as bright as the others. Some LEDs I have used seem to glow a little dimmer than others from the same batch but I've never seen one like this that glows so much brighter. I'm not sure what causes this.

Tuesday, January 22, 2013

Binary LED Calculator

After comparing the new solder joints to the ones I was making with the old iron, I decided to start completely over with the LED Binary Calculator. This time I used DIP sockets and new protoboard I was able to buy when I bought the new soldering stuff. This protoboard is 25 holes wide which is really convenient since each of the eight LEDs needs three holes width. There were also just enough of the old red LEDs I was using before to start over with. The solder didn't take to them very well at the beginning so I had to scrape off a lot of the coating that had formed on it. Because I didn't have a battery holder, I soldered on an 8 pin DIP socket to use as a power connector. I taped wires to a CR2032 battery and I stick the ends into the socket for power.


After soldering everything together I ran a test of the LEDs. They only worked correctly once and the only way to get them to work again was to remove both the shift register controlling the LEDs and the MSP430. Toggling the master reset of the shift register didn't help either. Upon closer inspection it turned out the ground connection to the MSP430 had come loose. I was surprised that it ran at all with no ground connection but I have seen it do something similar on a breadboard too. The buttons worked fine from the beginning except that two of them were linked by a solder bridge. After I fixed that, the whole calculator worked as expected.

Sunday, December 2, 2012

First Project

After flashing a few LEDs and reading a few buttons with my new MSP430 I decided to start work on a simple calculator. For output I am using eight LEDs to show the numbers in binary. To do this I am using a 595 shift register. Since I am using an MSP430G2533 I would have enough pins to light the LEDs without it but I wanted to practice using shift registers and be sure I would have enough current. For input I am using a 165 shift register. This will give me room for eight buttons. I have always been a fan of Hewlett-Packard's line of RPN calculators so I decided to use this notation for my calculator too. The eight functions I decided on are 1, 0, dupe, swap, push, pop, +, and -. Programming these simple functions was not difficult. After I saw that everything worked fine on a breadboard running from a coin cell battery, I started soldering it onto a piece of protoboard. This will be good practice since I have never soldered anything before. So far only the LEDs have been soldered but I hope to finish the rest soon. Here you can see the protoboard and the breadboard with the parts of the circuit that haven't been canabalized yet.

Saturday, December 1, 2012

555 Timer Setup

Recently I set up a 555 timer and three AAA batteries to experiment with. The first thing I wanted to do was flash an LED. I wrote a program that will let me figure out the frequency of the flash, size of the capacitor, or the values of the resistors. I decided on a 10uF capacitor and a 100k resistor to give me a blink slow enough to see. This was interesting but then I decided to put a potientiometer in place of R2 so that I could control the rate of the blink. I also put a potentiometer in place of the resistor to the LED so that I could control the brightness. Tuning the potentiometer so that the LED wasn't very dim or very bright was difficult. After doing some reading I saw that it is possible to adjust the on and off times independently of each other if you use a diode with R2. I replaced R1 with a potentiometer so I could control both the length of the flash and the pause between flashes.

Next I connected a piezo speaker to the timer. It ticks every time the current to it is switched on or off. According to the datasheet, the current doesn't have to be turned off but should actually be reversed. I am not sure how to do this with less than four transistors. By using the potentiometers to make the timer pulse quickly, the ticks of the speaker come fast enough to blend into a tone. I tried using smaller capacitors from the TV I took apart with the timer and the tone was much higher. I put another potentiometer in place of the resistor to the speaker to control the volume. One thing I noticed is that the speaker made a growling sound when I tried to turn the volume up too high. It seems that the timer was failing and restarting many times a second because the circuit was drawing more than the 200mA the timer can source. To remedy this I put a resistor in series with the volume potentiometer. This is also a good idea for the other potentiometers so that the timer and LED don't get damaged either.

Thursday, November 29, 2012

Recent Scavenging

A few months ago I came across an old radio/record player and salvaged some of the parts. There were a lot of orange capacitors of different sizes. Some were square and marked 47n for 47 nanofarads or 2n2 for 2.2 nanofarads. Others were round and marked "6800 H70" or "15000 H90." Apparently the 6800 stands simply for 6800pF. I am not sure why they are labeled 6800 and not 6n8 like the other capacitors or why they are shaped differently either. Luckily the leads were long on all of them so I can use them for experimenting on my breadboard. I also got some good potentiometers.



A few weeks later I found an old television from the early 1980s. It had a lot of small potentiometers on the back which I think were used to adjust the picture. They are convenient to use on a breadboard because the two wires are stiff enough to keep them vertical. There were four potentiometers on the front too I kept as one panel. Also, I kept some of the vacuum tubes. They need high voltages to work so I won't be using them on my breadboard any time soon, but maybe I can use them for something interesting some day. The last things I kept were some canister diodes.