Interfacing MIDI devices with Arduino using USB Host Shield

Another popular USB peripheral code for USB Host Shield has been implemented! Collin Cunningham from Collin’s Lab @ MAKE found a neat way of interfacing USB MIDI devices with Arduino. The video above demonstrates using Akai LPK25 keyboard and USB video game guitar to play music on Arduino. Quoting Collin, his setup is “USB MIDI to old-school MIDI converter”.

Make sure to check out Collin’s code – it’s one-piece sketch, short, clean and easy to understand. It is Richard Ibbotson’s PS3 code, re-purposed to parse MIDI data. While not a textbook implementation of USB MIDI, Collin’s code can be used to talk to MIDI keyboards, guitars, and consoles, to name a few. Good job, Collin!


Vigorius stirring redefined. Part 2 – electronics

In previous article I started talking about constructing magnetic stirrer from PC fan, a pair of rare earth magnets, and plastic can. In this article I will show the rest of the construction as well as program code to control the motor.

When building cases for my designs, I tend to avoid techniques requiring accurate (read “any”) measurements and calling for non-round holes. The design that I’m describing here is no exception. In order to complete it I needed just a few extra parts in addition to plastic joint compound can, PC fan and magnets, arrangement of which was described earlier. I used Arduino controller equipped with Motor Shield from Adafruit to supply PWM current to the fan, 3 nylon standoffs with adhesive bottoms to mount Arduno, rotary encoder to set stirrer speed, and panel-mounted 2.1mm DC power jack. The stirrer is powered from 12V wall wart capable of supplying 300mA or more.

I was thinking of implementing monitoring of motor current to track the moment when stirrer bar loses attraction to the magnets and stops rotating. When I was playing with the stirrer powered from bench suplly the change in current was quite visible. However, I found out later that when motor is supplied with PWM signal, current stays almost constant over the whole range of duty cycles and loads and current tracking won’t work. With regret, I abandoned this clever feedback idea. On the bright side, the code necessary to control the stirrer immediately became much simple, short and easy to understand.

Stirrer code

Stirrer code

Continue reading Vigorius stirring redefined. Part 2 – electronics

Vigorius stirring redefined. Part 1 – mechanics.

Tornado in the flask

Tornado in the flask

Magnetic stirrer is a handy tool to help in any household activity, where agitation or mixing of relatively small (under 4L/1Gal) volumes of liquid or suspension are involved – from yeast starter preparation to dissolving fertilizer to chemical experiments. As almost any piece of laboratory equipment, factory-made magnetic stirrers are way overpriced. At the same time, such stirrer is rather easy to make from junk lying around the house. There are plenty of information on the Internet describing building mechanical part of a stirrer. Google for other people’s projects, some of which are much nicer than mine. I started this project mainly to play with motor control piece so mechanical setup was simplified as much as possible. As far a motor control goes, the main difference of mine will be ability to track stirrer bar behaviour. When a bar is spinning close to the maximum speed for given viscosity, it tends to lose strong attraction to the magnet of a motor and stop. Usual remedy is then to slow down the motor until it catches the bar and slowly increase the speed. Since moment of losing attraction is easy to register by monitoring current to the motor, the process of catching the stir bar can be automated. Also, I have a suspicion that a current change will be observed just before the disconnection and can be avoided altogether by corrective action. I will check this possibility during control circuit firmware design. Now, while waiting for Adafruit Motor/Stepper/Servo Shield for Arduino kit to join piles of junk lying around the house, I will describe mechanical implementation of the stirrer.

Continue reading Vigorius stirring redefined. Part 1 – mechanics.

Sparkfun Autonomous Vehicle Competition.

I just came back from Sparkfun autonomous vehicle competition and here’s some pictures:

The fastest on land

The fastest on land

This rover made first place on land. For some reason land and air vehicles were competing in the same category so this giy got second place. This was the only rover able to finish the track. It did it 3 times with good results. Here is the builder’s log:

Continue reading Sparkfun Autonomous Vehicle Competition.