The design: hardware
The design consists of 4 major blocks:
- Esp8266 wifi microcontroller for internet connectivity
- Atmega328pb for sensor readings
- Usb uart for programming and debugging
- Power module consisting of LDO and step-up regulator
In guarding mode the esp8266 is powered off and the step-up regulator is input to output bypass mode. Thus the ATMEGA328pb is the only one who consumes power and is straight connected to the batteries. In this mode power consumption is about 10µA. When a sensor reading is needed the ATMEGA328pb enables power to the sensor. If the sensor requires 3.3V then the Step-up convertor is enabled. For internet connectivity, first the 3.3V must be enabled and power is enabled to the esp8266. If the transmission power is reduced and the internet connection is as short as possible. GoNotify uses an average of 1.5mAh per message. This with a secure HTTPS connection over REST protocol.
If an application requires an always on connection, for example being an MQTT client, it is best to power GoNotify via micro USB. In this case the batteries will act as a backup power when USB is disconnected. The LDO regulator will regulate 3.3V from USB. The circuit is always powered through the step-up regulator.
In order to allow development in an adaptive way, programming must become very easy. Furthermore debugging of the sensor application must be possible. Connecting GoNotify to your computer will install a virtual com port. When plugged into your computer the com port is connected to the ATMEGA328pb. The custom bootloader of the ATMEGA328pb will disable the esp8266 module and wil get ready to receive data.
For programming the esp8266 other logic is used. The esp8266 is connected on the second serial port of the ATMEGA328pb. The ATMEGA328pb will put the esp8266 in bootloader mode and will pass data through via the first serial to the second serial port. This is achieved via custom bootloader of the Atmega328pb. This approach can also allow OTA firmware updates. Data will enter via the esp8266.
I have a bunch of sample projects who show how to easily program your IoT sensor APP. They will gradually become available on github: https://github.com/ginodecock
From idea to IoT
You can use it as a connected device where sensor data is used for monitoring or use it as a simple remote controlled device.
Your sensorapp can make it even a smart device. Program it to alert and take action.
I hope you will utilise it a true internet product. Where it can be part of an ecosystem. Where the recorded data can be transformed into useful information. Here lies the incremental value of any IoT idea.