Computing stuff tied to the physical world

Contraption

In AVR on Dec 4, 2008 at 15:31

This watchamacallit is a hookup to the electricity meter downstairs:

89248D86-7166-454D-88C8-7C711912A943.jpg

It has a sensor concocted from an ultra-bright LED and a phototransistor, which senses when the black marker on the rotating wheel passes underneath it.

This sensor is tied to an RBBB Arduino which tracks and transmits the rotation count every 3 seconds on 868 MHz, using the previously created setup:

D73BA4B6-ECFD-4CE5-84F9-BDDDA6DD129F.jpg

The green transmitter PCB is in front at the top. The whole thing is powered by a 9V adapter.

To deal with quick rotations, the sensor is read out about 100 times per second, also during each 100 msec transmission. These were rough calculations and the transmissions no doubt have considerable jitter due to inaccurate timing. A timer- / interrupt-driven version will probably improve accuracy and transmit range. But for now this crude setup appears to provide acceptable readings.

This Tcl script saves the results to file on MacOSX:

2C7654DB-52CF-40EF-A4CC-D1B16FD14023.jpg

And this is an extract of that log file (showing roll-over and some missed packets):

41E4D41F-D6B3-4FA7-9FEC-9EA8277E47CA.jpg

The 94..97 values are the rotation count. This also shows that the log remains usable even when packets are missed.