Sensor Recommendation

Hi folks,

Hope you are safe and sound. I am looking for a sensor recommendation that could detect my working cubicle is empty or not. I was trying to use the ultrasonic sensor like this.
It could detect if there are any heavy objects laying in the cubicle but what in case of small things like a pen or a letter?
Are there any other sensors with high precision or is there any way around?
Thanks for the help!

Distance sensing of an object in a cubicle isn’t going to work and certainly not with a HC-SR04.

You need to decide exactly what you are trying to sense (human?) and how accurate and responsive this needs to be. I might recommend you look at using an IR sensor such as the AMG8833. This is an 8x8 array which measures temperatures and has a reasonable FoV. Otherwise, a camera and openCV to detect a person? You can’t do this with a Particle device - insufficient memory and processor power.

@armor Thanks for replying. Sometimes in my cubicle, there are some objects like pen toolboxes, etc. The goal is just to know the cubicle is empty or not. No need to detect humans. It would be really helpful if you know any sensors I can look into. Accuracy is a important like I need to detect the cubicle not empty even things like a pen sits on the cubicle.

Then I would use a RPi - take pictures every so often and with a known (empty) picture just compare the difference in pictures - pixel comparison is simplest. On a RPi you could realistically run openCV and recognise objects.

This is a very difficult thing to do with 100% accuracy.


Thanks for the reply @armor. This is really helpful

Does the sensor VL53L1X can be used here? I found some discussion based on this sensor in the forum and seems like it works fine indoors

I have got a VL53L0X so I dug it out of storage and tried it out - using the VL53L0X library and Workbench it took tops 5 minutes to get it outputting the distance measurement in millimeters. I believe the VL53L1X is a longer range. Although the parameters can be changed the defaults for the VL53L0X seems to be 1.25m range with mm accuracy - impressive. How you use this distance measurement to detect is up to you!

1 Like

This is really helpful @armor. Just one more question, what is the smallest object it can detect? Like, does the size of an eraser is enough to reflect the laser?

I couldn’t test this as I don’t own a device now and couldn’t buy one now because of the covid-19 lockdown…

Any help is appreciated

the size of the target gets bigger based on how far away it is since the laser cone gets bigger as the further out it goes.

The distance it will measure will depend on the surface color and reflectivity, black being the best.

It works good indoors as long as there are not other light sources in it’s view since those can throw off it’s distance and readings.

Get one and try it.

Thanks, @RWB.

As @RWB says - time for you to experiment.

1 Like

Hi Rahul,
I hope you are safe and sound too!
Out of curiosity, what are you trying to achieve with this?
I know, you want to know if there are pen toolboxes or other things, but what is the final goal that you have here?

Maybe giving that info can help other people identify a better mechanism or sensor.
Thank you,

1 Like

@Rahul_G, from what I gathered watching this thread from your first post, I'm not convinced you understand how these sensors work.

Both the ultransonic as the LASER ToF sensors will only provide (at times rather "noisy") distance readings in a single direction but you appear to be looking for a way to monitor an area or even a volume for the presence/absence of objects and that is not what these sensors are meant for.

But you already got a good answer for the above use case

However, there are also two possible "interpretations" of the outlined use case

  • you want to know whether something is present/absent in the monitored volume
  • you want to know when the monitored volume undergoes a change in content

For the former @armor's suggestion is (using an RPi or a something like a ESP32 CAM module) probably your best bet.

For the latter, you may get away with a motion sensor.

@gusgonnet My goal is to detect the locker is empty or not. There is a small door to this locker people can open/close and put things inside. If a personal put his belonging in a locker, a light will blink meaning this is not empty and next personal can’t use this.

There is more to this but the main goal I am trying to achieve is detect the locker empty or not. The locker dimensions are 60cm(D) x 10cm (H) x 25cm(W).

1 Like

For this use case there is another option: scales.
You can monitor the weight of the content of your locker.

1 Like

@ScruffR Thanks for the feedback but the locker will be closed almost all the time and it will be dark inside. So using a small camera module seems like to face some issues.

For this use case there is another option: scales.

Believe it or not but actually we considered this but thought the sensors will be more accurate. I will look into the scales. Thanks for the help you all!!

You can use an simple power LED to illuminate the locker and only need to take a pic once after the door got locked - it's rather unlikely that the contents will change without the door being opened again :wink:

As said, they will only be accurate in one direction. Place the object off that direction and you won't be any wiser.

You can use an simple power LED to illuminate the locker and only need to take a pic once after the door got locked - it’s rather unlikely that the contents will change without the door being opened again.

I agree with you, my plan is to trigger the sensors after the door closes. My concern regarding this is:

  • Sending the images to the server, which we might need a more powerful system like Rasp Pi instead of the photon

  • Processing these images, which requires an ML system.

We need the photon and sensors to be run by battery power.

As said, they will only be accurate in one direction. Place the object off that direction and you won’t be any wiser.

What if we set up two sensors facing each other? This way I can track all the blind spots of each sensor. The system will be ON once the locker door is closed get the readings, then go to sleep.

Nope, you can't.
With ultrasonic sensors you'll also read multiple echos in such a confinded space.
With photonic ToF sensors and probably shiny surfaces you'll see the same issue.
And finally imagine a straight "line of sight" of the sensor - only things placed on that line can be detected nothing bellow, above, right or left of that line will be seen.

Granted, in real life this is not a perfect line but a cone (wider for ultrasonic sensors narrower for ToF) but still anything not in that cone cannot be detected but when you make that cone too wide whenever the cone "hits" the walls before hitting the object you'll produce and detect echos from the walls rather the objects inside of them (or a combination of them).

That's why you need to understand how these sensors work before you can hope to properly use them.

1 Like

Thanks for the patience @ScruffR :pray: These details definitely helps me. I will look into the scales first, then into our camera set-up later. I will update you guys with the details.

1 Like