maandag 6 augustus 2012

The tweeting cat II

I managed to get the XBee USB explorer hooked up to my playstation 2 linux system, and it only crashed twice so far. Playstation 2 linux runs 2.2.1 (a very old release). Since 2.2.1 doesn't have USB and the Playstation 2 uses USB for the keyboard and mouse, they ported the 2.2.18 USB modules, but the driver for the XBee USB explorer only exists in 2.2.19 and up, so I had to port that back too. It required me to manually edit usbserial.c (as this contains PS2 specific code) but the other files could just be copied from 2.2.20 and 2.2.19.

The next step was to build the circuit. I saw a good option on bildr blog which I decided to persue:
I also added a 330 Ohm resistor and a LED to the ID-12, to make sure you could see when a tag was successfully scanned. The positive lead of the LED goes to the pin, for those that are wondering. As a battery supply I used four rechargeable NiMH AAA batteries, which give a voltage between 5.6 and 4.9 volt, I initially used a diode to drop the voltage by 0.7V to ensure that I didn't send more than 5.4V to the ID-12 (the XBee is protected by the 3.3V converter).

Then I had to attach it to a cat harness, for which I used electrical tape and band aid tape (to not bother the skin of the cat with the electronics). This is what Nephthys looks like with the system on:

You can see the LED and the RFID-12 on this picture.

And on this picture you can see the battery pack with the XBee attached to the back.

The system worked once, but the cat decided not to go after any of the RFID tags I put around the house and the system stopped working after an hour. After a lot of debugging I discovered this was because the batteries had run out of power (oddly enough the RFID-12 and the XBee still work, and the LED still blinks, but the RFID-12 refuses to send any data to the XBee, which made for a lot of trouble debugging. So I'll try the system without a diode next, which would give the system a lot more battery life.

As you can imagine, I'll put tags on the food bowls, the water bowls, the favorite sitting spots of the cat, maybe the litter box, but also the other cat, Miuty:

Of course, I'll also have to set up a twitter account and create a way to translate the RFID numbers into tweets. But it will all happen.

Geen opmerkingen: