![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 |
Components and supplies
Apps and online services
![]() |
| |||
![]() |
| |||
|
About this project
Have you ever craved to eat something but need to postponed cooking it just because you run out of oil? Now, this won't happen again with the DRS Oil Container, an oil container that can automatically order new bottle of oil when you're running low of it.
The DRS Oil Container is equipped with ultrasonic sensor acting as level sensor and connected to the Genuino MKR1000. The Genuino will initiate a purchase with the help Amazon DRS API when the sensor reading is below the threshold value.
Hardware setupThis project only involves the use of Genuino MKR1000 and HC-SR04 sensor. The HC-SR04 is connected to the Genuino MKR1000 as shown in the schematics. The Trigger and Echo pin of the HC-SR04 can be connected to any digital pins of your choice. The sensor is then placed under the container's cap.
Software setupThis project utilize AmazonDRS Library. The library is available on GitHub together with tutorial to setup DRS with push button. Before you start coding, there few setups need to be done in order to enable the Genuino MKR1000 to initiate a purchase via the DRS API.
1. Create Amazon Developer account
3. Create a login with amazon (LWA) security profile
- Please take note of your Client ID and Client Secret as these need to be used in AmazonTokens.h file
4. Create a Dash Replenishment Device
- ASINs are Amazon's version of unique product identification
- Please take note of the devices Model ID and the respective Slot ID
5. Authorize the device created earlier to make purchases and get authorization code grant
- After you finish editing the AmazonTokens.h file and add your refresh_token, your Genuino is now ready to initiate a purchase
In this demo, water is used instead of olive oil. The Genuino initiate a purchase when the level is below 5 cm.
ConclusionThe project is not limited to replenishment of oil only but can be extended to any type of liquid container.
Code
Schematics
Comments
Author
Additional contributors
- Arduino amazondrs library by Brian Carbonette
- Arduino json library by Benoit Blanchon
- Ultrasonic library by J. Rodrigo
Published on
February 18, 2017Members who respect this project
you might like