At Phoenix Industries, we have a considerable number of injection molding machines, many of which are a bit older. Consequently, not all of them have the capability to connect to the internet. As a response to this challenge, I undertook a project to create a device that can extract data from the energy meters using Modbus communication and transmit this data to the cloud. This enables us to analyze the collected data effectively.
The energy meters used in our machines are Schneider Electric's EasyLogic PM1200 and PM2100 series. These meters are equipped with an RS-485 communication line, which allows us to extract data from them. In this project, we utilized an ESP8266 microcontroller as the primary controller. Extracting data from Modbus, where the data is 32 bytes long, presented a challenging task. We needed to convert this raw data into meaningful information
For our IoT project, I opted for Google Firebase as the database solution due to its ease of implementation and relatively low cost. However, developing a web interface to access and display data from Google Firebase presented a challenging task. This is because we needed to collect energy data from over 100 meters every 5 minutes and send this data to Google Firebase, resulting in a substantial volume of data over the course of a year. To manage and showcase this data effectively, I had to implement various methods. The web interface was developed using JavaScript, CSS, HTML, and Bootstrap
A major concern in this project is ensuring data reliability, particularly because of the unreliable internet connection, which has caused numerous issues. To address this challenge, I devised a solution involving SD card backups, but it's not the conventional SD card backup. The ESP8266, with its limited processing power and memory compared to other microcontrollers, posed a unique challenge. To overcome this, I implemented a strategy where I attempted to upload the energy data to Google Firebase as JSON. However, if the upload was unsuccessful, I saved the data as JSON in a text file on the SD card. When an internet connection became available, the system would automatically transmit the saved data back to Google Firebase. This approach allowed us to maintain system functionality even during extended periods without internet connectivity.
When sending and backing up data in Google Firebase, I also needed to minimize the amount of data read and written to the database to reduce unnecessary costs. This was crucial because our web dashboard displayed real-time energy meter data, including voltage, current, power, and power factor. Uploading this data every second, even when users weren't actively viewing it, would lead to inefficient database usage. To address this, I implemented a solution where I only uploaded real-time data when users were actively viewing the dashboard. To achieve this, I utilized Google Firebase callback functions to wake up the ESP8266 and send real-time data when requested by the user.
After creating the prototype, our next step is to manufacture 100 devices that can be connected to various machines. To achieve this, I need to design a PCB (Printed Circuit Board) for the device. During the PCB design, I incorporated an additional I/O expander to cater to future requirements. Additionally, I ensured that all the input and output pins are capable of handling 24 V, providing versatility for various applications
In conclusion, the system is functioning quite well, and it continues to be in the research and development stage. This project has proven to be a valuable opportunity, enabling me to confront and resolve numerous challenges in the development of an industrial-level IoT device, all while managing everything within the constraints of a small microcontroller. It has been a rewarding endeavor that has enriched my experience in this field
Version one IOT Energy meter phototyping
Version two IOT energy meter
Version one IOT Energy meter phototyping
Final IOT Energy meter