Suppose you are staying in hotel. In most of the cases the refrigerator will be in the ON condition, would not be used till at the end of room evacuations and should also pay for that as part of the rent. Here I made a mechanism to directly pay for the refrigerators for the time being it's used. In this project, I have made a just demo of the refrigerators. In this way, by paying directly for the each devices in the room according to the usage will decrease the amount of the rent and also the energy consumption. One of the major aspects of the projects is that the energy is consumed for the appropriate usage and not wasted. Then we can discuss about the working....
Simply how it is working is, the python script which is running in the raspberry pi check for the balances on the IOTA Tangle and perform the switching of the relay. The Tangle is the data structure at the heart of IOTA. IOTA uses a DAG(Directed Acrylic Graphics) instead of a blockchain to store its ledger, with the main motivation being scalability. A blockchain has an inherent transaction rate limit, because all participants agree on the longest chain, and discard forks and side branches. The Tangle, on the other hand, allows different branches of the DAG to eventually merge, resulting in a much faster overall. The raspberry pi is serving as the control unit for the payment system. The refrigerator should have the particular address which is created using the IOTA wallet is shown below. The address may be a QR code or a long code consist of alphabets and digits.
The payment is based on these code. The QR code will be attached to the refrigerator(device), the person who scan the QR code transfer a certain amount of IOTA’s to the refrigerator depending on how long you plan to use it. when the transaction is confirmed by the Tangle, it will reflect in the refrigerator balance. So the raspberry pi will switch on the relay and refrigerator will turn on.The Python program will keep track of time used and the amount of IOTA’s you transferred, continuously removing time from your active balance, and finally turning off the refrigerator when your balance is empty.
Wire the project as per the schematics....
The python script is also attached below. Find it and run it on the raspberry pi.
Here is a screenshot of the terminal when I added some IOTA'S to the device.