Programming in a ZIF!

This is just a quick post about a board I made to program a whole bunch of ATmega 328’s for some kits I’m making. I am ordering the 328’s in bulk, so they are brand new and do not have an Arduino bootloader on them. One of the ways you can get an Arduino bootloader on a factory fresh 328 is use an Arduino Uno and a USBTiny. Sure, I could pop about 100 of these into an Uno, but that would be a lot of work as well as wear and tear on the 28 DIP socket on my Uno.

The answer? A ZIF socket! These are fantastic! Anyone who has installed/upgraded a CPU in a computer knows what these are. ZIF stands for Zero Insertion Force. That means you drop the chip in the socket very easy, then pull a lever down to secure the contacts and prevent the chip from bouncing out of there. Making swapping out a bunch of chips to program them a lot easier, faster, and less prone to damage to the pins or chips!

You can get these 28 Pin ZIF sockets at Adafruit, and for cheep! There is also a 40 pin version if your heart or project so desires. Sparkfun has this part in their Eagle library, if you don’t have it, and use eagle, I would get it. There is a lot of good stuff in there. πŸ™‚ And on another note, if you don’t have the Adafruit Eagle library, it’s worth having also.

You can download the board and schematic Eagle files here, or get the image version here.

And a big happy birthday to my first daughter Anna, who came into the world today!!! A future maker? Engineer? Who knows, but I can tell you this, She. Is. Awesome.

My new daughter!

πŸ˜€

Controlling high power (or high number of) LED’s with an Arduino

A while ago I posted about my bench lights, and have gotten a number of request for schematics and code. I’ll gladly put the code up, but I also wanted to explain what I did so that others can create their own, or at least change my design up as they wish. The transistors I’m using are TIP122’s. You can find the data sheet here. They will switch a lot of power, but keep in mind, they need to have adequate cooling if you are going to push them hard. Always remember, fire = bad.

I covered the basic schematic for a few LED’s in the video above, but if you have any questions, feel free to post them in the comments and I will answer as quickly as I can.

You can download the original (controller with LCD and hard buttons) code here.

You can also download the newer (serial controlled – adjustable level) code here.

Just a note, I will be using Vimeo from now on, but I will still put all my videos on YouTube as well.

Tic Tac Touch

OK, so I haven’t posted in a while because I have been working on some bigger projects, but yesterday, I took a two hour break and made a 2 player tic tac toe game. I did this with an Arduino and a 2.8″ touchshield from Adafruit.com. It’s pretty basic tic tac toe, and has score tracking, game logic (you can’t go twice in a row, and telling you if you win), and the ability to consume a chunk of time playing tic tac toe with my son. Below is the code, feel free to hack modify etc. If you play against a smart person (or yourself), you will have lots of Mosfet eye games! πŸ™‚

Download the code here. (Arduino 22 .pde file)

 

Multiplexing for a 7 year old

I have been wanting to make a LED clock for sometime and can’t really believe I never have. So I rummaged through some parts and found some nice 4 segment LED displays. I found some code for a simple clock at nootropicdesign, and it did something pretty neat. It slowed down multiplexing so you could see it, then it would get faster until it appeared “on”. It was a good sketch, but I thought, it needs set buttons, a blinking colon, and a way to trigger the multiplex slow down trick with out restarting. (and resetting the clock!) So I made this little clock and it worked great.

This was a great way to show my 7 year old (who wrote his first Arduino sketch the other night) about multiplexing. A picture is worth 1,000 words right? Well, a hands on demo is worth even more than that. After explaining how it works, he totally understood.

Then I noticed I had, sitting on my bench, some Lexan laser cut, for those little Nokia LCD’s I love so much, that had a 4 segment LED display size hole in them. I made the clock and moved some pins around to free up 3 PWM pins for an RGB LED. Because it’s always good to have a full PWM controlled RGB LED, ya know, just in case. Thinking of programming the LED different colors/brightness according to sun position. I also remembered I have a few Dallas 1307’s.. Maybe tomorrow, it’s late right now, and besides I’m busy porting software for a Touch Shield I got. πŸ™‚

If your new to multiplexing, it basically combines pins of LED’s and then through switching on only certain pins at a time, you can light only certain LED’s. If you were to apply power to more than 1 cathode and anode, you would get unwanted LED’s lighting. So how can this work? I have to light 14 LED’s just to display 1:00! What makes this work is you light one segment at a time. With a microcontroller, you can do this in an order and at a rate that’s fast enough that the human eye thinks that they are on solid. Most LED 4 digit displays found in microwaves, stoves, appliances, and VCR/DVD players are multiplexed. Its a great way to light a lot of LED’s with less pins than connecting each directly to the microcontroller. Below is a circuit diagram of the LED display I used. The link for the code is below as well, as always, hack away. πŸ™‚ Detailed pinout for Arduino are in the code comments.

Multiplexing!

Get the code here. (Arduino 22 .pde file)

Schematic (Eagle file)

Schematic (png file)

Arduino Police LED Strobes!

OK, sometimes your brain gets a little fried on a project and you need to decompress a little right? That happened a little while ago, and here is the result. I have this awesome little 10th scale 40mph+ Losi stadium truck I play with now and then, and I have always wanted to do this. While the strobe modes are manually controlled with buttons, I have an urge to crack open my 2 channel transmitter and put a little ASK radio in there. Nothing like the element of surprise eh? What I really would like to do is make it autonomous. πŸ™‚ Maybe later..

There are a few modes in the sketch, the video shows the first or “main” mode, but if you download the sketch the possibilities are endless to make calmer or even more obnoxious ones. I have noticed (not from my rear view mirror thankfully) the new LED bars on cop cars have a faster mode (almost like a boost mode) for high speed or high attention ares ie: intersections, but when they have someone pulled over, it is a slower pattern. Trust me, I know these things.

There are 20 (red and blue in: each of the headlights, tail lights, sides, and 4 red and blue in the light bar) “straw hat” style LED’s and they are driven by an Arduino and powered by a 3.7v Li-Po battery, you can buy them at adafruit.com. There is not an actual Arduino inside, just a 328 programmed with the Arduino IDE. It’s way cheeper that way. (I tend to put 328 chips in a lot of stuff) Below is the sketch for your hacking. A really good tutorial on “LED blinky modes” can be found from Lady Ada here. I actually learned a lot from this tutorial series a while ago, but still reference it from time to time. Good stuff.

Click the picture to see the full image of the truck (4.7MB) You can see how dirty it is.. :\

Download the sketch here. (Arduino .pde file)