Arduino and Accelerometer: Testing Resumes

Sure, it’s been like two years since I posted anything, but I did actually pull out my Arduino and started refreshing myself on how everything worked. It had been so long I had to reinstall the Arduino software and the serial driver for the old Arduino Diecimila.

arduino_accel_05I started back up on one of the last projects I had worked on. Having lived in California most of my life, earthquakes were always on my mind, so the idea of having an early warning network in the state was always something of interested to me.  Similar to the promises of an inexpensive flying car, public space travel and hoverboards, it seems like one of those things that will not happen in the near term.

Funny thing is, people manually typing “Earthquake, OMG!” in to Twitter can actually travel fast enough to give others warning, so why not build something automatic?  Back in 1989 after the Loma Prieta earthquake when I was still regularly using Bulletin Board Systems (BBS’s, like Deeptht, Gorn and The Omni) I had the F12 function key on my computer programmed with “Earthquake!” to notify those I was chatting with that another aftershock was on it’s way to them. I believe it was 20-30 seconds between Santa Cruz and San Francisco.

All that to say, now that I have moved to Oregon at first glance I was relieved… no more worries about earthquakes, only these volcanoes that surround me and they don’t move all that often.  Then I learned about the Cascadia subduction zone and it’s very real potential of magnitude 9+ Megathrust earthquakes. Now I’m reading a great book on the topic, Cascadia’s Fault, and learning more about it.

And that of course has all brought back my interest of receiving an early warning when that fault actually lets loose. Not counting capture/sensor and transmitting/receiving delays, there should be somewhere between 30-40 seconds warning before the shaking actually arrives here.

I had already started working with an Arduino with a dual-axis accelerometer so today I started working on it again.  I had seen a GitHub project from someone in Seattle, the P-Wave Detector that uses the Quake Alarm detector tied with an Arduino to send out text messages to anyone who subscribed.  Even with one detector in Seattle (if it’s even still online in the three years since he posted it) it would give me approximately 155 seconds of warning, and of course the shaking would be greatly reduced due to the distance traveled.

So, I’ll keep working on this little project, and if I build something that I think would actually work well enough to deploy I’ll contact my friends along the Oregon/Washington coast (Brookings, Coos Bay, Eugene, Portland, Vancouver and Seattle) and place sensors there for testing.

Maybe in a few years I’ll step off of my Hoverboard and write another post on how the project is coming along ;-)

Playing with the Arduino

For months I’d been seeing pictures and reading stories about the Arduino, the short description from their website is:

What is Arduino?

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It’s intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.

So before Christmas, Ellen and I were talking about gift ideas for each other and I went ahead and let her know that the Arduino was something I was interested in. She was willing to let me open it early, but I waited until Christmas anyways which gave me plenty of time to research it further online.

I have been really impressed by the platform, and by the programming interface to it. The software comes in Mac, Linux and Windows flavors so that covers just about everyone who would want to try it out. I ordered the Adafruit Proto Shield from Adafruit Industries. Since I bought that as a kit, I had to dig out my soldering iron and refresh my skills a bit.

In preparation for that, I’d recently completed building a MintyBoost kit from from The MintyBoost is a battery charger for USB devices that runs off of two AA batteries. When I went to MacWord this year, I’d played with my iPhone in the car all the way up and ran the battery dead, so that helped convince me that having an external charger for it that ran off of batteries would be a nice thing to have.

But back to the Arduino… my first step was running through the tutorials over at ladyada site. They were really well put together and take you from the “Hello World” of physical computing, the blinking LED, through the use of switches and more advanced programming and logic.

My first sketches were just blinking LED’s at different speeds. Then I made an LED “breathe” like a sleeping Macintosh. Then I added in a switch and would make it blink or breathe. Played around with digital and analog inputs, tried out some sending and receiving of IR signals. One of the fun ones I did there involved pointing any IR remote control at the arduino to toggle an LED on and off again.


Other silly sketches were variations on the Night Rider light bar, I programmed one from scratch, then found better examples online that were smoother in appearance. I’d seen people trying POV or Persistence of Vision projects, so I downloaded a sketch and had it say Ellen’s name as you waved it back and forth in a dark room Won me some points with the wife there ;-)

I’ve played with RGB LED’s making them fade in to all the various colors, worked with a 7 segment LED to count from 0 to 9, worked with sending and receiving serial data via the USB port, started working on building a VU Meter (to be used for audio levels, lighting levels, water temperature, etc)

I keep planning on taking pictures, posting code snippets, etc, but I figure it might be better to get in the habit of posting anything and working on the details later. If you want to see any of the source for any items listed here, just let me know. More to come soon.