Thursday, January 10, 2013

Raspberry Pi Remote Data Logger: Now with tons more remote!

I spent the morning re-building, re-making, re-everything-ing my original version 1 Raspberry Pi model B (smaller amount of memory, two USB ports and an ethernet port).  I was going to clone my work, essentially copy the SD card, but I decided that this would just carry over all of the crap from my original forays into Linux.

Interesting side note, the Adafruit boards won't let me use the word "crap" in my posts on there.  I thought that was pretty hysterical, given my sailor mouth (Today's post is here).

I put the Adafruit Linux Distro, Occidentalis onto a spare 8GB memory card.  Then I started working through the essentials to get the board ready for SSH and VNC over a WiFi connection.  Finally, I kept working through the required Python modules for my code to work (I did pull the code over from my working Pi using a USB stick).  In short order, I got everything up and running.  Remotely.  I documented the steps on the Adafruit blog, here.

I really feel like I should get a reward for the documentation.

The system is now in my kitchen, with a sensor cluster out the window.  I'm logging internal temperature and pressure, and external temperature.  I took the motion sensor off.  I need to work on a new modality for that.

I've been logging motion on a binary basis (does the sensor see motion or not, each minute).  I'm only polling the sensor every minute.  You could sneak by the sensor by walking past it within the polling window.  I know the sensor registers motion and then continues to read motion for a short period of time (I think it's about 5 seconds, from playing with it before).
Instead, what I want to do, is have the sensor poll every couple of seconds, and count the number of motion hits per minute.  Then, when it graphs the motion, it graphs not just whether motion was seen or not, but how much motion.
I need to figure out how to implement that in terms of Python code.  I'll need to have the motion sensor polling every couple of seconds, remembering the count until it is reset, and returning that count to the requesting code.

First, I need to examine the sensing characteristics of the motion sensor.  I think I'm going to break out the Arduino for that.

I think a similar modality could be used for the gyro/accelerometer that I have on the board.  I still don't have the slightest clue as to how to read the values for that thing.  I'm not really interested in the actual values, but I'm really interested in major variances and the magnitude of those variances.

The next sensor idea is using a MaxBotix ultrasound sensor to look at motion in my hallway.  I'm also thinking that one could be dedicated to detecting the position of the front door (and back door, for that matter).  I'm trying to decide if I should use an ultrasonic sensor for both.  I've got a cheapie IR proximity sensor that could be used for the front door.  MaxBotix makes a series of I2C ultrasound sensors which would be an easy integration.  It looks like the address on the MaxBotix sensors can be reassigned, so I could use multiple sensors on the same I2C bus.

I'm in a rental place right now.  That means I can't go tearing the place up to run wires and implement these ideas.  On the flip side, my landlords are very cool.  I think they'd support some of what I'm doing.  All that being said, I think I need to consider more nodes and less wiring.

If I can figure out how to do this wirelessly, it'll be easy as pie to get everything working on a wired network (I'm probably going to regret saying that later).

No comments: