Project in progress

AmazonDRS NFC Replenisher © Apache-2.0

"You just say what the thing does and then you add '-er'." Replenisher keeps your fridge, office...stocked! Just scan! "I'm going on break!"

  • 24 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)
3D Printer (generic)

Apps and online services

About this project

This project utilizes the AmazonDRS Arduino library to initiate frictionless purchases on Amazon by scanning NFC tags.

Looking for some help getting started with AmazonDRS Dash Replenishment for Arduino and still need to get your Amazon accounts setup, authorize 'Log in with Amazon', exchange tokens, etc? Hop on over to the Getting Started guide at the AmazonDRS GitHub repo and try out the Amazon Dash Button for Arduino project.

1/12/2017 - Coming Soon!

I'm working on creating an Arduino shield(aimed at the Due and Zero) that will incorporate the ATWINC1500 WiFi and the PN532 transceiver for NFC all in one shield sized package. Stay tuned for more updates!

2/26/2017 - The Shields Are In!

Check out the video below for a complete demo of Replenisher! I The shield combines NFC, WiFi, EEPROM, and an LCD. The open source design and libraries for interacting with the shield are all available here! Big thanks to Andium(a new IoT startup I work at) for working with me to spin off a small batch of these shields to make available to the community! You can grab one here. I created a project hub on hackster where I'll start posting more projects and ideas that spin off from the new shield.

Replenisher Demo Video


The Amazon Dash Button for Arduino is cool, but once the excitement of interacting with the API wears off there really isn't anything too mind blowing about hitting a button to place an order. So I decided to create this project to show a different way you might want to initiate frictionless Dash Replenishment around your home or office.

The idea is to use NFC tags to create a more fluid replenishment process for products that might not necessarily pair with a "smart" device. A smart fridge that orders groceries is great, but does your T.V. remote really need a WiFi connection to order new batteries? Utilizing the unique product identifiers Amazon uses called ASINs we can burn an identifier into each RFID tag. The sticker tags could be placed anywhere! Manufacturers could even print them onto their packaging or place them inside their devices. Since RFID tags are passively powered they require no batteries, no WiFi, no time consuming setup. The only device we need to connect to WiFi is the NFC scanner that we're about to create!

Getting Started


First lets make sure you have all of the necessary hardware for the project. I've used the Arduino MKR1000 but any WiFi 101 enabled Arduino should work.

In order to scan NFC tags we're also going to need an NFC antenna and transceiver. I've decided to go with Adafruit's PN532 NFC shield with a built-in antenna. The shield is designed for the typical Arduino Uno/Due/Zero/Etc shield form factor but there are breakouts on the board for SPI so we can easily wire up our MKR1000. In addition to headers that ship with the shield and the Arduino we'll also need, jumper cables, and some NFC tags. Specifically Ntag203 Mifare Ultra-light tags(I chose the round stickers, you'll see why in a minute!) This specific flavor or RFID tags are compatible with Adafruit's shield as well as most Android phones and tablets I've tried.

If you haven't already, solder the two rows of header pins to your MKR1000 and solder the provided shield headers to your PN532 shield. We'll be using SPI so you only need to solder the NFC shield headers to the strip labeled for power (IOr, RST, 3v, 5v, GND...) and the SPI header(MOSI, SS, MISO...etc). You'll also want to make sure you bridge 'SEL 1' and 'SEL 0' with a blob of solder to configure the shield for SPI. If you're a bit lost on setting up the shield check out Adafruit's getting started guide for the PN532 shield.

Let's wire up the shield!

Outlined in this Fritzing diagram are all the connections you'll need to make between the shield and the Arduino. Take note below of SEL 1 and SEl 0. Those are the copper contacts that need to be bridged together, each witch a blob of solder, so we can use SPI to communicate with the shield instead of I2C.

Here's a quick rundown on all the connections made above. Arduino on the left ':' shield on the right....

  • 5v : 5v
  • VCC : 3v
  • Gnd : Gnd
  • SCK : SCK
  • DIO 7 : RST
  • DIO 6 : SS

Great! Now that we've got the hardware we can get some practice using the shield and NFC by configuring our registration and product RFID tags.

Creating Product Specific RFID Tags

Each product we want to seamlessly replenish using our 'Replenisher' will need to be burned into it's associated RFID sticker/tag. I've chosen these 5 products(ASINs) while creating my Dash Replenishment Device.

At this time creating slots, Dash Replenishment Devices and adding ASINs are tasks aimed at the device manufacturer or developer. In order for this tool to gain widespread adoption I'm imaging Amazon opening up slot creation and ASIN selection to the end user.

In anticipation of the new Arduino shield I'm creating for 'Replenisher' (I should hopefully receive by the end of the month!) I'm working on a sort of mash-up of my favorite PN532 libraries I've found on GitHub. Consider it a "Best of" consisting of Adafruit and Seed Studio's PN532 libraries, as well as Don Coleman's NDEF library. The library will have a handful of example sketches and will utilize hardware interrupts by default (IRQ pull-ups are already wired on the shield). As soon as I get the shield and test I'll release that library and more detailed instructions working with NFC. So for now I'll keep these steps sort of high level. If you'd like to give this a go now you should still be able to perform what you need to do using Adafruit's library. Just double check you've used the correct SS and RST pins.

  • Format each(5) Ntag203 Mifare Ultra-light tag to support NDEF.
  • Add a 'text record' containing the corresponding Slot Id to each tag.
  • Print some sticker labels for the tags!

Format as NDEF

This process changes the structure of the RFID tag to support the NDEF standard. This way our tags are bit more universal and can be easily deciphered by any reader that supports NDEF. This will also standardize the terminology I'll use to refer to the data being passed around.

Add a Text Record

NDEF tags can contain messages, and messages contain one or more records. Our text record contains the 'Slot Id' we pulled from our Dash Replenishment Device. You can find these in your Dash Replenishment Developer Portal, just edit your newly created device.

NdefMessage message = NdefMessage();        
message.addTextRecord("0a6028b7-7509-4b91-b97e-3e291f386461"); //slotId

Repeat this process for all 5 tags! If you read one of the tags the message data contained on the tag should look like this...

NDEF Message 1 record, 43 bytes 
 NDEF Record 
   TNF 0x1 Well Known 
   Type Length 0x1 1 
   Payload Length 0x27 39 
   Type 54  T 
   Payload 02 65 6E 30 61 35 30 32 38 62 37 2D 37 36 30 39 2D 34 62 39 31 2D 62 39 37 65 2D 33 65 32 39 31 66 33 38 36 34 37 31  .en0a6028b7-7509-4b91-b97e-3e291f386461
   Record is 43 bytes  

The '.en' is the encoding type for the for the text record 'english'. To really do this properly we could have added a mime media record with a type of "application/json" and stored something like...


on the tag but this is just a proof of concept for now so the text record will do just fine.

Print Labels

The last step is to print some labels with images of our products. This way we can easily identify the tags and what we'll be replenishing when we scan them! I picked up some Avery 6450 labels and added images using a template in MS Word.

Then just place the tags wherever they make sense. I placed the cup on the cupboard door, stuck the batteries to the back of the remote, the coffee on the side of the coffee maker, the cutlery on the shelf and the notebook to the inside cover. When it's almost time to replace these items just scan and... voilá order placed!

There's one last tag to create! That's our device registration tag. This tag will be placed on the side of 'Replenisher' the scanning device. So when you first unbox the device and are ready to authorize 'Log in with Amazon' and manage your product selections you can do this without even going to the computer!

Just take your 'Login with Amazon' consent request url...

Shorten it using a tool like or Google link shortener...

And write a new uri record to an RFID tag!

NdefMessage message = NdefMessage();        

Now when the user scans the device with their NFC capable phone or tablet they can register their products and slots and authorize replenisher right then and there.

Demo of initiating device registration via NFC

Next lets take a closer look at the amazonDashNfc sketch and see how it all works!

amazonDashNfc The Arduino Sketch for 'Replenisher'

#include "AmazonDRS.h"
#include "AnduinoNFC.h"
AmazonDRS DRS = AmazonDRS();
AnduinoNFC NFC = AnduinoNFC();
//WiFi creds -----------------------------------------------------------------
char ssid[] = ""; //  your network SSID (name)
char pass[] = "";    // your network password (use for WPA, or use as key for WEP)
void setup() {
 while (!Serial) {
     ; // wait for serial port to connect. Needed for native USB port only
 //Setup NFC
 //Start up DRS
 //initialize slots
 DRS.retrieveSubscriptionInfo();  //check slot statuses
void loop() {
 //scan nfc tag containing slotId
 //if scanned id matches a valid slot and the slot is available
 //request replenishment for the supplied slot
  if (NFC.packetReady())
       NfcTag tag =;  //attempt to read the RFID tag 
       tag.print();              //and print the results to the terminal
       NdefMessage message = tag.getNdefMessage();
       NdefRecord record = message.getRecord(0); //grab the bits that contain the DRS Slot ID
       int payloadLength = record.getPayloadLength();
       byte payloadBytes[payloadLength];
       String payloadString = "";  //store the RFID msg bits in a String for comparison
       for(int i=3; i<payloadLength; i++)
         payloadString += (char)payloadBytes[i]; //load up the cmp string with payload less the encoding 
       if(slotId0 == payloadString)    //eventually if(slotId[i] has a match and slotStatus[i] is available 
           //we have a match! replenish the products associated with that slot!            
         Serial.print("Sorry, slot ");
         Serial.println(" is not available at this time");

Pretty short right? The amazonDashNfc sketch is fairly simple! Essentially the 'Replenisher' device boots up, connects to WiFi, checks the subscription info, and then waits for a tag to be scanned!

 DRS.retrieveSubscriptionInfo();  //check slot statuses

Upon startup this method contacts the Dash API endpoint /subscriptionInfo and grabs the latest slot status information. This will pull in and locally save all slot id's and whether or not they were authorized for replenishment. When a tag is scanned we check for a matching slot id and verify its status. If there's a match we...


request replenishment! The rest of the sketch just waits for a tag to come within range of our devices RFID antenna and then deals with parsing the payload of the NDEF record.

In it's current form all confirmations and message responses we receive back from the Dash API are printed to the serial terminal. This works fine for testing and development but to make this a truly stand alone system I'm working on developing some alternative notifications... maybe a piezo speaker with a chime or an LCD screen.

Stay tuned for more updates to this project as I make changes to incorporate the WiFi/NFC shield, a product case, and other improvements! Thanks for taking a look!


An Arduino library for WiFi101 connected devices implementing the Amazon Dash Replenishment API Edit
Arduino library supporitng the Anduino shield.

Custom parts and enclosures

Andunio Case
Top half STL file
Anduino Case
Bottom cover for Anduino 3d printable case
Anduino Case
3d printable case for the the AnduinoWiFi shield!


Fritzing Breadboard View
Wiring up the Adafruit NFC/RFID shield to Arduino MKR1000
Fritzing schematic tvqhet1w6d
Fritzing Breadboard View Zoomed In
Wiring up the Adafruit NFC/RFID shield to Arduino MKR1000
Schematic zoomed in qyrk3rwwqf
Anduino Fritzing
Anduino Shield Fritzing part coming soon!
Anduino v1 1 diagram fjqsw9ks53


Similar projects you might like

NFC Color Changer

Project tutorial by Brian Carbonette

  • 3 respects

Smart 3D Printer Filament Counter (FilamentBot)

Project tutorial by ArtSuzhou

  • 29 respects

Connecting Anduino to IFTTT

Project tutorial by Brian Carbonette

  • 15 respects

Arduino RFID Keycard Access

Project tutorial by Brian Carbonette

  • 1 comment
  • 27 respects

Smart Pill Dispenser

Project tutorial by Team MakersUPV

  • 53 respects

Get Connected! WiFi Registration Using AP Mode!

Project tutorial by Brian Carbonette

  • 23 respects
Add projectSign up / Login