Project Description
This system is designed for Electric Vehicles Charging station. The system is divided into two cards. One Card is a Master card which has the GSM Module, RTC and 2 output channel. This card can measure the energy consumption of two load. Second card is a expansion relay card which has 4 output channel and 6 output channel for solenoid. Solenoids are used to lock the compartment where user can put his charger while charging. Relay card is controlled by a the master card.
System Architecture

Working
Energy measurement
The master card is connected to one step down transformer(PT) to measure the AC line voltage and 6 seperate current transformer (CT) to measure the current flow while charging. The controller uses a Open source library (EmonLib) for calculating the energy consumption. The controller measures different parameters like voltage, current, wattage, power factor. USing these parameter, the controller calculates the total energy consumed while the charging cycle
Firmware & IoT
The ESP32 runs on a FreeRTOS OS. FreeRTOS can run multiple threads so that controller can measure the energy consumption of all 6 devices simultaneously. For the communication with the cloud, a Thinger platform is used. It creates a secure channel between the IoT device an cloud server. For the internet connectivity a 2G GSM module is used.
If any network issue found between the master card and server then the master card stores all the readings in the flash memory. Once the servers gets live it sends all the data to cloud server. A Thinger APIs are written in the ESP32 for accessing the data and controlling the master card.
User can schedule a task for specific channel that will turn ON the power of that channel. E.g. If user schedule a task for the date 12/03/2022 and time slot between 13.00 to 14.00 then the master card turn on the for on that data and time. In that 1 hour time, master card will calculate the energy consumption and that data is sent to cloud server.
Below are the other APIs used:
- Ping: To check if the IoT device is live.
- Create Task: To schedule a task for specific date and time
- Delete Task: To delete a scheduled task
- Read- To read the registered task on the device
- Reset- To reset the device
- Available Task Files- To check Available task file on device
- Locker- To open Locker solenoid
- Create_Unit_file-To create unit file
- Delete Unit- Delete Unit File
- Read Unit- To read unit file
- RTC_set- to set RTC time
- Signal Strength- Sim card network strength
The response of this APIs will get into the JSON format. A python script is written to test the APIs.
The device can be updated with a new firmware using the OTA (Over the Air) features.
Technical Specifications
- Network: 2G GSM
- 6 Channel for Charging points
- 6 Channel Input for CT
- 1 Channel Input for PT
- 6 Channel output for Solenoid
- OTA supported
- Onboard Flash Memory
- Onboard RTC
- Overvoltage and Overcurrent Protection
- FreeRTOS OS
Photos
Testing the Circuit
Variant 2: 4 Channel device PCB
Live Reading on Serial Terminal
