The project is about electricity meter reader using Espruino board and framework. With the help of photosensitive diode sensor, Espruino board will read the LED pulse on electricity meter (digital type of meter), translate it into watt hour and publish the data to MQTT broker. Later, we can view the meter reading anywhere via an iOS app.
The story behind this project is this deck. I use this project as a demo for my talk in Bandung Developer Day #2 about Mobile + Cloud + IoT case study.
This complete source code is on GitHub. The code contains two parts:
- Espruino code. Only JavaScript code is uploaded, as I assume you'll use Espruino Web IDE
- Xcode project for iOS app. Code in Objective-C.
Required Setup
To deploy this scenario, you need:
- Espruino Pico. Original board may work, but I don't have it for testing.
- WiFi module. You can use this WiFi shim, or build your own like I did. The wiring and details are here. In that link you get the instruction on how to setup the ESP8266 firmware.
- Light sensor. I use photosensitive diode light sensor. You can use LDR-based light sensor
To simulate the LED pulsing (that's supposed to be on the actual meter), I use NE555 pulse generator module. You don't need it if you have actual meter.
The wiring between light sensor and Espruino Pico:
- AO of light sensor <—> A5 of Espruino Pico
- VCC of light sensor <—> 3.3v of Espruino Pico
- GND of light sensor <—> GND of Espruino Pico
MQTT Broker
In order to receive and broadcast the reading data, you need to have a MQTT broker, or use testing server like HiveMQ here: http://www.hivemq.com/try-out/
iOS App
I made a simple iOS app to display the reading that's submitted to a MQTT broker. I code it the app in Objective-C, but it seems simple to convert it to Swift.
App capture:
So, now you should be able to monitor your electricity usage from anywhere in the world. Good luck!
Comments
Please log in or sign up to comment.