User Tools

Site Tools


tutorials:iotc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorials:iotc [2012/03/12 21:07]
pburgess
tutorials:iotc [2016/01/28 18:05] (current)
Line 1: Line 1:
 ====== An “Internet of Things” Camera====== ====== An “Internet of Things” Camera======
-**Simple remote monitoring using the Eye-Fi wireless SD card and Adafruit Data Logging Shield for Arduino**+**Simple remote monitoring using a first-generation ​Eye-Fi wireless SD card and Adafruit Data Logging Shield for Arduino**
  
 ===== Introduction ===== ===== Introduction =====
Line 16: Line 16:
 {{ :​tutorials:​iotc:​gui.png?​nolink&​ |}} {{ :​tutorials:​iotc:​gui.png?​nolink&​ |}}
  
-The camera project didn’t require any major engineering effort, but rather was a simple “mash up” of existing elements — a perfect example of the //​sketching//​ principle of Arduino. Being Arduino-based,​ it’s also easy to tweak…say if you’d like a time-lapse camera rather than motion sensing. Let’s see how it’s put together!+The camera project didn’t require any major engineering effort, but rather was a simple “mash up” of existing elements — a perfect example of the //​sketching//​ principle of Arduino. Being Arduino-based,​ it’s also easy to tweak…say if you’d like a time-lapse camera rather than motion sensing, or to hack in sensors such as a laser “trip wire.” Let’s see how it’s put together!
  
 ===== Parts and Software Lists ===== ===== Parts and Software Lists =====
Line 26: Line 26:
   * TTL Serial JPEG Camera (either the [[https://​www.adafruit.com/​products/​397|bare board]] or [[https://​www.adafruit.com/​products/​613|weatherproof version]])   * TTL Serial JPEG Camera (either the [[https://​www.adafruit.com/​products/​397|bare board]] or [[https://​www.adafruit.com/​products/​613|weatherproof version]])
   * [[https://​www.adafruit.com/​products/​85|Shield Stacking Headers for Arduino]] make it easier to change the wiring around as needed   * [[https://​www.adafruit.com/​products/​85|Shield Stacking Headers for Arduino]] make it easier to change the wiring around as needed
-  * [[http://​www.eye.fi/​|Eye-Fi wireless SD card]] (any model)+  * Eye-Fi wireless SD card (any model).
   * A suitable power supply: either a [[https://​www.adafruit.com/​products/​63|9V 1A wall adapter]]…or,​ for standalone wireless use, our [[https://​www.adafruit.com/​products/​248|6-cell AA battery holder]] is best. For the smallest possible package, a [[https://​www.adafruit.com/​products/​14|MintyBoost]] can also work, but provides only about two hours’ run time.   * A suitable power supply: either a [[https://​www.adafruit.com/​products/​63|9V 1A wall adapter]]…or,​ for standalone wireless use, our [[https://​www.adafruit.com/​products/​248|6-cell AA battery holder]] is best. For the smallest possible package, a [[https://​www.adafruit.com/​products/​14|MintyBoost]] can also work, but provides only about two hours’ run time.
   * The usual electronic project bits and bobs: wire, soldering tools, etc.   * The usual electronic project bits and bobs: wire, soldering tools, etc.
Line 35: Line 35:
   * [[https://​github.com/​adafruit/​Adafruit-VC0706-Serial-Camera-Library|VC0706 Serial Camera Library]] (required)   * [[https://​github.com/​adafruit/​Adafruit-VC0706-Serial-Camera-Library|VC0706 Serial Camera Library]] (required)
   * [[https://​github.com/​adafruit/​RTClib|Realtime Clock Library]] (required)   * [[https://​github.com/​adafruit/​RTClib|Realtime Clock Library]] (required)
-  * [[http://​code.google.com/​p/​sdfatlib/​downloads/​detail?​name=sdfatlib20111205.zip&​can=2&​q=|SdFat Library]] (optional, but includes the SdFormatter sketch, highly recommended) 
   * [[http://​support.eye.fi/​downloads/​|Eye-Fi Center configuration software]] for PC and Mac (not Adafruit code — please contact Eye-Fi tech support for any help or issues with this software)   * [[http://​support.eye.fi/​downloads/​|Eye-Fi Center configuration software]] for PC and Mac (not Adafruit code — please contact Eye-Fi tech support for any help or issues with this software)
  
 ===== Make It! ===== ===== Make It! =====
  
-Before getting into the full wireless project, you might want to try out the example sketches included with the [[https://​github.com/​adafruit/​VC0706-Serial-Camera-Library|VC0706 serial camera library]]. Once that’s working, the camera setup is easily adapted to this new task.+Before getting into the full wireless project, you might want to work through the [[http://​www.ladyada.net/​products/​camera/​|TTL Serial Camera Tutorial]] and try the example sketches included with the [[https://​github.com/​adafruit/​Adafruit-VC0706-Serial-Camera-Library|VC0706 serial camera library]]. Once that’s working, the camera setup is easily adapted to this new task.
  
-The aforementioned ​example sketches ​place the camera on Arduino pins 2 and 3 in conjunction with the SoftwareSerial library, keeping the Arduino’s native serial port available for communicating to a host computer. But the sketch used here instead assigns the camera to the hardware serial port for added robustness. Devices have their own independent clock sources, and baud rates always have a bit of slop…sometimes they fall out of phase and a glitch occurs, as can happen between the camera and Arduino. The hardware serial port is less prone to these errors. Not 100%, but noticeably more robust ​than SoftwareSerial in this regard. Maybe 1 in 100 images arrive corrupted, vs. about 10x that rate with SoftwareSerial.+The aforementioned ​tutorials ​place the camera on Arduino pins 2 and 3 in conjunction with the SoftwareSerial library, keeping the Arduino’s native serial port available for communicating to a host computer. But the sketch used here instead assigns the camera to the hardware serial port for added robustness. Devices have their own independent clock sources, and baud rates always have a bit of slop…sometimes they fall out of phase and a glitch occurs, as can happen between the camera and Arduino. The hardware serial port is less prone to these errors. Not 100%, but noticeably more resiliant ​than SoftwareSerial in this regard. Maybe 1 in 100 images arrive corrupted, vs. about 10x that rate with SoftwareSerial.
  
 But using the Arduino’s serial port for the camera prevents us from sending debugging and status messages over USB. Instead, the LEDs on the Data Logging Shield are used…various blink patterns indicate the current status. Using the serial port also requires that the camera be unplugged when uploading sketches to the board, since it would interfere with the serial transfer. But using the Arduino’s serial port for the camera prevents us from sending debugging and status messages over USB. Instead, the LEDs on the Data Logging Shield are used…various blink patterns indicate the current status. Using the serial port also requires that the camera be unplugged when uploading sketches to the board, since it would interfere with the serial transfer.
Line 50: Line 49:
 {{ :​tutorials:​iotc:​jumpers.jpg?​nolink&​ |}} {{ :​tutorials:​iotc:​jumpers.jpg?​nolink&​ |}}
  
-Pins 5 and 6 are then connected to the red and green LEDs on the Data Logging Shield. The finished setup resembles the following (with solder connections between adjacent components being made on the back of the board):+Pins 5 and 6 are then connected to the red and green LEDs on the Data Logging Shield. The finished setup resembles the following (with solder connections between adjacent components being made on the //back// of the board):
  
 {{ :​tutorials:​iotc:​wiring.png?​nolink&​ |}} {{ :​tutorials:​iotc:​wiring.png?​nolink&​ |}}
Line 64: Line 63:
 Before proceeding any further, back up any data you might currently have on your Eye-Fi card. Just in case there’s some bug that’s been overlooked in the sketch, I’d hate to be the one to clobber your priceless irreplaceable wedding photos. So please, PLEASE back that up first! Before proceeding any further, back up any data you might currently have on your Eye-Fi card. Just in case there’s some bug that’s been overlooked in the sketch, I’d hate to be the one to clobber your priceless irreplaceable wedding photos. So please, PLEASE back that up first!
  
-The Data Logging Shield requires that the card be properly formatted. Some cameras and operating systems use a bit of “artistic license” when formatting SD cards, and the shield can’t always read or write these. ​The best solution is to use the SdFormatter sketch [[http://​www.adafruit.com/​forums/​viewtopic.php?​f=31&​t=20861|as described in this forum thread]]…or jump right to the [[http://​code.google.com/​p/​sdfatlib/​downloads/​detail?​name=sdfatlib20111205.zip&​can=2&​q=|download for the SfFat library and SdFormatter sketch here]].+The Data Logging Shield requires that the card be properly formatted. Some cameras and operating systems use a bit of “artistic license” when formatting SD cards, and the shield can’t always read or write these. ​You might need to borrow a friend’s more recent digital camera to format ​the cardRecent versions of both Mac OS X and Windows 7 seem to handle this better ​as well; with the latter, select FAT32 with a 32K allocation block size when formatting.
  
 With the card connected to your computer though a USB reader, you can then use an application downloaded from the Eye-Fi web site to configure it for access to your wireless network and select various settings for how and where you want images transferred. Once configured, if you have a digital camera, test it with that first. When the digital camera setup is known working and images are being transferred as expected, you can erase the images on the card and move it over to the Data Logging Shield. With the card connected to your computer though a USB reader, you can then use an application downloaded from the Eye-Fi web site to configure it for access to your wireless network and select various settings for how and where you want images transferred. Once configured, if you have a digital camera, test it with that first. When the digital camera setup is known working and images are being transferred as expected, you can erase the images on the card and move it over to the Data Logging Shield.
Line 72: Line 71:
 Next, upload the EyeFi sketch, then re-install the jumpers between pins 0-2 and 1-3. You can then either press the reset button to start the sketch, or disconnect from the computer and attach a power adapter or battery. Next, upload the EyeFi sketch, then re-install the jumpers between pins 0-2 and 1-3. You can then either press the reset button to start the sketch, or disconnect from the computer and attach a power adapter or battery.
  
 +**If using the latest Eye-Fi “X2” cards, you'll need to enable this one extra line in the sketch (it’s commented out by default)…around line 122:**
 +
 +  SD.enableCRC(true);​
 ===== Use It! ===== ===== Use It! =====
  
/home/ladyada/public_html/wiki/data/attic/tutorials/iotc.1331586444.txt.gz · Last modified: 2016/01/28 18:05 (external edit)