Low Cost Sensor Platform

Parts List - Sensor Platform 3.1

# Name Cost Quantity Weight Link
001 Particle Photon WiFi SoC $19 1 5g Link
002 ODroid Weatherboard2 $18 1 2g Link

Home reading:

Last reading: 2018-03-03 13:20:17
Temp: 60.94 °F
Humidity: 43.67 %
Atmo Pressure: 1487.75 Pa
Light: 263 Lux

Build - Sensor Platform v3.1

The TMP36 sensor was alright but I wanted a bit more accuracy for around the house. At work, it's cheap, reliable but good enough accuracy to let us know if heat or air conditioning failed. Definitely enough to know if something was dangerously hot or cold. Around the house, I was willing to pay a couple bucks more for better accuracy. I had a ODroid Weatherboard laying around from my Parts Cart build. Original intention was to use the ODROID-C1+ for temperature sensing. But I only keep it turned on when I'm using the Android PC, so a bit of a non-starter. I had a spare Particle.io Photon handy... so I used that. Definitely the easiest internet related devboard I've used.

I2C is a digital communication format. Unlike analog sensors, you can run multiple sensors or whatnot with a single set of wires. More expensive, but typically more accurate and more capable. This was the first time I gave it a shot. The Weatherboard2 uses a BME280 sensor (temperature, barometric pressure, humidity) and a Si1132 sensor (UV index, IR index, ambient light). The ODroid provided Arduino sketch was cumbersome with eight external libraries. I used ControlEverything BME280 and SI1132 sketches which were much much much cleaner. The adafruit library used the wrong address, for some reason. As documented, the BMP280 uses address 0x76 and SI1132 uses address 0x60. All I had to do was rename some variables, then it worked easy as pie.

Wiring as also simple. Ground pin to ground on the Photon, P3V45 pin to 3.3 power pin on the Photon, SDA and SCL to pins D0 and D1. Leave INT0 and ADC3 pins alone.

Parts List - Sensor Platform 3.0

Excludes fasteners

# Name Cost Quantity Weight Link
001 Particle Photon WiFi SoC $19 1 5g Link
002 TMP36 $1.50 1 0.2g Link
003 1K carbon film resistor $0.02 1 0.1g Link

Office reading:

Build - Sensor Platform v3.0

I had pretty high hopes for the SparkFun ESP8266 "Thing", but it was just too aggreviating to develop. For $3 more, the Particle.io Photon was a breeze to develop. Instead of shorting pins, constant rebooting the board, careful pouring over spotty documentation, this was actually fun rather than a trial. Only difficulty was the initial setup, and that was under 15 minutes. Documentation was good enough to develop a very simple program in short order. The Photon also has a very good number of pins for all kinds of useful inputs/outputs. I was leery, but the cloud IDE worked very well.

Arduino Code : 29 lines, temperature is refreshed every 5 seconds
Python Code : 20 lines, collection is run every 10 minutes.

Really, it's under ten lines of operative code. Rest is comments, headers, credentials or housekeeping stuff. Hoping the carefully streamlined code means it's stable. From the device taking a reading, to uploading the data to Spark's servers, to be downloaded to SQL, etc runs between one and three seconds, depending on lag along the way. Wiring is very simple. 3V3 pin to first leg of the TMP, Analog Pin 7 to middle leg, Ground (GND) pin to third leg. Run a 1k resistor between the data line and ground, that's often omitted. I've never gotten remotely decent readings without said resistor. Running a capacitor to smooth out out the readings might be a good choice. If your TMP36 gets VERY hot, you have the pins backwards. Surprisingly, it won't instantly burn out the temperature sensor. Who knew? But it's been slightly more inaccurate than I'd like, mostly off by a degree or two in either direction.

STL Download - Case base, 53g of material, two 'pre-drilled' mounting tabs. Meant for the header version, but the headerless version will work fine as well.
STL Download - Case lid, 18g of material, can secure with glue or acetone to chemically weld

Particle Photon vs Sparkfun ESP8266 Thing (WRL-13231)

