The inspiration for this project came from the increasing need for increased security in online applications and a stall in the development of autonomous devices. This project aims to bring together blockchain and Iot technologies to propel the industry of machines. With all the security breaches in the past few years, the need for blockchain technologies will only continue to increase.

What it does

The rent-a-plug allows for any human or machine to rent energy by paying the plug in cryptocurrency on the Ethereum network. The plug, which owns an account, will accept tokens from the human and will turn on it's power at a rate of 5 seconds per token.

How we built it

We set up a private blockchain between our computer and Raspberry Pi. The configured computer ran two miner nodes to process blocks and submit transactions while the raspberry pi acted as a node on the network. The Pi was equipped with LED's to signal the status of the plug between on and off and a relay was used to toggle the connection of the plug to a main outlet. The status of the plug was logged off-chain while the tokens sent and equivalent time purchased was logged on-chain and read through a JS script running on the Pi.

Challenges we ran into

We had a fun time wiring up the relay and the outlet with whatever resources available to us in the vicinity. We cut our surge outlet cord to be able to supply the plug with power. It was also challenging to maintain a properly working test net with a finnicky internet connection. The design of the smart contract and JS script was made to optimize the speed and latency of the operation.

Accomplishments that we're proud of

The outlet is able to efficiently deliver rentable power to the user! All code works and our prototype looks awesome at its rawest form. We feel our main accomplishment was the ability to connect an IoT device to the blockchain via multiple API's including the Pi GPIO JS API and the Ethereum Web3 API. This is something that has not yet been investigated in this much detail in the blockchain world.

What we learned

We learned a lot about smart contract development and IoT development. We feel we can expand upon this combination with any other IoT device. We learned a ton about the inner mechanisms of a blockchain through setting up our own private chain and feel that this is crucial if we are to develop blockchain applications in the future.

What's next for Rent-A-Plug

The future in this technology lies in the forged relationship between blockchain and IoT. Blockchain gives machines an equal mode of interaction with other humans and machines such that autonomous machines can live among us. As AI continues to surface and machines become more and more autonomous, they will eventually need to be able carry out tasks on their own and transact value without human intervention. Blockchain technology is the only way forward in this regard. We will expand upon rent-a-plug to deliver powerful applications for our future.

Share this project: