Battery-operated wireless smart sensors (BOWSS) are one small facet of the general (buzzword) topic of the Internet of Things. On Tuesday and Wednesday afternoons from 2:30 until (4:30 or done), M5 will host discussions on various aspects of BOWSS in the Pi room.
2015-09-15 Tuesday
- We introduced the concepts of serial communications, baud rate, and TTL (transistor-transistor logic) signaling. Most microcontrollers have a built-in serial TTL communications capability.
- We identified the HC-05 and HC-06 as inexpensive devices that can convert a 3.3V TTL data stream to Bluetooth communications. We have not yet addressed the common issue of converting levels from 3.3V to the 5V that many older Arduino-style devices use.
2015-09-16 Wednesday
- We discussed the nature of the IoT.
- We introduced the constraints of battery operation, in terms both of battery power capacity (milliamp hours or mAH) and of peak power consumption.
While the concepts introduced in this discussion will be broadly applicable to many microcontrollers, the examples and the workshops will focus on the context of the ATmega328P microcontroller and generally the Arduino-style IDE. Most participants have their own Arduinos, and the others have access to M5’s Sparkfun Inventor’s Kits.
2015-09-22 Tuesday
- We discussed the Hayes AT command set
- Command mode, data mode
- Escape sequence +++
- Uses: Hayes SmartModem (1981); HC-05, HC-06; XBee; ESP8266
- We introduced various ways sensors communicate with other devices
- on-off
- voltage level
- serial over RS-232, I2C, SPI
2015-09-23 Wednesday
- We began discussing Arduinos as the typical platform for the microcontroller element of smart sensor nodes.
- We loaded the Arduino IDE and began working with Arduinos as the basis of our own smart sensor nodes.
2015-09-29 Tuesday
- We talked about networks in general in the context of the ISO/OSI 7-layer protocol stack. We discussed point-to-point, multicast, and broadcast communications in local-area networks. We talked about packet routing and non-routable and broadcast subnet addresses.
- We discussed serial communications over wires and over radio. We set up COM ports for Bluetooth connections and demonstrated the connections across two computers.
- Wires, Bluetooth, ESP8266, XBee, and other radios can all function more or less equivalently for the physical layer
- We walked through a simple Python script which connected, reconnected, maintained, and used the data from a Bluetooth serial connection, and discussed the slowness of restarting a disconnected Bluetooth link.
2015-09-30 Wednesday
- We assembled some test circuitry using small shunt resistors and oscilloscopes, and measured current and thus power consumption of various devices, beginning with the bluetooth radios and then sleeping and running Arduinos. We measured the power consumption by measuring the voltage drop across a shunt resistor and calculated current through the shunt and then power consumed by the whole circuit. We tried measuring differential voltage using the oscilloscope’s two channels (grounded only together) and the Math function to display the difference. With the channels grounded only to each other, we got much noise in the readings, and even in the difference readings. We then connected the grounds to the circuit. We were still unable to configure the display as we needed, and went back to single-channel readings.
- We tested several circuit configurations:
- board only, without microprocessor, to see power consumed by the indicator LED
- board with microprocessor but pin13 LED off
- board with microprocessor and pin13 LED on
- We began setting up a spreadsheet with which to analyze our raw data, hoping thereby to minimize the plague of calculation errors we were making.
2015-10-06 Tuesday
- Nobody showed up, so I finished my design for a a printed-circuit board to adapt the standard 8-pin (3.3V) ESP8266 module to an Arduino at 5V.
2015-10-07 Wednesday
- We discussed the setup of a spreadsheet to analyze our data.
- We looked at the spec sheet, for the ATmega328 and analyzed the digital IO circuitry to see if there was cause to suspect that an output pin’s circuitry might consume more power if the pin is set to LOW rather than to HIGH. We discussed the unidirectional and bidirectional tri-state buffers, the pull-up disable bit, the direction registers, and the sleep bit.
2015-10-14 Wednesday – SPECIAL TOPIC
- We will discuss the analysis of sensor data for normality. I recently received a batch of 10 sensors and the first one I tested looked funny. I did a histogram of the measured values and found that the values were skipping around – temperature jumping 2 or 3 degrees and never visiting the intermediate readings.
- We will discuss how we should handle new sensors especially from a cheap (suspect!) source.
2015-10-20 Tuesday
- Chuck has been playing! He has an ESP8266 in his basement sending data up to the Phant server at Sparkfun. We’ll discuss how that works, from several perspectives, including
- Flashing the ESP8266 for NodeMCU / Lua programming
- Setting up and using the Arduino IDE with the ESP8266
- The Phant server at Sparkfun
- Using HTTP GET and POST transactions to send data to (in particular) the Phant server
2015-10-21 Wednesday
- We’re about ready to look at the capabilities of the ESP8266 to run on batteries. There’s a timed sleep mode and a pin sleep mode surfaced in the Lua environment, and Chuck will be looking into them to discuss Wednesday. He will be trying to find the equivalent capabilities within the Arduino IDE, and will talk about these as well.
2015-10-27 Tuesday
- We will be having some lightning talks from participants in ECE297DP.
- We will be discussing networks of sensors and ways for consumers to receive the readings from the sensors. MQTT (see links below) is an emerging standard which we will investigate as a solution to this need.
2015-10-28 Wednesday
- We will be having some lightning talks from participants in ECE297DP.
- Chuck is working hard on building a tiny, inexpensive sensor-publisher device using an ESP8266/ESP-01, a MQ80B20 digital temperature sensor, and a couple AA batteries. We’ll discuss his success, or at least his progress.
2015-11-03 Tuesday
- Chuck has finished some prototype BOWSS systems. He has an ESP8266 in an ESP-01 form factor operating on batteries and measuring the outside temperature at his house, sending it up to a Sparkfun Phant server at https://data.sparkfun.com/streams/jqrXbAZ2Yws4WV3zArzz/. The hardware is very simple, comprising just a battery pack, voltage regulator, ESP-01, and DS18B20 one-wire digital temperature sensor, with no Arduino involved at all. He has replicated the system using an Adafruit Huzzah and again using a knock-off NodeMCU, each of which has many more IO pins exposed.
2015-11-04 Wednesday
- I now have a uCurrent Gold micro-current to voltage converter that I bought from David Jones (if you don’t know about EEVblog, look it up online). With it, we will be measuring the current requirements of the various ESP8266 configurations and during sleep, processing, and transmission.
Notes and Links
-
Both Discussions
- My (read-only) drop box folder with code associated with these discussions: https://www.dropbox.com/sh/d03363nkls358ti/AADbZLZpLy_I1yK8Hr1et22oa?dl=0
- Covers hardware and AT commands; indicates that the HC-05 can automatically reconnect at power up
http://www.robotshop.com/media/files/pdf/rb-ite-12-bluetooth_hc05.pdf - HC-05 diagram; contains schematic with suggested level-shifter circuit (3.3V to 5V)
http://www.seeedstudio.com/wiki/images/4/48/HC-05_datasheet.pdfhttp://wiki.iteadstudio.com/Serial_Port_Bluetooth_Module_%28Master/Slave%29_:_HC-05 - http://mcuoneclipse.com/2013/06/19/using-the-hc-06-bluetooth-module/
- http://www.instructables.com/id/Cheap-2-Way-Bluetooth-Connection-Between-Arduino-a/
- http://www.instructables.com/id/Add-bluetooth-to-your-Arduino-project-ArduinoHC-06/
- Poor English but with a table showing the differences between HC-05 and HC-06: http://www.tec.reutlingen-university.de/uploads/media/DatenblattHC-05_BT-Modul.pdf
- Sparkfun’s web services for IoT: https://data.sparkfun.com
- A good introduction to the ESP8266: http://hackaday.com/2015/09/24/hackaday-dictionary-the-esp8266/
- Pinout for all the ESP8266 carriers: http://www.pighixxx.com/test/wp-content/uploads/2015/09/ESP_Pinout_01.pdf
- My “hello, world” feed on the Sparkfun Phant server: https://data.sparkfun.com/streams/6Jx6O43dloS4v7RyxzaL
- And the graphical display of that feed at analog.io: https://analog.io/#/sLZ
-
Communications
- The Hayes AT command set
https://en.wikipedia.org/wiki/Hayes_command_set - Amazon source for HC-05
http://www.amazon.com/Innogear-Wireless-Bluetooth-Transceiver-Arduino/dp/B00JP05S6C - ISO/OSI 7-layer communications protocol stack
https://en.wikipedia.org/wiki/OSI_model - A good comparison and contrast of concepts: UDP, TCP, point-to-point, multicast, broadcast
https://blogs.oracle.com/lmukadam/entry/tcp_udp_unicast_multicast_i_th - IPv4 broadcast addresses, used to disseminate sensor readings over networks
https://en.wikipedia.org/wiki/Broadcast_address - Multicasting over IPv4 to avoid full-scale broadcasting
https://www.cs.utah.edu/~swalton/Documents/Articles/Multicasting-1.pdf - Public-domain and shareware serial communications tools
Windows: http://realterm.sourceforge.net/index.html - MQTT appears to be an emerging standard method for sensors to publish their measurements and for consumers of that data to subscribe to it. Here is a good tutorial for MQTT: http://www.hivemq.com/mqtt-essentials/. We will be discussing MQTT very soon.
- The Hayes AT command set
-
Battery Operation
- HC-xx
- At least one source indicates that the HC-05 and HC-06 consume 8-10mA, which at 3V is 24-30mW, and have no sleep modes. This level of power consumption is high in the context of battery-operated devices. It’s thus imperative to use devices that have a low-power (sleep) mode of operation. We have determined that the HC-05 and HC-06 devices in their normal 4- or 6-pin breakout configuration do not offer a sleep option.
- ESP8266
- The ESP8266 has a timed-sleep mode and a pin-sleep mode (edge triggered): http://www.esp8266.com/viewtopic.php?f=29&t=2472.
- There is a discussion of the power requirements of the ESP8266 here: https://www.sparkfun.com/news/1842
- In order to wake up from timed sleep, the ESP8266 needs to have a connection between GPIO16 (pin 8) and EXT_RSTB (pin 32). This page provides a pinout of the ESP8266 chip.
- HC-xx
Is this a good place to post links related to the IoT?
http://www.golgi.io/blog/understanding-security-in-iot-wi-fi-link-layer/
Sure. I’d like to encourage discussion here!