The Smart Tea Machine is a simple demonstration of how Unified Payments Interface (UPI) can be integrated with devices especially devices like Bolt IoT, Raspberry Pi, etc. It shows the relative ease and simple code that can be used to have basic functionality in a standard machine without display.
The main idea of this project is to make a machine that can be used with the Indian payment system with UPI and works with apps like BHIM, Paytm, PhonePe, Google Pay, WhatsApp Pay and many more.
The Existing old tea machine is used to prove the concept.***
A standard old tea machine has been modified to be controlled by a Bolt IoT WiFi Module with a 5v Relay. The Bolt IoT WiFi Module is directly connected to the 5V DC Pump inside the Tea machine. The Bolt IoT WiFi Module connects over WiFi to a Bolt Cloud and an integromat scenario with webhook checks regularly to see if a new transaction has done on the app. When it finds one, it wakes the Tea machine and dispenses a Tea.
Flow diagramBuy electronic components with free shipping on utsource.net
Opening the Old Tea MachineNow that the machine is open we are going to solder 2 wire to the DV Pump. As you can see in the image above.
Bolt IoT ConnectionThe connections between the Relay and BoltIoT are:
- Bolt IoT PIN0: Relay IN
- Bolt IoT 5v: Relay Vcc
- Bolt IoT Gnd: Relay Gnd
- Bolt IoT 5v: Relay Com
- Relay NO: DC Pump(+)
- Bolt IoT Gnd: DC Pump(-)
The final wiring for the project looks a bit messy but worked just fine.
After it was all wired up, We just test it out with a basic on-off program and then proceeded to check that the relay was firing.
For those of you who don’t know UPI (Unified Payments Interface), UPI was developed by the National Payments Corporation of India, make making payments between different bank accounts a hassle-free process. There are many UPI client apps and you can link more than one bank account with your UPI app. You can read more about it here.
UPI IntentBy using the UPI Intent as the payment method, you can ease the UPI payments for your services thus providing a superior user experience to people.
Benefits of UPI Intent
While you enjoy the benefits such as higher conversion rates, decrease in abandoned carts and a decrease in time to complete the payment, your customers are also benefitted in the following ways:
- No need to handle push or SMS notifications
- No need to switch between applications to complete a payment (merchant, SMS, app)
- No need to remember their VPAs
Understanding the Intent flow
- In the UPI Intent flow, the customer selects UPI as the payment method on your website or app. A list of UPI apps supporting the intent flow is displayed.
- Customers select their preferred app. The UPI app opens with pre-populated payment details is displayed.
- Customers enter the UPI PIN to complete their transactions.
- After the successful payment, the customer is redirected to your app or website.
To know more about the UPI Intent on Android apps, refer to the Android UPI Intent flow.
Building up the logic on IntegromatIn order to control our tea machine with our app, we will create a scenario on Integromat. In which we will be using webhooks to communicate between the app and Bolt IoT Cloud. You can upload our blueprint and modify it in your account.
Click on web-hooks and copy the webhook address for further reference.
The codePrerequisite: Android Studio
You can simply download the code directly from here.
And change your credentials like UPI id, name, amount, description, and webhook address according to your needs.
Note:- Make sure that your device has at least one UPI app installed.
For testing, You can download the app from here.
After finishing the transaction, we return back to our app and check whether the transaction was successful by setting up the callback Listeners method and trigger the hardware to dispense the tea.
Putting It All TogetherFinally, it was time to power on the Bolt IoT WiFi Module and check all the routines and app are working as per planned.
We are done!
We hope this gives you an idea of how you might go about integrating Unified Payments Interface (UPI) with the Bolt IoT WiFi Module.
Let us know if you have any questions!!
Comments