Back to Projects

PROJECT 02

Blockchain-Enabled P2P Decentralized Smart Energy Trading Platform

Consortium blockchain and smart-meter cluster on Raspberry Pi nodes with a double-auction matching algorithm.

10

Blockchain nodes

IBFT

BFT consensus

~200 TPS

Quorum capacity

WEM3080

Bi-directional meter

Overview

The project addresses the centralised, intermediary-heavy nature of conventional residential energy distribution. In a community with growing rooftop-solar penetration, individual households naturally become prosumers — producing surplus energy at some intervals and consuming it at others. Peer-to-peer (P2P) energy trading lets prosumers and consumers exchange energy directly, without a central utility broker acting as the trusted counterparty for every transaction.

The engineered platform combines three layers: (i) a per-household embedded node that physically measures energy import and export via a bi-directional smart meter, (ii) a permissioned consortium blockchain running on the same nodes to record trading data immutably, and (iii) an off-chain double-auction matching algorithm that pairs buyers and sellers in each trading round.

The demonstrated system is a 10-node Raspberry Pi cluster in which each Pi acts as a full blockchain node and as the embedded controller for its associated smart meter — a deliberately low-cost mapping of a residential household onto a single-board computer.

System Architecture

Physical Energy Layer

WEM3080 bi-directional smart meter (I, V, kWh, import/export)

Embedded Node

Raspberry Pi 4 · RS-485 / Wi-Fi bridge · relay control · local UI

Blockchain Layer

Quorum (Ethereum fork) · IBFT consensus · 10-node consortium

Smart-Contract Logic

Solidity contracts · round + phase timing tied to block number

Off-Chain Matching

Double-auction algorithm · hash-only result submission on-chain

P2P Settlement

Buyer/seller verification · real-world energy exchange

Hardware

SubsystemSelection & Role
Compute nodeRaspberry Pi 4 (Cortex-A72, 64-bit SoC) — runs the Quorum full-node client, meter polling, control logic and local UI in one platform
Energy meterWEM3080 single-phase net meter (150 A / 250 A CT variants). Measures V, I, instantaneous active power and cumulative import/export kWh
CommunicationsRS-485 (twisted-pair) via UART-to-RS-485 converter (MAX485-class) for wired Modbus; Wi-Fi used as the primary transport
ActuationSingle-channel relay (3.3 V / GPIO-driven) for load enable/disable per household
Power subsystem3.7 V 5000 mAh Li-Po cells (2 in parallel → ~10 000 mAh) with a boost / power-bank module supplying 5 V USB rails
Local UI3.5-inch RPi LCD display for status and console access; push-button control on the enclosure
Enclosure3D-printed housing integrating SBC, meter, battery, RS-485 module, relay and display; screw terminals for AC input / output wiring
Fig 2.1 — Fully assembled node: 3D-printed enclosure with Raspberry Pi, LCD status display, USB ports, and hexagonal ventilation pattern
Fig 2.1 — Fully assembled node: 3D-printed enclosure with Raspberry Pi, LCD status display, USB ports, and hexagonal ventilation pattern

Key Engineering Work

  • Running a full Quorum blockchain client on Raspberry Pi 4 — non-trivial given the ARM build target and the resource profile of a full Ethereum-family node
  • Bootstrapping an IBFT-based consortium network from scratch: node key generation, genesis configuration, static-node peering, and account allocation across the cluster
  • Deployment automation — replacing an entirely manual, command-line bring-up with Python and shell scripts that install toolchains, initialise nodes, clear state, and start the network reproducibly
  • Smart-contract engineering in Solidity around a round + phase timing model keyed to block number, including deterministic serialisation for hash stability
  • On-chain / off-chain co-design: keeping the double-auction algorithm off-chain and using hash-only submission with ⅔ agreement to bound gas cost
  • Smart-meter integration: polling the WEM3080 over Wi-Fi from a Python client, extracting bidirectional kWh data and feeding it into the on-chain state
  • Hardware iteration: revising the node from a PZEM-004T + Modbus wired design to a WEM3080 + Wi-Fi design, reducing physical wiring and SBC I/O load
  • Contract deployment via web3.py, including AES-128-based key material handling during automated deploys

Results & Validation

Hardware Validation

Blockchain nodes in cluster10
BFT consensusIBFT — reached and maintained
Required throughput (1 000 households)~1.67 TPS
Quorum envelope headroom~200 TPS

Ten-node Quorum consortium reached and maintained IBFT consensus across Raspberry Pi 4 hardware, with each node acting simultaneously as a full validator and as the embedded controller for its household smart meter.

Fully scripted network bring-up: tool installation, node initialisation, state clean-up, and smart-contract deployment run reproducibly from a single command.

Phase-1 data submission works end-to-end on-chain, including the serialised, order-preserving hash-chaining that makes the round history tamper-evident.

Phase-2 double-auction matching executes off-chain across the cluster and only its result hash is committed on-chain; ⅔ hash agreement is used to accept a round result.

Smart-meter integration reads and reports bidirectional energy import / export kWh to the blockchain, providing the physical measurement that grounds every trade.

Hardware revision from PZEM-004T (Modbus wired) to WEM3080 (Wi-Fi + RS-485) demonstrated the ability to iterate the field device without changing the blockchain layer.

Technical Stack

Hardware

  • Raspberry Pi 4 (per household)
  • WEM3080 bi-directional meter
  • Current transformers (150/250 A)
  • UART ↔ RS-485 converter
  • Single-channel GPIO relay
  • 3.7 V Li-Po (2× parallel)
  • Power-bank / boost module
  • 3.5-inch RPi LCD

Blockchain

  • Quorum (Ethereum fork)
  • Istanbul BFT (IBFT) consensus
  • Solidity smart contracts
  • solc + Remix compile pipeline
  • web3.py deployment
  • AES-128 keystore handling
  • Genesis + static-nodes config

Software / Ops

  • Raspberry Pi OS (ARM)
  • Go toolchain
  • Python (meter poll, deploy scripts)
  • Shell bring-up scripts
  • Modbus over RS-485 (twisted pair)
  • Wi-Fi meter transport
  • Double-auction matcher (off-chain)