Blinking and Buzzing for Kids

I work at the public library, and I’ve recently become very involved with the children’s department. One of the things I’ve done is whip up a neat project for a summer reading program. The theme for summer reading this year was science, and a coworker and I came up with the idea to do the squishy circuits activity that Dr. AnnMarie Thomas came up with at St. Thomas University. Basically squishy circuits is play-dough that’s been formulated to conduct electricity reasonably well (in the range of kOhms per square inch). You give the kids a battery and an LED, and it’s a great way to demonstrate how electricity flows through a circuit. Since it’s basically play-dough, the kids can get really creative, and make sculptures with the dough, then create a circuit out of it. One of the kids at a school visit made some roses, and one group made an alligator with light-up eyes (which didn’t work very well, unfortunately).


In some of the St. Thomas documents, they used an arduino to change the color on an RGB LED and another to change the pitch of a little speaker. Basically, the ADC reads the resistance across a lump dough, and sends a value to tone() or analogWrite() based on that. On the first school visit we did, I used two Leonardo clones I had lying about, and those were a big hit. However, for the summer reading program, there’d be upwards of 40 kids, so two boards wasn’t enough, and we couldn’t afford to buy full-blown Arduinos (nor was that actually really necessary).

My solution was to make a tiny board based on the Attiny45. All that’s on the board is the Attiny, some resistors, a bypass cap, and a 78L05. I got the board size small enough that they cost something like 50 cents each at OSHPark, which fits nicely into a library budget. Total they were two or three dollars each, which I’m pretty pleased with. I even managed to squeeze the library’s logo onto the back of the board, which amused my coworkers to no end.


(You’ll have to forgive the ugly soldering, I thought it’d be a good idea to do 0603’s by hand with lead-free)

It was interesting to get these things working. There’s no ISP connector, so I had to come up with a jig to program the boards. I used another board with some pogo pins soldered onto the appropriate pads, and kind of sandwiched the boards together while I programmed them. This didn’t work quite right; I had to apply some lateral pressure to get the contacts to correctly. It’s not too bad for a one-off product. I don’t have any pictures of the programming adapter, unfortunately. It got dismantled and turned into one of the buzzers.

However, I ran into some trouble getting the LED program to fit on the Attiny. It’s only got 1K of flash, and I was over by just a few bytes, which was entirely maddening. It took me about an hour to figure out that the code was using floating point numbers, and the compiler seemed to be inserting a software implementation of floating point math. The hack to get it working was to remove the floating point numbers by multiplying them all by 100, then dividing by 100 at the end of the calculations. It’s not particularly elegant, but it works well enough for a bunch of 8 year olds.

The summer reading was a wild success, by the way, and all the kids from the school visits keep begging us to come back. It’s a hell of a lot of fun getting kids into electronics, it’s almost enough to make me want to transfer to the children’s department. Almost, but not quite 😉


Update: I decided to (or rather, finally got around to) make this an open-source project. Everything can be found on my GitHub page.

1 Comment

  1. brant

    July 30, 2014 at 1:35 am

    By the way, I do not recommend doing three separate programs in one day on a school visit if you’ve never done it before. We were there all day, it was awful.

Leave a Reply

Your email address will not be published.


© 2019 Brant Martin

Theme by Anders NorenUp ↑