Friday, July 9, 2010

Prototype #1


One would think nothing happens here, since the post are so sparse, but I have actually been too busy with this to post anything. The one in the image, is one of the two prototypes I have build using the older sensor. Works pretty well. After a lot of smacking head against the wall, I finally had expected results showing up. I have also build a new prototype based on a better chip than the one showing in the image. The one in the image can handle walk speed, but will not work properly for running speeds. It can handle speeds up to around 1.6m/s. I am currently about to solder the new prototype together, and will reuse most of the code I've made for this prototype! More about the new prototype in the upcoming posts...

If you start walking and have some debug information showing using this prototype, you get something like this:

7 6 5 4 3 2 1 0
0x20 0b 0 0 1 0 0 0 0 0 --- No motion

7 6 5 4 3 2 1 0
0x00 0b 0 0 0 0 0 0 0 0 --- X motion

7 6 5 4 3 2 1 0
0x00 0b 0 0 0 0 0 0 0 0 --- Y motion


7 6 5 4 3 2 1 0
0xA0 0b 1 0 1 0 0 0 0 0 --- Motion detected

7 6 5 4 3 2 1 0
0x01 0b 0 0 0 0 0 0 0 1 --- X motion

7 6 5 4 3 2 1 0
0x02 0b 0 0 0 0 0 0 1 0 --- Y motion


7 6 5 4 3 2 1 0
0xA0 0b 1 0 1 0 0 0 0 0 --- Guess

7 6 5 4 3 2 1 0
0x0E 0b 0 0 0 0 1 1 1 0 --- X motion

7 6 5 4 3 2 1 0
0x1D 0b 0 0 0 1 1 1 0 1 --- Y motion


7 6 5 4 3 2 1 0
0xA0 0b 1 0 1 0 0 0 0 0 --- Yo mama

7 6 5 4 3 2 1 0
0x0E 0b 0 0 0 0 1 1 1 0 --- X motion

7 6 5 4 3 2 1 0
0x2A 0b 0 0 1 0 1 0 1 0 --- Y motion


The first byte (0x20) is from an address showing among other things if motion is detected. Next byte is X motion and next is Y motion. As you can see in the example here, bit 8 (7) is set in that address when motion is detected by the sensor. What I do here is just printing these addresses in an infinite loop, and you get the above when starting to move on the treadmill...