![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
||
Physical Computing, sensors, etc.Polar G3CHR
The Polar G3CHR is a wireless heart rate monitor. It is available from the OEM division of Polar. Please refer to this link for the manual. It is really easy to use. Connect J2 pin 1 to ground, J2 pin 2 to Vcc and J2 pin 3 to a led (no resistor necessary). First check to make sure it is working with the Polar Heart Rate Simulator. The G3CHR uses RF for communication, and the simulator basically sends a signal simulating a heart beat which cases the LED to blink. Before using the strap make sure the Heart Rate Simulator is off. Then strap the wireless unit to your torso. I had a few issues with getting the strap unit to work. The signal is apparently quite weak (with Polar's internal antenna in use), especially beneath clothes. Make sure you're close (within 2 feet) of the G3CHR. If it still doesn't work apply water to the conductive fabric on both sides (watch out, cold!), then try using it. The G3CHR is meant to be used during workouts, so your sweat would normally dampen the fabric. Kudos to DanO and Sonia for all the patient advice. -- Wed, 27 Feb 2008 22:56 -0500
Programming Platform: 2 GHz Intel Core 2 Duo Mac OS X 10.4.10 Programmer: AVR MKII Chip: ATMEGA168 1. Download and install AVR MacPack I use vi and the command line to program, but you could also 2. install Xcode or Eclipse When it came to programming the ATMEGA, I had a problem with a several minute delay. One approach is to change the source and recompile. Rather than doing that, I used Arduino's avrdude. This was the command I was having trouble with - just erasing the chip: $ avrdude -p m168 -b 115200 -P usb -c avrispmkII -e 1. Install Arduino 2. cd /usr/local/AVRMacPack/bin/ 3. sudo mv avrdude avrdude.old 4. sudo cp -p /Applications/arduino-0010/tools/avr/bin/avrdude . 5. sudo ln -s /Applications/arduino-0010/tools/avr/etc /usr/local/etc 6. sudo mv /usr/local/etc /usr/local/etc.old 7. sudo ln -s /Applications/arduino-0010/tools/avr/etc /usr/local/etc Now programming should be no trouble... -- Fri, 22 Feb 2008 13:42 -0500
A few notes on Sparkfun's bluetooth beauty BlueSMiRF. An excellent little module. When configuring the device, it will appear as SPARKFUN-BT. The passkey is 'default'. Don't forget to set the baud rate. For details, see the datasheet. -- Wed, 12 Dec 2007 22:01 -0500
I picked up the ID-12 RFID reader from Sparkfun. Here's the datasheet. Wiring the ID-12 up is straight forward. This page does a good job of detailing the process. Open the data sheet and wire things for ASCII. I added an LED behind a 1K resistor to blink when a card was read. I also connected RESET to digital pin 2. I wanted to be able to detect whether a card was continually present. Normally when you put a RFID card on a reader, it is read once and that's that. I continually RESET the ID-12 to reread which card is present. Here's the code.
Regretfully the ID-12 cannot read multiple cards simultaneously. The Sparkfun RFID cards are large and bulky compared to other options. The reader isn't the fastest in the world... so I would recommend something else! The ID-12 is easy to use for those who are making their first foray into RFID. -- Mon, 26 Nov 2007 11:41 -0500
Thanks to Andy Miller figuring out the MediaMation CL6 MIDI light dimmer wasn't too difficult. First you need to procure either: 1) a female MIDI connector, or 2) a MIDI cable. Don't pay attetion to how MIDI is suppose to work, but hack it according to Tom's page. Be careful of not mixing power (+5V) and data. While it won't hurt the CL6 is you make this mistake, nothing will happen - so if things aren't working as you expect, this should be one of the first things to check. If you need to know more about MIDI, check out this page. Once you have the cable made and wired into your Arduino, plug it into the dimmer. Having a few lights plugged into the dimmer would be good too. Next, program your arduino.
Keep in mind that MIDI serial communication happens at 31250 bps. This means you must use hardware serial, as software serial has a limit of 9600 bps. FYI, you cannot use the Serial.available() class with software serial. Your arduino must use hardware serial at 31250 bps, and communicating to the CL6 uses your TX line. Keep this in mind when thinking of integrating the CL6 with processing or another piece of hardware. Finally, remember to send your data to the CL6 as bytes! -- Mon, 29 Oct 2007 15:09 -0400
RF Fun For our midterm, part of the project is to build a wand which will serve as an interface for manipulating a series of photos. The wand itself needs to be wireless, so users don't feel restricted in their use of the wand. We don't want people getting tangled up, or lassoing others up. The accelerometer can take some punishment, so I'd like people to swing with gusto. For the project we are using Sparkfun's RF Link - 4800bps - 434MHz. This RF link is also sold at the NYU Computer Store. First of all, the KLP Walkthrough Tutorial was very helpful. The first two RF link's I bought were bad, I don't know why. I don't *think* I did anything to toast them. Tom was kind enough to lend me his so I could continue working. TX (transmitting) code:
RX (receiving) code:
A few lessons I learned: 1. Despite being good for up to 4800 bps, using 2400 bps with no delay seemed to be the most reliable. 2. When loading code to the receiver module, make sure the wire to RX is DISCONNECTED, otherwise the arduino gets confused (RX is shared with USB, so the arduino can't differentiate between incoming RF data and the computer data). 3. When printing out values to the computer, the serial to USB conversion seems slower than the rate of incoming data, causing the RX buffer to overflow... basically, all the incoming data wasn't being printed, it looked like 0, 200, 240, 5, 10 - just bits and pieces. The code below adds the values up to make sure the data being received is consistent. 4. Range: 3-4 meters, by powering from the arduino and using an antenna. RX code with consistency check:
The next step was to battery power the wand. Just adding a battery (9V) to the arduino didn't seem to work. The power LED came on, but no data was being transmitted. After a bit of experimenting, I realized plugging the USB cable in after the arduino boots jumpstarts data transmittal. Why? Turns out with the Arduino NG (rev. c) you need to keep RX from floating. Do this by adding a 10k resistor from RX to ground. In my case, this didn't interfere with the reprogramming of the device. Refer to this page for more info.
-- Mon, 15 Oct 2007 21:39 -0400
Copyright © 1996-2008 Alexander Reeder |