Wednesday, April 29, 2015

12: Device Review
Apr 25, revised: May 2, Aug 1, Nov 25, 2015

Devices I've wired/programmed* for the Raspberry Pi, Arduino and Spark Core (now Particle Photon)
  • LEDs (everyone starts with these) - RAS
  • Push buttons - RA
  • PIR motion detector - R
  • Magnetic door sensor - RAS
  • Photosensor RAS
  • DS18B20 temperature sensor - RAS
  • DHT22 temperature/humidity sensor - RAS
  • TMP36 temperature sensor - AS
  • Raspberry Pi camera (B/W conversion, timelapse, security cam) - R
  • Relay Switches - RS
  • Water sensor - R
  • Soil moisture sensor - AS
  • Water valve/solenoid control - RS
  • Rangefinder: ultrasonic, IR (several models) - RA
  • Speakers - RA
  • CO gas sensor - A
  • Natural gas/propane sensor - A
  • Mini vibrating motors - A
  • Pi - Arduino Com over USB - A to R
  • RF (radio frequency) read & write - A to R
  • RFID sensor - AS
  • 16x2 LCD text device - RA
  • 7-segment clock device - R
To make the above work--
  • resistors, capacitors, diodes, transistors, 
  • Darlington array - R 
  • I2C (MPC2308) - RS 
  • MPC3008 (analog) - R
  • PWM - A
  • Backup battery setup - RAS
  • Also: Internet upload/download, email, text message - RS
* Programmed in Python, C, C++, Linux Shell, Crontab

Tuesday, April 7, 2015

11: Uninterruptible Power (the other UPS) for Arduino, Spark Core or Raspberry Pi
* revised Apr 17, 2015 *

There seems to be precious little help on line for this even though it turned out to be pretty easy. I watched --

I got my parts from Adafruit (charger: $6, powerboost: $15, 1200mAh battery: $10, plus their irritating shipping charges).

I tested this with an Arduino Nano--
both external power and  battery (note red LED*)

And with my Spark Core--
just battery

You can connect/disconnect the battery any time. And this will work for Raspberry Pi just as well (REVISED: probably, if the system doesn't draw more than 1000mA -- see

Also REVISED: When I let the Spark run until the battery ran down there was a problem: The Powerboost didn't just quit cleanly. The boost/Spark stopped/restarted, stopped/restarted (voltage hiccups?). I suppose that when the boost stopped drawing current then the battery recovered a bit. Anyway: not nice. The Powerboost has an Enable pin (labeled (EN). Grounding that will stop things cold. Then how does it restart? What un-grounds the EN? See * note below. Kudos to Spark that the Core survived undamaged! Note: the Powerboost did not survive (Adafruit replaced it).

Considering the way that (non-hobby) "programable controllers" are used, I'd think that a UPS setup like this would be about Arduino Lesson 3!

* If you aimed a photo resistor ($1) at the charger's red LED external power indicator then you could detect power failure and shutdown gently (but HOW and HOW-TO-RESTART?).