Saturday, March 26, 2016

Soldering irons and FTDI and bare modules (oh my!)

[question]
In my experience, Apple's default push notifications are fairly good about delivering things promptly and reliably, and email will be even better. I'm not terribly concerned about the reporting thing, I'm fairly comfortable writing dashboards and services for these. I do want to have it centralized so that I can get a notification if/when one of these looses power and stops pinging (or gets suddenly inundated with water or something). I can probably run that off a Pi or EC2 or whatever.

I'm planning to get two or three to start out with. We already have a soldering iron somewhere, so I think the only upfront things I need are the FTDI cable and a bunch of solder. After that, I think I can build these for less than $15/unit. If I'm doing them in bulk and get a little comfortable with soldering, I can shave a few dollars off that by getting https://www.adafruit.com/products/2491 instead of the breakout.



[answer]
Stick with the adafruit or sparkfun ftdi module.  While there are cheap $2 usb-to-serial converters out there, don't be too tempted.  Some use an "unlicensed" ftdi chip (which will give you no end of headaches with drivers...or worse).  Others are based on a different usb-to-serial chipset (CP-2102) that seems to work ok with windows, but is a royal PITA to use with a mac.  (I eventually did some sort of magic to get them to work on my mac ... but the 10.10-10.11 upgrade broke it)  Short answer: stick with the $20 genuine ftdi adapters from adafruit/sparkfun.  I've got experience with *all* the above problems.  And you know what they say ... "Good judgement comes from experience.  Experience comes from bad judgement."

Here's the thing with the bare esp-12E module from adafruit ... you'll still need to create your own method (board of some sort) to do the initial software load, *and* you'll need a minimal VRM to provide a clean 3.3v power source.   I originally intended to do just that with a small custom board, then I ran across these: http://www.electrodragon.com/product/esp8266-smd-adapter-board/  Even sourcing all the parts in bulk, I'm not sure I could build a board cheaper.  You get an easily soldered to/breadboarded breakout board *with* a vrm *and* the esp-12f already attached, all for $3.80!

You'll still need to do the initial flash with an ftdi module (they've got a picture of it hooked up on the page), but if you flash it with OTA (Over The Air) arduino code the first time, you can do subsequently loads via wifi*.   This, of course, also means you can update code easily when the thing is wedged *under* the dishwasher.  Or in the crawlspace.  Or behind the fridge.  :-)  Since you're already ordering from electrodragon for the water sensors, the additional shipping should be negligible.

I just ordered a handful of the above modules to experiment with.  If you're curious, I'll let you know the quality when they get here. (in...admittedly...about 2-3 weeks)

Re: soldering ... the adafruit iron will work fine...I've never seen them sell something they wouldn't use themselves.  A good iron makes soldering 10x easier.  If you can swing it, something like this ($40) http://www.amazon.com/Weller-WLC100-40-Watt-Soldering-Station/dp/B000AS28UC/ is even better and will last you until you're at *least* as old-n-busted as I am, if not longer.  ;-D

I've noodled the "how to know if the sensor has died" issue as well.  With the blynk app, when you add the notify widget there is a switch that says "notify is esp is down".  Which probably only works if the app is running on the individual phone.  It would be easy enough to write a service that runs on your home pc and regularly pings each of the registered sensor nodes.  Anything that doesn't respond over X amount of time triggers an email/sms alert.  Since you're using an a/c adapter, you won't necessarily need this now, but the esp8266 also has a built in incoming voltage monitoring function that makes it easy to keep tabs on battery charge levels.  See here: https://github.com/adafruit/ESP8266-Arduino and scroll down to/search for "ESP.getVCC()"

Ok ~ now get back to work!

*OTA info in a subsequent post ... stay tuned

No comments:

Post a Comment