About Erica

  • Website: or email
  • Biography: Business owner, musician, cyclist, and tinkerer. Harvard undergrad, Ph.D. in physics from Columbia. Wife of Bruce, mother of Holly and Laurel.

Posts by Erica:

 
0

Expanding the Arduino: cheap ways to add output pins and power

on Jun 9, 2010 in Electronics, Making

For the LED stairs, I need to control 14 LED lamps and 2 sensors. From the beginning, I had in mind an Arduino as the microcontroller for this project. Although it is possible to do a primitive version of these stairs without a microcontroller, having a brain at the center gives many more options. And a basic Arduino is (relatively) inexpensive. The Arduino Pro Mini, which I am planning to use, is only $19.

Arduino Pro Mini

Arduino Pro Mini

The Pro Mini has 14 digital input/ouput pins. Each output pin can produce 5V and up to 40mA. This is more than enough for a single LED. But I will be using LED lamps that require 12V. We don’t have enough power.

Antoher issue: these pins need to control all the LED lamps plus the sensors. And if you want to do any debugging, 2 of them need to be reserved for serial communication. We don’t have enough pins.

I was able to come up with solutions to these problems. It occurred to me that the need for “more pins, more power” must be a pretty common one for micrcontroller projects in general and this might be useful for other people to know.

How to add output pins

The simplest way to increase the number of ouput pins is just to buy a bigger board. The Arduino Mega provides a whopping 54 output pins. But it will cost you: the Mega is $50. And unlike the basic Arduino, you are limited in your choices regarding form factor and input power. It’s big with lots of deluxe options and that’s what you get.

The way around this is to use the Arduino to talk to another chip, called a shift register. An example of this is the 74HC595. The Arduino takes a few pins to talk to the shift register, which has 8 output pins of its own. The Arduino tells it which ones to turn on and off. Even better, the shift registers can be daisy chained so that one Arduino can talk to multiple shift registers without using any more Arduino pins.

This does increase programming complexity because the Arduino must talk to the shift register in a specified protocol. Fortunately, there is code out there that other people have written (this is the nice thing about using a popular platform). There is an excellent tutorial on the Arduino site called ShiftOut. There is a lot of stuff on the the site but it can be very hard to find, and that was true here.

As for cost, a 74HC595 will cost $0.35 or less…much cheaper than upgrading to a Mega!

How to increase output power

I already knew the answer here: add a transistor. The output pin switches a transistor which can be used to carry much greater current and voltage. The question is, the best way to implement this. I already had a painful experience in building my Speed Vest. In order to drive the electrolumincescent wire, it was necessary to switch high voltage, AC power. For that project I blindly followed the authors’ design and soldered 13 triacs in point-to-point wiring on an Arduino shield. That was not an experience I wanted to repeat.

Integrated circuits are all about packaging transistors together, right? I should at least be able to find a chip where they shared a common input voltage and ground, which would reduce the number of connections required by a factor of 3. And if it includes the protective diodes, even better. There is a famous chip that does this, called the ULN2803A. It has eight Darlington array transistors and is designed to be controlled by the 5V logic the Arduino uses. Since there is one pin for each transistor, no programming is required.

For a nice overview of this topic, see this article on using microcontrollers with switching transistors.

Cost of the ULN2803A? I got it at Arrow for $0.51.

Doing both at once

So far so good. We could take care of everything by adding 2 shift registers and 2 Darlington arrays. Pretty good but more components than I’d like. Is it possible to find a chip to do both tasks at once? Yes.

More knowledgable readers may already be wondering about LED matrix drivers. Using an Arduino to talk to sets of LEDs is a very common task and there are no shortage of articles on this. There are some nice libraries that have been developed too. In general they were not suitable for this project because despite the word “LED” I am seeking to drive higher power devices — LED lamps. Also, the matrix paradigm imposes certain requirements as far as connections and addressing that weren’t relevant here and that I preferred to avoid.

Eventually though I found the right kind of LED driver: the M5451. It can handle 12V power and can control 35 devices with a unified brightness control. Although the brightness control isn’t required here, it is a nice feature; the right type of signal — pulse-width modulated – can extend the life of the LEDs.

Next step, find code that allows the Arduino to talk to the M5451. (I am not that interested in writing device drivers.) Fortunately this chip is used by the Lightuino, which is an open-source project that (with some modification) has the code I need.

Cost of the M5451 (also listed as MM5451 at some suppliers): $3.15.

Although the M5451 should do everything I need, I’ve ordered the other two chips as well just to see how each option works. I suspect they will be useful for future projects too. Can’t wait until everything shows up and I can start breadboarding!

Tags: , , ,

 
0

Automated LED stair lights

on Jun 4, 2010 in Electronics, Making

I’ve been hunting for a new project to do ever since completing my contest entry for Robie. I’ve done a number of interesting small things, mainly with the kids, but nothing too big. Then recently Make: Online featured this:

When someone walks on the first step, the LEDs light up in sequence. Aside from looking cool, [...]

 
1

Made by Hand: Searching for Meaning in a Throwaway World

on May 31, 2010 in Making

Memorial Day weekend is a good time to catch up on reading, so I picked up this DIY manifesto by MAKE editor and Boing-Boing founder Mark Frauenfelder. It was an easy and pleasurable read.
The book starts off dramatically with the author’s decision to move his family to a South Pacific island. He quickly learns, along [...]

 
0

Potato batteries

on May 24, 2010 in Electronics, Making

Â
Laurel went through a rite of passage last week, her first science fair. This was a non-competitive event, an Arts and Technology Night organized by her school. She really wanted to exhibit something so we got her signed up.
After looking online for ideas, Laurel chose to do food batteries. Batteries are very simple — two [...]

 
1

Playing with a solar robot

on May 18, 2010 in Electronics, Making

Holly has been begging to build her own robot ever since I made Robie. Fortunately there are some excellent options for kid-friendly robot kits. After browsing the MakerShed we decided to get the 6-in-1 Educational Solar Robotic Kit.
This was a good choice. As the box states you can make six different robots. We’ve done three [...]

 
0

More toys for the workshop

on May 17, 2010 in Making

During my robot build, I was constantly wishing for a drill press. I put off purchasing one because I couldn’t decide if I really needed a full-sized press, where to put it, etc. I eventually stumbled on a drill press that is small enough to fit on (or be stored under) my worktable, but has enough [...]

 
0

Automating Windows

on May 13, 2010 in Web and Computer

I have a great job (read: limited hours, excellent pay) but one of things I like least about it are the repetitive IT tasks I have to do. Things are stable enough that a full sysadmin would be a waste of money, but still, certain things have to get done. For a long time I [...]

 
0

Robie the Robot lives!

on May 9, 2010 in Making

A few days ago I put in the obstacle avoidance programming for the coasterbot. Almost immediately, he acquired a real personality. The algorithm works incredibly well. Even though the first version of my code had significant bugs — typos, forgetting that moving the sensor servo takes a finite amount of time, etc. — he was [...]

 
0

Coasterbot gets a pair of eyes

on May 2, 2010 in Electronics, Making

I was featured in MAKE Robot Dispatch #7 — thanks guys! Hard to believe that there is less than a week left in the contest.
One of the requirements of the contest is for the robot to do some obstacle avoidance. The Jameco bundle came with some switches to do bump sensing. While this might be [...]

 
0

Coasterbot moves!

on Apr 26, 2010 in Electronics, Making

With the electronics done, it was time to go back and work on the chassis. As before, the DVDs are linked with screws. I wanted the servos to be firmly attached. Since we removed the controller units, this left a lot of empty space in the case, allowing for this type of attachment:
I still don’t [...]

Copyright © 2010 NovoKane All rights reserved.
Desk Mess Mirrored v1.4.5 theme from BuyNowShop.com.