Category: Uncategorized

ToyBrain Rides Again

Now with WiFi, current monitoring, and the ever-worrying li-poly battery chemistry.


I haven’t tested the WiFi module or motor drivers yet, but the board is fully populated and the battery regulation circuit works.

There are a few design changes in the pipeline, but I’m going to go for a full hardware test and try to find more bugs before I create version 2 of the boards.

The current design is in github, along with all the docs.

You've failed me for the last time,

I tried paying to renew my domain at I tried 5 times. In a normal business, if you try to pay, the business usually takes your money. Not So I’ve transferred my domain to 1&1, who will hopefully be able to take my money and provide me with goods and services in exchange.

Current State of The ToyBrains

The fuse settings on the current device are low:0xe2, high:0xda, and extended:0x5. I can talk to it via ICSP, and get the correct component signature (0x1e9514) back. What all of this says to me is that the ICSP settings are correct, and the onboard oscillator is running, so the chip is capable of having the bootloader installed.

It is entirely likely that I was using the wrong bootloader for my boards. I am using an ATMega328 running at 8MHz, so I suspect that the correct bootloader is ATmegaBOOT_168_atmega328_pro_8MHz.hex. This is important because an bootloader created for the wrong clock speed can still be loaded onto a board, but won’t be able to communicate over the serial port. The timings of the serial signals would be messed up, because any delay operations will become either too long or too short, depending on if the clock is too slow or too fast.

I got the latest version of the Arduino IDE, and modified the appropriate files as described at the end of this entry. In order to burn the bootloader, I had to be root, so I started the Arduino IDE as root and burned the bootloader, which apparently worked on the first try.

I quit and restarted the IDE, because I didn’t want to keep running as root, and plugged in my FTDI cable. Unfortunately, the IDE couldn’t compile my little test program because the arduino IDE ships with an old version of avr-gcc (4.3.2) and the ATMega328 wasn’t supported until later. I have avr-gcc 4.5.3, so I renamed the avr folder in /arduino-1.0.5/hardware/tools to avr_old. This forces the IDE to use the system avr-gcc, because it can’t find its own. With this, I was able to compile.

Next, I attempted to upload the compiled program to the board. The upload failed with the error message “avrdude: stk500_recv(): programmer is not responding”.

I switched to using the programmer to upload the sketch, and wrote a sketch that blinks an LED on analog pin 5. Originally, the sketch used analog pin 7, because that’s where my debug LED is hooked up, but it turns out that while you can use A0-A5 as digital outputs, you can’t do that with A6 or A7.

At any rate, the system can now blink an LED on A5. This verifies that the onboard clock is working, that the memory can be written to, and that the compiler is generating valid code. The clock speed is even correct, because a blink program with a 1 second period even generates 1 second blinks.

Now I just need to figure out why uploading via USB/serial doesn’t work, and I’ll be golden.

Read more

Modkit Micro Alpha

Modkit Micro Alpha does not run on Ubuntu 12.04 64-bit without the user moving some directories around and installing ia32-libs.

It also does not save projects more than once per launch, or compile code at all, on Ubuntu or Mac OSX.

I appreciate that the point of Modkit’s Kickstarter campaign was not to sell a finished product, but to get the money to produce one. That said, people who have paid money for a thing may want that thing to work. Modkit is now in the uncomfortable position of having sold the moon, and being expected to deliver it.

ToyBrain V2 Ordered

I’ve ordered the boards for the second version of the ToyBrain project. These boards are smaller than the originals, and should correct most of the problems (swapped TX/RX lines, put the ICSP header in right, etc.) I’m planning to outfit them with ATMega328s.

If these work and are all correct, the next version will be done in black, possibly with gold for looks. After that, perhaps I’ll make a kickstarter of it and see if I can’t sell a few boards.

FFMPEG recipes

ffmpeg -y -i video.avi -vframes 1 -ss 00:00:10 -an -vcodec png -f rawvideo -s 320×240 frame.png

Extract the frame at 10 seconds into the video file video.avi, resize it to 320×240, and save it to frame.png.

Conductive tape for biosignal acquisition

If you want to monitor electroencephalographic (EEG, electrical signals from the brain) or electromyographic (EMG, the electrical signals from moving muscles), you need to use electrodes to get the signal. The electrodes are generally not reusable and are kind of expensive. They usually run somewhere from $0.70 to $3.00 each, although the 3M Red Dot electrodes are much cheaper. The electrodes usually use a conductive gel surrounded by a ring of non-conductive adhesive, which makes them large and difficult to put close together.

It seems likely to me that you could use electrically conductive tape to improvise contacts of any size and shape. The adhesive probably isn’t tested for use on humans, and the conductive element is sometimes something that people have an allergy to, like nickel or silver, but it could be sufficient for self-experimentation for quick hacks. It would also be an order of magnitude cheaper

Conductive tape:
Cheapo Red Dots:

Unusual Data Visualization Tools

The Boston Marathon is visible in Google Maps’ traffic view. The road is closed for the runners, and the runners are going slow, at least relative to a car, so they show up as a huge traffic jam on the race route. All the other roads are in good shape because Race Day/Patriots’ Day is a state holiday, and so everyone is home from work. It probably also helps that it’s a gorgeous day out, and so no one wants to be in their car.

Google maps view of Boston, showing the marathon as a traffic jam

Dumpster Diving

My neighbors are throwing away a pair of Swiffer vacuums. Combined with my ToyBrain boards (when they arrive), those will make some sweet housecleaning robots.

Gorilla Glue Allergy

I used Gorilla Glue in several of the projects that I worked on last week. I’ve used it before without incident, but I think the continuous exposure over the week was enough to trigger a reaction. I got symptoms like dyshidrotic eczema, that is, tiny blisters filled with clear fluid and surrounded by raised, itchy, red bumps. On top of that, anywhere that I had already been having an allergic reaction (poison ivy and mosquito bites) flared up with its own constellation of welts. My fingers also swelled up enough to make it difficult to make a fist.

I’ve been treating it by taking dyphenhydramine (benadryl) regularly, and applying 1% hydrocortisone ointment in the morning and evening. The ointment is kind of a greasy mess, so I wear hypoallergenic chloroprene gloves after putting it on. It is gradually getting better, especially on the areas that get the most hydrocortisone coverage.

From now on, though, I’m going to put the gloves on before I use the glue, so I don’t have to use them for days afterwards.