Category: Uncategorized

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: http://www.tedpella.com/semmisc_html/semadhes.htm
Cheapo Red Dots: http://www.amazon.com/Red-Dot-Monitoring-Electrodes-Diaphoretic/dp/B000TBSAH0/ref=sr_1_1?s=industrial&ie=UTF8&qid=1336146625&sr=1-1

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.

Xybernaut Head Mounted Display to VGA hax!

I have a Xybernaut Xyberview HMD, which originally connected to a Xybernaut MA-V or MA-IV wearable computer. Xybernaut went out of business after some questionable corporate shenanigans, but while they were around, they made a solid product. Unfortunately, they used a custom, or at least obscure, connector to hook that solid product together.

Thanks to the Wayback Machine, I’ve found the pinouts for the connector, and wired mine up so that it takes a standard VGA input. I also built a power supply for it, because it needs 5V and 15V power. The power supply takes 15V from a laptop power brick and drops part of it to 5V while also providing a 15V pass-through. I used a switching regulator, because otherwise I’d be dropping 10V at unknown current as heat.

I initially had the red and blue lines of the VGA connector crossed, but I think that is because they are crossed in the instructions that I found. My corrected pinout is below. If you happen to actually be equipped to do this hack, please do let me know if I made an error, and your terribly expensive, extremely obscure hardware from the mid ’90s somehow fails to work.

The HMD connector has two rows of pins in a connector that looks a little like a miniature Centronics connector. Assuming the longest edge of the connector is on top, there are 13 pins in the upper row (U1-U13) and 13 pins in the lower row (L1-L13).

Wire colors are described as the color of the wire, the color of the mark on it, and whether the marks are sparse. So Yellow/Red (sparse) means a yellow wire with a red mark on it that is less dense than the wire described as Yellow/Red. You’ll know it when you see it.

Signal Name       Xybernaut  Wire Color             VGA Pin
Red               L4         Pink/Red (sparse)      3
Red ground        L3         Pink/Black (sparse)    6
Green             L2         Yellow/Red (sparse)    2
Green ground      L1         Yellow/Black (sparse)  7
Blue              U14        Gray/Red (sparse)      1
Blue ground       U13        Gray/Black (sparse)    9
H Synch           L6         White/Red (sparse)     13
V Synch           L7         White/Black (sparse)   14
Synch ground      U10        Pink/Black             10
+5V               U1         Gray/Red
+5V               U2         Yellow/Red
+5V               U3         White/Red
+15V              U5         Pink/Red
Digital ground    L13        Yellow/Black           5
Digital ground    L10        Gray/Black
Digital ground    L5         White/Black
Analog ground     U8         White
Headphone out     L12        Pink
Mic in            U7         Yellow
HMD Sense         L8         Gray                   11

I connected the Gray/Black and White/Black wires to the ground of my power supply, the Yellow/Red, Gray/Red, and White/Red wires to 5V, and the Pink/Red wire to 15V. The display powers up, and I can drive it from my laptop using 640×480 resolution at 60Hz.

Unfortunately, none of this hacking changed the fact that wearing an HMD makes you look like a cyborg from space.

Neural Net book

For a book on a kind of dry subject, this book has an oddly humorous tone:

“It is also interesting to rotate a frog and notices that his eyes try to maintain their orientation up to some maximum angle at which time the frog will close his eyes, giving up the attempt at computing the appropriate adjustment of the visual input. Try not to let anyone see you doing these experiments”

“If a hole is punched in the visual cortex, V1, the only apparent deficit is a hole in the field of view… There are anecdotal records of people receiving damage to this part of the cortex. They report seeing President Bush’s thousand points of light.”

“At a recent neural network conference, Minsky tried to clear up the misconception that he was the devil.”

That last one is because Minsky wrote a proof that single-layer perceptrons can’t do the XOR operation, and funding for neural networks dried up for years. This made him unpopular with the people who had been getting that funding.