Project Description

This system was designed for Electric Vehicle (EV) Charging Stations to provide reliable energy metering and cloud-based monitoring.

The design is divided into two main cards:

  • Master Card: Contains the GSM module, RTC, and 2 output channels. It can measure the energy consumption of two loads and handle all cloud communication.
  • Expansion Relay Card: Provides 4 relay output channels and 6 outputs for solenoids. The solenoids lock the charging compartments, ensuring secure access during charging. The relay card is fully controlled by the master card.

This modular architecture allows easy scalability for charging hubs with different capacities.


System Architecture


Working

Energy Measurement

  • The master card interfaces with a step-down transformer (PT) for AC voltage measurement and 6 current transformers (CTs) for load current measurement.
  • Energy parameters such as voltage, current, power factor, real power, and watt-hour consumption are calculated using the EmonLib open-source library.
  • With these parameters, the system continuously computes total energy usage per charging session, ensuring accurate billing and monitoring.

Firmware & IoT

  • The ESP32 controller runs on FreeRTOS, enabling real-time multitasking and allowing energy data from 6 charging points to be processed simultaneously without delays.
  • Secure cloud connectivity is achieved through Thinger.io, which provides APIs and dashboards for remote monitoring and control.
  • A 2G GSM module is used for communication in areas where Wi-Fi is unavailable, ensuring wide deployment capability.

Data Handling and Synchronization

  • In case of network loss, the device automatically stores readings in onboard flash memory.
  • Once the connection is restored, the stored data is uploaded to the cloud server, preventing data loss.

API Functions
The firmware integrates custom APIs for both monitoring and control:

  • Ping – Check device availability

  • Create Task / Delete Task / Read – Manage scheduled charging events

  • Reset – Reset device remotely

  • Available Task Files – Monitor stored schedules

  • Locker – Control solenoid lock for charging compartments

  • Unit File Management (Create, Delete, Read) – Manage energy unit files

  • RTC_set – Synchronize real-time clock with server

  • Signal Strength – Check GSM signal levels

  • API responses are structured in JSON format, simplifying integration with cloud dashboards and external applications.

  • A dedicated Python test script was developed for API validation during prototyping.

Scheduling Example
If a user schedules a charging session for 12/03/2022 from 13:00 to 14:00, the master card activates the respective channel at the given time, logs energy usage for the one-hour slot, and then uploads the consumption data to the cloud.

Firmware Updates

  • Over-the-Air (OTA) updates allow seamless firmware upgrades without physical device access, reducing maintenance costs and downtime.

Additional Features

  • Overvoltage and Overcurrent Protection to ensure safe operation in EV charging environments.
  • Onboard RTC for accurate timekeeping and scheduling even without network connectivity.
  • Secure cloud integration for energy tracking and billing.
  • Modular design that can be expanded by adding additional relay/solenoid cards.

Technical Specifications

  • Network: 2G GSM
  • 6 charging channels with current measurement
  • 6 CT inputs for current sensing
  • 1 PT input for AC line voltage measurement
  • 6 solenoid outputs for locker control
  • Onboard flash memory for offline storage
  • OTA update support
  • Onboard RTC for scheduling
  • FreeRTOS-based firmware on ESP32
  • Overvoltage and Overcurrent protection

Applications

  • EV Charging Hubs – Accurate energy tracking for each charging point
  • Smart Grids – Remote energy monitoring and demand management
  • Industrial Power Management – Monitoring machine-wise energy usage
  • Community Energy Sharing – Multi-user energy tracking with cloud-based dashboards
  • Secure Charging Lockers – Integration of solenoid-based locking for safe public charging stations

Photos

Testing the Circuit


Variant 2: 4-Channel Device PCB


Live Reading on Serial Terminal