Smart Trolley

The idea:

The smart trolley idea is my final year college project that I have been working on for the past two and a half months. The idea is that in every supermarket all of the products have small RFID tags stuck on them. The trolleys will have an antenna built in, alongside an RFID reader and a computer. This would mean that a shopper could just place an item in the trolley and it would be detected and registered by the computer. This would remove the need for supermarkets to have checkouts all together. There is also the possibility to link the trolley to a smartphone using Bluetooth. This means the user could do things like view all items in the trolley, view the price of items and even pay for everything through a system like Paypal. Information such as nutritional value, grams of fat etc could also be made available. This is the basic idea of a ‘smart’ trolley:

'Smart' trolley idea
‘Smart’ trolley idea

Here is a picture of the ‘Smart Trolley’ prototype that I built:

'Smart Trolley'  prototype
‘Smart Trolley’ prototype

Underneath the trolley there is a ThingMagic credit card sized RFID reader, a Raspberry PI, a microcontroller and a 12v, 7Ah lead acid battery. At the moment the trolley is completely wireless, communicating with a computer over WiFi. The WiFi antenna is mounted on the side of the trolley. A big problem with this idea is battery life. This first rough prototype is not power optimised at all. In fact the Raspberry Pi will be replaced with a microcontroller and instead of using wifi to communicate, the trolley may use Bluetooth instead. The reason for using these at all is because its much easier to develop with a Raspberry Pi and python than it is to just use a microcontroller straight away. Now that it is working with the Raspi, I a much more confident about moving to a microcontroller.

Problems with the Idea :

-Reading items with a 100% success rate
-Power consumption
-Detecting when items have been removed from the trolley
-RF power being transmitted in close proximity to humans
-Not reading tags in other peoples trolleys or tags that are still on the shelves

Reading items with a 100% success rate:
I spent several weeks just experimenting with reading tags that were placed inside a metal trolley. Up until this point we had no idea how well it would work. We didn’t know how the metal grid of the trolley would affect the radio waves transmitted by the antenna. Would the waves go through the grid or be reflected? It turns out that they are almost totally reflected. This is both good and bad. An original idea was not to have the antenna in the trolley, but instead to have it placed above the exit of the supermarket. The shopper would walk under the antenna and all of the products in the trolley could be read at once. My experiments found that this would be impossible because there are always ‘blind spots’ of RF energy in the trolley caused by the reflected waves destructively interfering with each other. These blind spots are usually very narrow. the size of these blind spots are very small, think around the volume of a smartphone and you have the idea. The logical solution to this is to read the tags as they are being placed into the trolley. This idea is described in teh diagram below:


This means that a tag is read at several points in space. If an antenna is placed in the trolley and it is always transmitting. If a person places a product in the trolley the tag will be read at several points in space before coming to its final resting place. This results in a 100% read rate. There is a problem with this solution. Continuously transmitting power from the antenna is incredibly inefficient. This leads on to the next problem.

Power consumption:
Having the reader transmitting continuously would solve the problem of blind spots. It is not a viable option due to the massive power transmitted by the antenna. Whats the solution to this ? Easy, just try to read tags only when something is being placed in the trolley. SHARP IR distance sensors are placed on the inside of the trolley. See the image below for a close up of the sensors:

SHARP IR distance sensors to detect when a product is placed in the trolley
SHARP IR distance sensors to detect when a product is placed in the trolley

This solution works surprisingly well. There is not way to place an item in the trolley without the sensors detecting it. It might be possible to use less than four sensors, this will be experimented on in the future.

Detecting when items have been removed from the trolley:
-Due to the blind spots problem it is impossible to read all tags in the trolley at once. The tags can only be read for sure when they are on the way in to the trolley. This means that it is impossible to constantly monitor all of the tags and then be able to detect when one has been removed. This means a user interface will be necessary to remove items that were placed in the trolley. The user interface could be something like a touch screen lcd displaying a list of all items in the trolley. If the user wants to remove an item they can click the item and then press a ‘remove item’ button or something like that.

RF power being transmitted in close proximity to humans:
There has been some controversy over the effect of RF waves on humans. For example with mobile phones there has still been no conclusive evidence stating that is does or does not contribute to the formation of brain cancer. There have been studies done that come up with differing results. This means that for the moment it is safest to minimize the power level of RF energy used in consumer products. This safety limit is called the Specific Absorption Rate (SAR) it is a unit of measurement outlining the amount of RF energy absorbed by the human body ( normally used when talking about mobile phones). The average GSM based mobile phone transmits around 600mW of power. The RFID reader in the trolley currently uses around 10mW. By comparison it would seem that the RF energy transmitted byt the antenna is not something to worry about. Also considering that wifi hotspots transmit around 200mW of power. The reason that the transmit power of the antenna could be made so low was due to the fact that the tags are being read whilst they are in mid air in front of the antenna.

Not reading tags in other peoples trolleys or tags that are still on the shelves
In the early set of experiments I did with trying to read tags in the trolley, the RFID reader was trasmitting 30dBm of power (2 Watts). At this power level, even with the antenna inside the trolley, tags could be read from across the room. Through experimentation I found that the power could be reduced by a factor of two hundred and tags could still be read. However the could only be reda reliably when in mid-air. With the use of the Sharp IR sensors allowing the tags to be read in mid-air, this meant that even with only a mere 10mW tags could be read with a high success rate in the trolley and there was very little power left over to leak outside the trolley. The trolley contains the transmitted power very well. So even though it is only 10mW of power, it is utilised very efficiently because the RF waves cannot escape the trolley they can only bounce around against the sides of the trolley.

How it works:


The Raspberry Pi sends a ‘Read Tags’ command via UART to the RFID reader. The reader then replies with the EPC (Electronic Product Code) numbers of any successfully read tags. The Raspi then checks these EPC numbers against a file containing information on which product corresponds to which epc number. If there is a match, the product name is then sent over WiFi to a computer. The picture below shows a flow diagram of how the Python script that controls the trolley works:

Flow diagram of trolley computer program
Flow diagram of trolley computer program

Here is the CSV file that the Raspi check the EPC codes against to get the product name:

tag_name ; epc
lotus tissues;e2003411b802011412255384
la vache qui rit cheese;e2003411b802011412255344

There is a PIC microcontroller in charge of polling the sensors to see if any of them are giving out a value above a defined threshold. At the moment I’m working on adding a buzzer to the trolley that will activate when a product has been successfully read. The PIC will take care of this too.

This is how the sensors are connected to the pic18f14k50 uC:

Diagram showing how the sensors are connected to the uC
Diagram showing how the sensors are connected to the uC

The code for the micro-controller is very simple. It consists of something very similar to the following pseudo-code:

thresh = 90;    // any value above this means an object has been detected
if ( (sens0 > thresh) or (sens1 > thresh) or (sens2 > thresh) or (sens3 > thresh) )
    PIN RD0 = HIGH;

This program runs on the micro-controller. The micro-controller used was a PIC18F14k50. It polls each sensor and waits for one to go above a certain threshold. If a sensor does go above a certain threshold it pulls a pin high. This pin is connected to the Raspberry Pi. This will then prompt the Raspberry Pi to try and read tags.

Here is the first proto-board with the microcontroller and the 5v power supplies. One of the regulators is for the reader and the other is for the Raspi and the microcontroller. This board provides power to the Raspi, the microcontroller, the RFID reader and the wifi adapter. The SHARP IR sensors are plugged in via header pins.

If any of the sensors detect an object, the ‘raspi signal wire’ is pulled high by the PIC. The Raspi is waiting for this rising edge signal on one of its GPIO pins to trigger the reader and read some tags.

The strip board circuit worked for a total of three days before I plugged a connector in backwards and released the magic smoke from the Raspberry Pi. So I spend a while learning how to use Eagle to make a PCB (it was a painful process) and came up with this:

Circuit in PCB form with added bluetooth
Circuit in PCB form with added bluetooth

Made a few mistakes that needed to be fixed with jumper cables but apart from that it works fine. Also added bluetooth which will replace the WiFi adapter that was used before. This is pretty much what could be called a ‘shield’ for the raspberry pi. The RFID reader sits on top and the whole thing plugs in to the Raspi via header pins. Here is the reader sitting on top:

RFID reader on top of the PCB
RFID reader on top of the PCB

Then the whole thing plugs into the Raspi’s header pins:

Raspi Mega Shield
Raspi Mega Shield

Then I placed this Raspberry Pi with the ‘shield’ in a box along with the battery. Here is a picture of the final product:

Housing for the project. Containing the Raspberry Pi, RFID reader and PCB
Housing for the project. Containing the Raspberry Pi, RFID reader and PCB

Top view of the box:
2014-07-01 09.23.11

Here it is mounted on a trolley. The sensors are still on the trolley but I made it look a bit nicer by wrapping the whole sensor mount in black tape:

2014-07-01 10.40.16

The box and the sensor could be mounted on any metal trolley like this one and it is good to go. It has Bluetooth connectivity and WiFi. A user interface still needs to be made possibly using a smartphone.

3 thoughts on “Smart Trolley

  1. hi!i am fascinating based on what you conduct of this ” Smart Trolley” Project ,Because i have plan using your idea to be my final project ,can you sent all the information of this project detail to me?etc: the project full of the Circuit Diagram ,especially the photo-board with the microcontroller and the 5v power supplies ?

    1. Don’t have any other schematics left apart from what is here. Best of luck with the project.

Leave a Reply

%d bloggers like this: