# Problem building a smart shopping cart

I'm building a smart shopping cart with Arduino for my final year project.

The cart is supposed to be able to follow its user while shopping. I don't know of many feasible indoor positioning systems to use.

Proposed solution 1

I have recently seen some RF/ultrasonic positioning systems that make use of:

• one ultrasound transmitter and one RF receiver, carried by the person,
• and two ultrasound receivers and one RF transmitter carried by the robot.

The robots RF transmitter sends out a signal, which when received by the person's RF receiver, triggers the person's ultrasound transmitter to transmit a signal. This signal is received by the robot's two ultrasound receivers (with a distance, d between them), and the distance and angle to the target person can be calculated.

That sounds very feasible, but my question is, if the robot is in a crowded place, where the other people are also carrying ultrasound transmitters and RF receivers:

1. Will the RF signal meant for the owner of the robot be accidentally received by the RF receiver on another person, or is there some kind of unique ID shared between RF receiver/transmitter pairs that could prevent this problem, or maybe some kind of frequency hopping system, so there would be no mistaken identity.
2. How will the ultrasound receivers on the robot be sure that the received signal is from its matching ultrasound transmitter. Again, is there some kind of special ID systems employed by some ultrasonic transmitter/receivers.

Proposed solution 2

I have also read about this new device called Trackr, it makes use of bluetooth low energy to track objects based on their proximity to bluetooth enabled devices like smart phones.

Considering a scenario where various bluetooth devices (beacons) are placed at specific points in a room, and the target to be tracked is equipped with a bluetooth emitter/bluetooth chip/dongle.

When the target passes each of those beacons, the signal strength intensity is received and distance from the target is calculated.

I understand this concept, but have some questions:

1. When distance is calculated between beacon and target, what about the angle, how would the robot follow the target based on distance alone?
2. If this method is not accurate enough to be used in a crowded space, what other method can be used, I have checked out some indoor GPS devices and they are way to expensive (above \$200).

Would a camera-based tracking system be better and how easy would it be for a non expert like me to implement.

• Also see some of the linked questions (in right sidebar, some of which are woefully short on facts, and some of which may be useful. – James Waldby - jwpat7 Oct 5 '16 at 20:39
• Is the user (shopper) allowed to wear things? For example, an IR transmitter? How big is the proposed area (shop)? Are there multiple aisles? For the demo are you basically getting the cart to follow someone around a room, or does it have to navigate aisles (or worse still, display cases or other shoppers)? – Nick Gammon Oct 5 '16 at 21:13
• Also, can you install things in the "shop"? I presume the cart itself can have technology all over it. – Nick Gammon Oct 5 '16 at 21:18
• yes, any of the above scenarios would be fine, i am not ruling out anything – Cynthia Owolabi Oct 5 '16 at 22:03

I have a couple of ideas for you but know these are only suggestions. No hate please.

Have you tought of IR following?

IR is a almost unique signal that only you have. You can either use multiple IR sensors to determine where the emitter is or you can use the servo motor to do it as a radar. Note that you have to isolate each sensor so it knows where you are and it doesn't captures the wave from a different angle by accident.

Extra safety?

You can also incorporate an untrasonic distance sensor so that the cart doesn't bump into you or any one. Like you can say, if the distance is smaller then 12 inchs / 30 cm, stop the cart. It is practically an extra safety feature.

• well, if the IR is the only signal that can send unique codes, what then do telecommucication companies use to transfer data – Cynthia Owolabi Oct 5 '16 at 21:45
• I just think that something like RF is a little too strong. You would want the beam to be concentrated into a small area with an isolated sensor that can detect at what angle of the cart you are. RF is too strong to do that and it is quite more expensive. – Dat Ha Oct 5 '16 at 22:12

Try keeping it simple. I'd have the person wear and infrared transmitter. Then on the cart have an array of IR-receivers pointing in all directions. That way the cart knows which direction to go.

Next you need to get the distance to the target using e.g. an ultrasonic distance sensor.

Lastly you need to add some bumper sensor, so the cart known when it's running into an obstacle.

Your camera solution might also work, combined with OpenCV. But you can't run that on a measly Arduino.

• thanks. but with the infrared transmitter, wouldnt the cart follow pretty much anyone who wears a similar infrared transmitter? – Cynthia Owolabi Oct 5 '16 at 18:24
• my major issue is how to match one person to one cart in a fairly crowed environment – Cynthia Owolabi Oct 5 '16 at 18:30
• You can have them send unique codes, similar to a remote control. – Gerben Oct 5 '16 at 18:49
• wow, really. Thanks thanks. So if i surround the cart with infrared receivers, wouldn't there be interference with each other, does it work with line of site. If so, does it mean i would need to cover the entire perimeter of the cart with receivers? Also is it only infrared transmitter/receivers that are capable of sending unique codes? – Cynthia Owolabi Oct 5 '16 at 19:08

Another solution, along the lines of your camera option, would be to seed the store with Kinect (or Kinect-like) camera systems. These systems are already designed to track multiple people at once.

Using this method you don't need to equip the shopper with any device, which lowers logistics (how do I get that device back when the shopper exits the building) and tech support costs.

You might need to equip the carts with some kind of marker - I don't believe the Kinect systems are designed to track inanimate objects, but I could be wrong.

So challenges to overcome with this system would be:

1. How to track the carts?
2. Kinect doesn't have a very large focal distance so you will need some kind of system to hand shoppers off to the next Kinect when they pass out of range of the one currently tracking them.

I'm going to get a bit ambitious here and suggest something along the lines of what the Vive virtual reality system uses. You can see from some of the photos on that site that the headset has lots of sensors on it. Judging by this article they detect signals from two base stations. I presume the base stations send IR beams (because radio would not be directional enough). The sensors on the headset are recessed a bit, which would shield them from anything but a line-of-sight beam from a base station.

## The store

Now you don't need anything quite that sophisticated, but something like this might work. First, you have some IR transmitters located around the store, pointing in a criss-cross pattern, like this:

The green box is the cart and the bigger boxes the shelving. Now with sensors on the corners of the trolley, pointing in different directions, and with each transmitter sending a differently-coded IR beam, the trolley should be able to work out its position fairly accurately.

## The trolley

By a process of exclusion (if you don't see a particular base station then you are not near it) and inclusion (if you do see a base station from a certain sensor then you can deduce a possible area you are in) you should be able to work out your position.

In this case we might expect that the bottom-left-diagonal sensor would be picking up signals from station 1003, and the bottom-right-diagonal sensor would be picking up signals from station 1004. Plus the forward sensor may be getting signals from station 1000 (depending on the range) and the rear sensor from station 1005.

## The shopper

Now we also need to know where the shopper is. If you gave the shopper a vest or belt with sensors on it in a similar way (eg. front, back, diagonal) then similar calculations can work out where the shopper is. Let's assume that each shopper and each trolley are given a unique ID pair (that is, a trolley is associated with a vest). Effectively, each shopper would transmit, every second or so "shopper 5677 is at position x=543, y=666 in the store".

Now we can use radio transmission (from the shopper) to its paired trolley, to tell the trolley where its "owner" is. And assuming the trolley knows where it is, then it can work out if movement is required, and if so, in what direction.

## Collision detection

In addition to the above, you would need some proximity sensors on the trolley (eg. ultrasonic) to stop the trolley from driving into other shoppers, display cases, its owner, etc.

## Maze solving

The trolley could have software on it to solve the problem of reaching the shopper. For example, if its way is blocked for too long on the shortest path, it might take an alternative which would be to go to the end of the aisle, go down a different aisle, and then back to where its owner is.

## Extra credit

1. You could make a button on the trolley you push when you are finished. The trolley could then "lead" you to the checkout with the shortest queue at it (or an empty checkout).

2. You could have some buttons on the trolley with major grocery types on it (eg. dairy food, bread, frozen foods). When pressed the trolley could lead you to the appropriate aisle.