Project vending machine interaction, motion sensor or distance sensor?

Hi everybody,

I'm totally new to Arduino, since there are some of you who are more advanced in it, I would like to receive some advice.

I want to start a small project for a vending machine interacting with a mobile phone using sensors.
I saw the list of input and output in the Arduino website, now I'm wondering about which sensor is the best for this project.

When someone stands still nearby the vending machine for a few seconds, the sensor detects it and starts a connection
with the mobile phone of that person. The person is then able to see the photos of the products from the vending machine
nearby and can choose a product to buy it by simply touching the photo with his finger (touch screen), otherwise using
the keyboard of the phone.

Based on this scenario, I think that the motion sensor would be the most appropriate, if someone walks by it should not be
detected. But the distance sensor also makes sense, as we want people nearby to be detected. Since I know nothing
about sensors, maybe you can give me some advice on what kind of sensors is the best for this?
Is there for example in the motion sensor already a distance sensor? Or are there any other sensors which are better for this,
like position sensors?

Thanks a lot for the help!

How do you plan on communicating with that persons phone? Wifi, BlueTooth? both of those require that a person "connect" which I can tell you as a vending machine customer I'm not gonna bother with. Second NFC Technology is coming down the Pipe QUICK, many new phones coming out in the next 6-12 months will have these chips in them (if your not familiar with NFC google it, its a digital wallet being pushed by Google). These are payment chips in phones similar to gas station fobs and other contactless systems though this is more secure...

While I don't want to discourage you but getting your customers to communicate with the device is going to be your biggest issue, simply because vending machines are convenience items and the transactions are short

What are you vending out of the machine? Soda? Candy? or is this a high end vending machine like the new electronics ones starting to pop up in ny/japan?

and to sort of answer your question you would need some sort of PIR sensor to detect the change in body heat but this wouldn't work too well for an outdoor application where direct sunlight or high temps could confuse the sensor. PIR = Proximity InfraRed iirc

Thanks for the quick reply.
I was researching about how to detect people, that is why I asked about the motion/distance sensors.
As for the communication itself, I'm planning to use Bluetooth, it is wireless and almost every mobile phone has it.
But the downside you mentioned it, that the user needs to accept the connection in order to see the products.

It is for a candy vending machine:

I have not thinking about the payment method, that might be interesting to look upon.
Will take a look at the PIR sensor!

as long as you have taken downsides into effect then PIR sensors are going to be your best bet most likely, you could use sonar but I think PIR will be the best suited, PIR sensors are what are used in household motion detectors.

I'm planning to use Bluetooth, it is wireless and almost every mobile phone has it.

Yes but most people turn it off, or set it not to open new contacts to prevent unwelcome contact like you are proposing. They only enable it when they want to connect it to something.

it would be interesting to have a vending machine that accpets both cash and also payment by an App on a phone, perhaps at a discount if you buy the app... i have seen at the movie theater where i live a machine that if your a sprint customer you go up to the machine it shows you a QR code and you use an app to read the code and it gives you a pin number to log into the machine and select from various coupons such as free hot dog or 5 dollars off something else etc...

how ever as far as your idea goes, i think just having it detect people is not really that great of an idea because of people walking by hence a lot of false alarms, or at least make the person press a button just once to go a head and start the process of connecting etc... that way your not constantly getting false connection attempts, thus saving resources energy etc.. in my opinion

in some future project maybe you could make it so that after the user picks his snack or drink from the app on his phone , the app generates some sort of QR code which then he shows to a reader on the Vending machine who will translate/decrypt it and give the user his desired product, charging it to an account set up by the user elsewhere "the cloud" thus eliminating the whole cash thingy everyone worries about

Thank you for all the advices and tips.
I will take a look on the PIR motion sensor.

It is true that with Bluetooth the connection won't be that easily made, I also don't have Bluetooth turned on my phone.
So that means if I stand nearby a vending machine, the machine can't communicate with me.
So maybe I should use other communication technology, like infrared?

The idea of paying with the phone using NFC sounds interesting, but I don't have time to do that. Since I have to do
this within 4 weeks and I also have other courses which I have to spend time on. But I will it down so other people
can do the payment part with NFC technology!