Sunday, December 21, 2014

68: Arduino Ideas
(where the Pi is too big)
revised 8 Jan 2015

Don't get me wrong -- I'd rather work with the Pi but the general purpose way they are packaged makes them too big to hold in your hand (Gee. And 18 months ago I thought they were tiny).

So, in addition to experimenting with them as semi-smart sensor front-ends to a Raspberry Pi I have explored some hand held applications.

Here's my first try:

I thought this would be a nice helper device for the visually impaired -- a "white cane" without the stick. I have actually built & programmed one of these. But so far (and likely, forever) it's a bust.

Problems (least to most difficult):
1. The Arduino is too slow to include the accelerometer programming. After lots of tries, forget it. The user can tell the angle that she/he is holding the device.

2. The only buzzer/vibrators I could find (Adafruit: small, cheap) are actually tiny motors with unbalanced shafts. I had hoped that I could signal fairly small differences to the user (e.g.: 100ms buzz vs. 500ms). But, guess what, once you start these suckers spinning they stop when they feel like it. Disappointing, but not a fatal flaw (and I could always go to bluetooth audio). Revision: I just tried a 3rd wiring/programming scheme for the buzzers: using PWM I can signal 3 urgency levels with the vibrators.

3. I tried 5 distance/rangefinder devices: 3 ultrasonic, 2 active infrared, 1 laser. The overriding problem is that any of these gadgets can be fooled when held at an angle with the ground (the outgoing signal may be reflected instead of returned). Additionally, the laser only worked with the Raspberry Pi (used Pi's camera to measure pixel offset between the laser dot and the center of the camera sensor -- very accurate at 10'). As above, the laser dot can be reflected; also, a class III (i.e., safe) laser is blanked out in bright sunlight. All of the ultrasonics have too wide a beam of return. I settled for the 2nd IR device (Sharp-GP2Y0A02). It reads ok between 2' and 10'. But I get many goofy short returns. So I do 3 readings and choose the longest.

Anyway, my sample kind-of works most of the time. But even 99% of the time wouldn't be good enough.
Ok. It's ugly.

The only thing that would solve this would be a customized rangefinder just for my "e-cane" -- not in my price range. I could write a book about this experience.

Oh well. Onward. Here are 3 more ideas for hand-held devices:
Gas Detector: Turn it on. Press either button (carbon monoxide or natural gas/propane). After sensor warms up read result on the single digit display: 0 = clear, 9 = bad (buzzer sounds above 2).

The RFID devices are a pair. I need the reader to be able to test the detecter. The reader's 16x2 character display will show what was read -- presumably encoded. (Google "rfid hacking" if you're interested in [or paranoid on] the topic.)

The gas detectors and the RFID reader are all available from http://www.mpja.com/ for $10 or so each. An RFID detector can be home made.

My next projects!

Thursday, December 18, 2014

67: Extending My Pi
* revised 23 Dec 2014 *

In my last post I wrote about adding a front-end Arduino Nano to handle analog input. And that works fine but it doesn't do much for extending sensor distances. I.e., USB 2.0 is limited to 16' cables. So here's my next cut. I added another Nano and a pair of nRF24L01+ tranceivers.


I know, it's messy but the price isn't bad: the Nanos are $14 each and the pair of RF24s were under $10. And the "receiver" Nano can service multiple "senders." 

I used the maniacbug.github.io/RF24/ software. It works but documentation is lacking. I wasted 2 days getting a working setup and there are still mysteries. About par for the course. 

Dec 23: Below is a pic of my transmitting RF24 (Nano in background). With just the builtin antenna I got about 50' indoors (through a wall and my body) before loosing a packet. Had to retry every other packet at 100' indoors to outdoors through 2 walls and an evergreen. Through my body made it worse. Line-of-sight 200' is probably reasonable. But the RF24s with screw-on antennas seem worth it ($20/pair).
nRF24L01+

I have an idle Pi B+ with extra pins, so I'll try using it in place of the "receiver" Nano. The RF 24 uses 5 GPIOs plus 3.3v and ground.