zondag 2 oktober 2011

GPS for Nikon D7000 (or D90)


I recently bought a D7000, and noticed it had a GPS input. Since I already had the GPS module (see the GPS label) I was wondering if I could connect the two. It turned out to be easier than expected: the GPS module accepts 4-6V (and the D7000 outputs 5.9V) so no regulation is necessary. The GPS output is 3.3V, and my Nikon D7000 accepts that without any problems (I've read reports of other Nikons that need a higher voltage, in which case you can use the 74HCT125 as mentioned in this schematic.

The trickiest bit is finding which cables to connect, however, there are enough resources online, like this blog for the D90, that explain it rather accurately.

I put the GPS inside a mini Altoid box, and will probably use the foot that I had for my Minolta project. To activate the GPS on the camera you need to go to the GPS menu. On the LCD display you can see the status: if it is blinking it means you connected everything correctly, but the GPS hasn't locked on yet. If it is solid, it is in use. Note that the Nikon stops listening to the stream if the data isn't being used for a while, but it keeps powering the GPS (I believe even when the camera is turned off, so you may wish to unplug if you want to save the batteries).

zaterdag 19 maart 2011

PS2 to MIDI converter


Recently I purchased an EMT-10E (Yamaha sound extender) which was meant for the Clavinova to increase the different sounds you could make. I bought it for the project I mentioned earlier on this blog, so I would have something to hook the toy piano with MIDI to once I was done. However, due to issues with the switches the toy piano still doesn't have MIDI, and I still wanted to play with the EMT-10E. So I decided to make a PS/2 keyboard to MIDI converter. Since a PS/2 keyboard already sends key press and release commands it would be just a matter of converting the protocol and assign a note value to each key.

As this didn't seem to difficult, I decided to give myself another requirement, which was that it had to look nice. As you can see on the picture, I think I succeeded. Initially I decided to use a wood box, but the PS/2 connector that I got from Jameco was too narrow for wood, so I needed something thinner, but still strong. After walking around in Lowes for a while I discovered that an light switch box with a blank plate would work very well. I also bought a 1/2" drill bit for the holes, and it turned out it was quite easy to put everything together.

I once made a servo controller for Brian Asman, and I already had converted that board for MIDI output. It turned out it had the right size for the box, and I therefore only had to add the PS/2 connector (I connected the data line to PORTB bit 4, and the clock line to PORTA bit 2. You also should connect +5V and ground. Wikipedia has a very clear diagram of the connector, but make sure you have the right mirror image (initially I connected it wrong, reversing the voltages. My keyboard was quite lenient, though). You'll know when you have the right connections if you see the keyboard's LED blink. To hook up the MIDI you need two 220 Ohm resistors for use in the data line and the +5V line. The data line should be hooked up to the TX pin of the PIC16F690 (you can also use a PIC16F688, if you want something smaller). The EMT-10E conveniently has a 9-12V output, which I use to power the box.

You can see and hear the box at work here:

The EMT-10E has a "split keyboard" mode and allows transposing up and down for several octaves, and it has a number of different instruments (no drums, unfortunately). The only problem remaining is that a PS/2 keyboard has auto-repeat on keys, which is undesirable if you want to play notes for a longer period of time (it also causes some notes to become "stuck", possibly because more press events are received than release events).

Here is the first version of the source code, which basically reads a key from the keyboard, converts it into a note value, and either plays it or stops playing it, depending on whether it is a key press or a key release.

If you're interested in this project you can always contact me and I can provide more details if needed.

dinsdag 15 maart 2011

Weighted Companion Cube


On a different note I decided to make a weighted companion cube a while back, as I was enjoying Portal a lot. As you can see it came out rather well, although the silver paint might be too shiny, and the sculpey turned out to look a bit like teeth.