Looking for ideas...

Posted on
Sun May 20, 2018 2:57 am
noel1983 offline
Posts: 446
Joined: Oct 17, 2014

Re: Looking for ideas...

What about a beam break sensor? That would stay broken for a small post card

There were some small units mentioned in another post recently I think


Sent from my iPhone using Tapatalk

Posted on
Sun May 20, 2018 4:06 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Looking for ideas...

noel1983 wrote:
What about a beam break sensor? That would stay broken for a small post card ...

That would probably work well in a small mailbox. However, the typical french mailbox, like mine, is~ L 300 x D 410 x H 300. So, if the beam were in the center of the mailbox, from floor to ceiling, it would be easy for a letter to land outside the beam. Also, I would have to mount one side of the beam in or under the floor.Something that would cause problems at some point.

However, I could mount both emitter and detector on the ceiling. One at each end of the box, and angled towards the center of the floor,
Something like:
art_019_obstacle.png
art_019_obstacle.png (21.09 KiB) Viewed 2426 times

The question is: Would a small envelope cause a significant enough drop in reflectivity to "break" the beam? However, rather than using a binary on/off IR detector, if I could find one with analog output I might be able to determine changes. Worth looking into.

Posted on
Sun May 20, 2018 7:53 am
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: Looking for ideas...

berkinet wrote:
noel1983 wrote:
What about a beam break sensor? That would stay broken for a small post card ...

That would probably work well in a small mailbox. However, the typical french mailbox, like mine, is~ L 300 x D 410 x H 300. So, if the beam were in the center of the mailbox, from floor to ceiling, it would be easy for a letter to land outside the beam. Also, I would have to mount one side of the beam in or under the floor.Something that would cause problems at some point.

However, I could mount both emitter and detector on the ceiling. One at each end of the box, and angled towards the center of the floor,
Something like:
art_019_obstacle.png

The question is: Would a small envelope cause a significant enough drop in reflectivity to "break" the beam? However, rather than using a binary on/off IR detector, if I could find one with analog output I might be able to determine changes. Worth looking into.


Years ago I did this. I lined the bottom and sides of the mailbox with a black velvety (velour?) fabric (left over from a home theater surround frame). The Black material would absorb almost all of the IR light so that even the smallest postcard in the box would cause a significant change in reflected IR to the sensor. I also had one emitter, but two receivers, one on either side of the emitter.

I’ve thought about this recently and with the amount of low cost IP cams on the market, it would be pretty cool to mount a cam on the back of the mailbox, looking through a hole drilled in the back of the mailbox (the cam itself enclosed in a separate box sealed to the back of the mailbox). You could then experiment with motion detection and/or image analysis software to determine when the door(s) open and if there is anything in the box. You could even just look at the cam image...

Terry


Sent from my iPhone using Tapatalk

Posted on
Sun May 20, 2018 9:05 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Looking for ideas...

roussell wrote:
...Years ago I did this. I lined the bottom and sides of the mailbox with a black velvety (velour?) fabric ...

Interesting. Just the opposite of what I had been think. But, it makes sense. I'll check my junk box to see what I might have... or, try flat-black paint.

lanbrown wrote:
Two others, look for light. If the box is opened, then light would have been let in. You could get false positives with this though..

I am not sure I follow. I am currently using a light sensor inside the mailbox to detect when the box is opened. Did you have something else in mind?

Posted on
Mon May 21, 2018 12:56 am
rhanson offline
Posts: 192
Joined: Apr 30, 2013

Re: Looking for ideas...

Cameras are so cheap nowadays, I'd go with that. I would color the bottom black, and paint a large, white X mark in the center. Running the video thru a specifically trained neural network model looking for X's, it would tell me immediately that the X has been obscured when the mail has been delivered. The output of the video analysis could be reduced to a simple boolean indigo variable isMailPresent. All of that plus the requisite ethernet comms back to your server could be run on a Raspberry Pi. Of course, simple motion detection would work just as well to tell you that *something* happened, but you wouldn't know for sure whether the mail was there or not there (and have the photo to prove it). Extending this further, you could identify parcels vs letters. Or a FedEx envelope vs yet another Carrefour catalog. Or maybe on a colder day, the Carrefour catalog could be used for fire kindling. The possibilities are endless.

But to answer your original question, what's wrong with looking at a moving average of the analog values?

Lots of nerdery here:
https://stats.stackexchange.com/questions/41145/simple-way-to-algorithmically-identify-a-spike-in-recorded-errors

Posted on
Mon May 21, 2018 2:04 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Looking for ideas...

rhanson wrote:
Cameras are so cheap nowadays, I...
But to answer your original question, what's wrong with looking at a moving average of the analog values?

Lots of nerdery here:
https://stats.stackexchange.com/questions/41145/simple-way-to-algorithmically-identify-a-spike-in-recorded-errors

Spot on... The link was great. While the spike algorithm will probably work, I had not thought about looking at changes in frequency rather than amplitude. In my case that might work quite well since the minor changes in lux occur over periods of seconds to minutes. While when spiking, they occur milliseconds apart.

...and you are right about the Carrefour (Leclerc, Casino, etc.) rubbish. Fortunately, that gets deposited in the recycling sack before it ever reaches the house.

Posted on
Tue Mar 28, 2023 4:41 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Looking for ideas...

And, an update. I have found a very simple, and so far reliable, solution.First, the mailbox interior is now black. Paint on the ceiling and walls, black rubber on the floor. I then mounted a small camera and a cheap LED closet lamp on the interior ceiling. Then, when I detect the mailbox door or slot has a close event (using cheap alarm magnetic switches), I turn on an interior lamp and snap a picture. Next, using CV2 in Python, I convert the picture to black & white and the count the white pixels. This took a bit of tuning to get the right grey level threshold. But, once that was figured out, this works a treat. I set the white pixel count at 100 and that seems to work quite well. So far no false positives or negatives. The best part, since removing the mail from the mailbox also generates a c lose event, I instantly detect an empt mailbox and the alert system resets automatically.

Posted on
Fri Mar 31, 2023 1:03 am
rhanson offline
Posts: 192
Joined: Apr 30, 2013

Re: Looking for ideas...

Nearly 5 years on! Wow. (We should pause for a moment of silence in remembrance of the world as we knew it 5 years ago...)

Cameras are really an awesome solution to a number of scenarios, as long as they are well-defined!

Posted on
Fri Mar 31, 2023 4:02 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Looking for ideas...

rhanson wrote:
Nearly 5 years on! Wow. (We should pause for a moment of silence in remembrance of the world as we knew it 5 years ago...)...
Oh, there have been many iterations along the way: object identification from photo, reflected visible light, reflected IR, distance (light and sound), weight, and endless adjustments.

BTW, the original design goal was to have a visible indication (a bright blue LED near the mailbox), email notification, and an announcement. Plus, the system needed to reset automatically when the mailbox was emptied.

Who is online

Users browsing this forum: No registered users and 1 guest