Integrating physical devices with IOTA — The IOTA payment terminal
The full article was originally published by Coinmonks on Medium. Read the full article here.
The 9th part in a series of beginner tutorials on integrating physical devices with the IOTA protocol.
This is the 9th part in a series of beginner tutorials where we explore integrating physical devices with the IOTA protocol. This tutorial is the final part in a sequence of tutorials where we will try to replicate a traditional fiat based debit card payment solution with an IOTA based solution. In this tutorial we will be building a simple IOTA based payment terminal using some low cost off-the-shelf components.
The Use Case
Now that the hotel owner has his functional IOTA debit card payment system up and running there is one final issue he needs to address. This issue is related to how his new IOTA debit card solution can be used in a practical end user payment scenario. Up until this point, interaction with the system has been based on Raspberry PI with a connected monitor and keyboard. While this is fine for administrative tasks such as creating and issuing new IOTA debit cards, it may not be very practical as an end user payment interface. Imagine the waiter in the hotel restaurant having to drag around a large monitor and keyboard whenever a guest wants to pay for dinner. Or having a large monitor and keyboard connected to the swimming-pool locker. This would be both impractical and expensive. What we need is something like a portable payment terminal or some simple user interface that could be integrated in to the swimming-pool locker. Designing and building a slick and sexy portable payment terminal or machine interface is beyond the scope of this tutorial. However, using some low-cost off-the shelf components we should be able to build a prototype that could function as a proof-of-concept (PoC) for a future industrialized version.
The components you will need to build this project is as follows:
- Raspberry PI
- 12 Key — 4×3 Matrix — Membrane Type Keypad
- 1602 LCD Display with I2C
- RC522 RFID Reader/Writer module
- LED, breadboard, some wires and a resistor
All components except the keypad and 1602 LCD display have been discussed in previous tutorials so i will be skipping any further details on them in this tutorial.
The 12 Key — 4×3 Matrix — Membrane Type Keypad
The 12 Key — 4×3 Matrix — Membrane Type Keypad is a simple keypad that can be used as an input device to any project that requires numeric input. The keypad is popular among tinkerers for its low cost and ease of use. You should be able to get one of ebay for a couple of bucks.
You can also get these keypads in a 16 (4×4) key configuration. This may come in handy in cases where you need to execute other functions besides getting the numeric input. Notice that you will have to do some adjustments to the keypad library used in this tutorial if you choose to use the 16 key version.
The 1602 LCD Display with I2C
The 1602 LCD Display is a very handy and compact display commonly used for projects that requires simple character and numeric based communication. The 1602 has an adjustable back-light feature that makes it function equally well in light and dark environments. I have chosen to use the I2C version of the 1602 LCD in this project. The I2C version of the 1602 LCD has an additional I2C module (LCM1602) attached to the back of the LCD that allows for serial communication. Using the I2C module, we only need a minimum number of GIO pins and connections to get the LCD up and running with the PI.
Wiring the project
Use the following connection diagram to connect the various components used in this project.
Required Software and libraries
Before we start writing our Python code for this project we need to make sure that we have all the required software and libraries installed on our Raspberry PI. See previous tutorials for more information on installing the Raspbian OS, Python, Pyota and the RC522 RFID Reader/Writer library.