I initially purchased the ESP8266 Thing because it had an excellent price point and on paper had better features. It had a pretty low number of I/O pins, but I envisioned using them for single purpose. Control a relay, run a single sensor. Plus the I2C pins can be used to control a TCA9548A 1-to-8 I2C multiplexer which is around $7. So the lack of pins isn't a dealbreaker. The issue is mostly design. Normal FTDI cables or boards will have issues, as you need DTR instead of RTS. You'll need to edit standard libraries to shift NodeMCU GPIO to their custom pinouts. I liked the pads on the board for the TMP102 temp sensor and TSL2561 light sensor. If they had been included, would have been nifty. I haven't even tried encrypting the traffic, but they have a pad for a ATECC108A. Power usage wasn't bad, I liked that aspect. Documentation wasn't that great. Flash size was very small, so don't expect a lot of room for programs.

There's no button (or pads) for doing a reset. Herein lies the problem. They use Pin 0 for resets. Sort of. During startup, if Pin 0 is high, it loads the normal problem. If grounded out, it starts the bootloader so you can upgrade the board. Except it's inconsistant. Sometimes I left the pin grounded and could upload. Other times I had to pull the wire jumper. A physical jumper would have made a world of difference and likely been 10 cents to include.

Parts List - Sensor Platform 2.0

Excludes fasteners and sensors

# Name Cost Quantity Link
001 SparkFun ESP8266 "Thing" WiFi SoC $16 1 Link
002 USB to TTL Serial Cable $10 1 Link

Build - Sensor Platform v2.0

The stability of the Beaglebone wasn't as good as hoped. It's fairly low profile, but higher price than desired and somewhat power intensive. The SparkFun ESP8266 Thing is an Arduino with built in WiFi. It's incredibly small (28mm x 56mm) and very small power draw. The ESP8266 runs 5V at 70 milliamp, so about a third of a watt. A USB wall charger will have a lot more wattage in AC/DC conversion loss. It charges off Micro USB port, and has built in JST connector for a Lithium battery. It can charge the lithium battery as well as run off it. I plan on rigging up a 18650 battery backup, as they're cheap and sturdy. The math says a single 3500mAh battery should last about two days.

It's not well documented but there's unpopulated surface mount pads for a ATECC108A crypto module for encrypted traffic, a TMP102 module for temperature sensing and a TSL2561 luminosity sensor. Issue is that a surface mount TMP102 would give you the board temperature rather than the ambient temperature. I'm planning on using a thermal camera to test how much the board warms up. If it's constant, you could adjust for a rough ambient temperature.

The bad parts. Documentation exists, but isn't laid out the best. To program the Thing, you need to short Pin 0 to Ground (GND) when you turn the board on. I have had better luck leaving the jumper in during programming. There's a delay of about 15 seconds before you can upload. There's a trace you can cut and install a jumper. I haven't done so yet. You need an FTDI cable to program it, but it has to support DTR. Easier to just buy a USB to TTL Serial Cable or a Debug Cable.

I used Phant for communication. Mostly because there was Arduino sketches already available. Easy enough to install on CentOS, " yum install npm " , " npm install -g phant " and then " phant ". Then adjust iptables to open up ports 8080 and 8081. I need to set up phant to run as a service, but will hold off until development is complete.

TinkerCAD is a decent CAD webapp made by AutoDesk for 3D printing. Simple enough to be easy to use, complex enough to make useful objects. No doubt other software has more ability, but this worked well enough. Most importantly it can export and import STL, which is the most widely accepted 3D printing format.

Since I'm using a MakerBot 5th gen Replicator, I just used their standard software. Both MakerBot Desktop and MakerBot Print both have their good and bad parts. The Android app is handy for monitoring the status of print jobs. If your print is screwed up, you can cancel the job and not waste a ton of filament without having to stand by the printer for hours on end. I wouldn't have purchased a MakerBot Replicator if given the choice, but since I have free use of one, beggers can't be choosers. Expect the extruder to go bad every 100 hours. At $125 per, it's not a cheap replacement. Makerbot released a new $200 extruder that allegedly will last at least 700 hours.

3D printing a case for Sensor Platform v2.0

Both parts are 60mm long and 30mm wide. The bottom section is 14mm high, the top section is 2mm high. Printed on a MakerBot Replicator. Took about 40 minutes per part. You can get them printed online for around $5. Stands take an hour each, and would probably be roughly $4 each.

Build - Sensor Platform v1.0

Original sensor platform was a Beaglebone Black running a python script to query a TMP36. Here is an Adafruit tutorial that covers it neatly. Mine differently pretty much solely that I used SSH to upload the sensor data to a MySQL server with a pretty chart and statistics. Plus some logic to send email and text alerts. Script is launched by chrontab. It needs a rewrite.

Script is Sensors-Temp-v6-sterile.py

PHP Chart Library can be found at pChart.net