Software apps and online services
Amazon DRS is a great service, but we are just on the beginning of a very long road. At the moment the possibilities are limited, but I think it is worth thinking about what DRS enabled devices will become in the future. One of the possibilities is my project: the DRS powered smart medicine package.
At the moment the need for batteries and the price of the WiFi-capable MCUs are prevent us from unlocking DRS's true potential. We should leave out the batteries from our projects, but this is crazy, right? Well maybe in the present it is crazy, but new technologies might solve this problem. With passive WiFi or some similar technology, we might reach this battery-free dream in a couple of years.
The other problem, the price might be also resolved soon. A decade ago no one would have thought that an advanced WiFi-capable MCU, like the ESP8266 is possible for 2-3 dollars. I believe that in the future some low-power WiFi microcontrollers will be as cheap as RFID tags in the present.
Low-cost materials will mean that we can create very cheap disposable circuits. These circuits can revolutionize how we think of packages and products. We won't need smart balances or special containers to use DRS anymore; the products will be aware of their state and they can connect to Amazon. A great example would be a smart medicine package that knows how many pills it has. It can notify the patient to take the pill and it can also monitor whether the patient took the medicine or not, in real time. It would mean a huge help for the doctors to monitor their patients and the patient will never run out of medicine or vitamins as the packages are DRS enabled.
Clearly, this is the inevitable future. Maybe we don't have the proper technology yet, but still, we can build something similar. If you think about it, these smart packages would be very simple devices, nothing too complicated. It won't be as cheap as an RFID tag right now, but in some cases (e.g. expensive medicine) even an extra 1-2$ is acceptable if it is really worth it.
Let's use some cheap hardware - a NodeMCU board will be great for this demo project, aim as low-cost as possible and start to work.
I'll be using some Vitamin C in the project. It is better than using real medicine for experimenting. Someone would have missed those!
The package of the vitamins is made of plastic, the bottom is covered with some aluminium foil and there's some kind of protection layer on the aluminium that is also an insulator. It will be perfect for my project. All I have to do is create a circuit out of the aluminium with scratching.
As you can see, the circuit is very simple. It works similarly like push buttons. I used 10K resistors to pull-up the MCU's pins to HIGH, but the pins are connected to GND through my circuit above. When you remove a pill from the package, you break that part in the circuit, the MCU registers the change, so it will know that you removed the pill from that specific place.
I used Blynk to visualize the process:
When there's just 2 pills left (you can modify this with the threshold slider in Blynk), the ESP8266 will order new pills from Amazon if auto-reorder is enabled. If it is disabled it will just notify you that you should buy new ones. They will arrive before you would really run out of vitamins.
The first design worked very well, but I had to damage the aluminium foil, so I made a second design of it. I created the same circuit as in the 1st design from homemade conductive ink (mixture of graphite from a 8B pencil and wallpaper glue). It has quite high resistance, somewhere between a couple hundred ohm and a couple thousand ohm, but it's all right.
If you want to create conductive ink/glue:
- Buy a graphite pencil. The higher the B value, the better. I used a 8B pencil (~90% carbon). More info
- Remove everything that is not graphite.
- Crush the graphite. You'll need fine powder.
- Mix it with some glue. I used wallpaper glue. Don't use too much of it. You reached the right consistency if you can paint with it.
- You've got conductive ink. Yay!
Or you just buy wire glue.
Feel free to experiment with conductive ink, my recipe is not something special, and the result is quite weak. However, I actually wanted it to be weak as I need to break it when I push a pill out of the package. In the non-demo project, I wouldn't use these graphite wires as they have lots of disadvantages, but it will be fine for this demo. In a final product, the circuit can be just printed onto the package.
I was very careful not to damage the insulating layer on the foil, and where I did damaged it (e.g. the holes for the connections), I used insulating tape. I used wires with alligator clips to minimize the effects of the high resistance on the furthest parts.
As you can see in the video, my medicine package goes beyond of just being a simple DRS ordering device. That's just one of it's functions.
It also notifies the consumers when they must take their pills. Think of the current and future possibilities of it:
- People who forget to take their medication will get notified about it. This notification is so much more than just a static reminder in the phone. You'll know that if you received this notification it means that you really forgot it, the package won't disturb you if there's no reason. It will be a great help especially for older people or woman using birth control pills
- The doctor can monitor whether the patient is taking the pills as planned.
- In the future you can bind the medicine to your phone, so you will never forget your life saving medicine at home
This design uses a different approach to this problem. 1 and 2 are using binary switches to detect the presence of the pills, and it requires 11 cables. Design 3 uses parallel resistors to do the trick with only 2 wires. Take a look at this picture:
3 is using the ADC of the NodeMCU board. We are basically measuring the total resistance between the two connectors. I am using 100K resistors, 11 of them in parallel (11th is for detecting the presence of the bubble package). If you need, see how resistors work in parallel. If you take a pill, you break one of the circuits and only 10 resistors will remain in parallel, so the total resistance will increase:
Let's see the 2nd picture there. In our case R1 = R2 = Rn = 100k. We've got n resistors. I used 100K resistors so I can ignore the resistance of the graphite wires (1-3% error is acceptable). We do some equation sorting and bam! Here's our formula:
The total resistance will have a ~9K - 100K Ohm range. The NodeMCU board's ADC has a built-in voltage divider, so instead of ESP8266's 0-1V range, it works on 0-3.3V range. I need another voltage divider for measuring resistance. The measured resistance is R1, R2 is 16.8K and I used the 5V (actually 4.6V) Vin pin of the board as input voltage of the voltage divider. It means that the measured voltage will be on the 0.67-3V range.
I pre-calculated and measured the threshold readings and hardcoded the values into the sketch. Normally the formula above would be enough, but due to the wires' quite high resistance, I used this method.
The design worked perfectly; however, it has a disadvantage compared to designs 1 and 2. It won't know which pill bubbles are empty; it will only know how many pills it contains. It doesn't matter if we talk about vitamins or other uniform pills, but it can be important in some cases, for example if we think of birth control pills. I think this problem can be solved by using quality wires (not graphite) with low resistance and different resistor values, but that will be another project.
This approach is very flexible and not limited to medicine packages, so it can be used in all kinds of products from post-its or toilet paper to trash bags. If we want to create IoT Post-IT, the 3rd design is perfect for this job.
I put one sheet of post-it on a cardboard, glued the SMD resistor onto the paper and painted some wires as you can see above. After that I placed another sheet on top of the previous and repated the process. I used just 5 post-it sheets, because the thickness of the SMD resistors started to be a problem. After that I used some more graphite ink to make sure that the connections are perfect. And that's it, I could use the same sketch that I used in the 3rd design.
Well it's not pretty, but hey, it's just a proof of concept project. In the future, manufacturers can build this circuit into the paper and you won't even know it's there.
This project resulted in very versatile ideas that can - easily and with very low cost - turn everyday products into smart devices. It will give a huge added value to the products. So I believe Amazon should move in this direction, because useful but invisible technology is the future. The consumers don't need to change their daily habits to use the new functions; this is can be a game changer.
Thank you for reading and have a nice day!
[working DRS integration is on it's way and will arrive soon]