Skip to content

WilliamBaltus/IoT_Smart_Contract

Repository files navigation

IoT Smart Contract

This is a project for EE-629. A smart contract that will execute utilizing Chainlink, Ethereum (Kovan network), and Raspberry Pi! Check out the website at https://sites.google.com/stevens.edu/williambaltus/home.
(The website contains much of the information on the progress and achievement of this project)

A Synopsis

This project leverages IoT, Cloud, and Distributed Ledger Technology. It's task is to execute a transaction between two wallets on the Ethereum Kovan test network based on environmental data gathered from a BME680 sensor. The flow of events in this project is the following:

  1. Collect environmental data via a BME680 sensor and Raspberry Pi
  2. Push sensor data to Firebase Database via Raspberry Pi
  3. Load webpage using Flask
  4. Pull data from Firebase Database
  5. Publish data on webpage
  6. When webpage is GET requested, return JSONified data!
  7. Smart contract with paired LINK node sends GET request to webpage
  8. Smart contract receives environmental data
  9. Smart contract compares environmental data to threshold value
  10. Smart contract transfers funds from one wallet to another

Replication and Running ✅

Prerequisites:
  • Google Firebase Database (Cloudstore)
  • Heroku account and app created
  • Add Firebase environmental variables and credentials to config vars section of Heroku app
  • Raspberry Pi
  • BME680
  • 4 Male to Male jumper cables
  • Breadboard

Running

  1. Wire the BME680 and the Raspberry Pi as follows: Image of Wiring
  2. Create a virtual environment (Windows) via
    python3 -m venv .env 
    source .env/bin/activate
  1. Install all requirements to run via pip install -r requirements.txt

  2. Next install bme680 requirements via pip3 install adafruit-circuitpython-bme680

  3. Next ensure to change the .env file with your particular Firebase credentials.

This project cannot be directly replicated from this repository but a brief tutorial can be found below.

Flask WebPage

Google Firebase Database

Heroku-- Cloud Hosting


---------------------------LABS-------------------------------


Lesson 5

Lesson 5A

Image of Lesson5A

Lesson 5B

Image of Lesson5B

Image of Lesson5B

Lesson 6

Lesson 6A  

 

Image of Lesson6A

Image of Lesson6A

Lesson 6B  

 

Image of Lesson6B

Lesson 7

Lesson 7B  

 

Image of Lesson7B

Lesson 8

Lesson 8A  

 

Image of Lesson8A

Image of Lesson8A_titanic

Lesson 8B

I was unable to set this up properly, I was have issues sending over the .csv file unfortunately.

Lesson 9

Lesson 9A 

 

Image of Lesson9A

Lesson 9B 

 

Image of Lesson9B

Lesson 10

Lesson 10A 

 

Image of Lesson10A Image of Lesson10A Image of Lesson10A Image of Lesson10A

Lesson 10B 

 

Image of Lesson10B

About

This is a project for EE-629.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages