Mail presence detection

Comments & issues
Post Reply
berkinet
Phidgeteer!
Posts: 95
Joined: Thu Sep 17, 2009 12:17 pm
Contact:

Mail presence detection

Post by berkinet »

I would like to detect the presence of mail in a mailbox. In this particular case, the mailbox is a standard French mailbox (boite aux lettres), approximately 30cm h x 30cm w x 41cm d (image below). This is a fairly large space and a letter or package could land anywhere on the 30x41 floor area, or even stick in the access slot.

I am presently using a small usb scale mounted under a false floor. This works fairly well. However, it does have two weaknesses. The biggest being the failure to detect things that stick in the access slot. The other being temperature drift.

My current thought is to mount a light source and light detector on the inside top of the box and look for changes in reflected light (the box floor and all inside walls are matte black). I have tried a standard light sensor phidget with an LED as the light source. But, that does not seem to generate enough light to be reliable. I have also tried infrared (like the Sharp 3520 distance sensor. However, that seems to be time-based rather than luminance-based. So, placing a white sheet of paper on the black floor shows virtually no difference in sensor output.

BTW, I did not try to detect the opening of the slot or door as these are not a clear sign of what, if anything, has actually happened. My goal is a system that automatically detects the presence (or absence) of mail.

Is there a phidget that might do what I want, or maybe a 3rd party sensor I can interface to?

BTW, I think the right solution is probably a small camera and photo recognition. But, that is probably something for the future.
boite-aux-lettres.jpg
User avatar
mparadis
Site Admin
Posts: 660
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Mail presence detection

Post by mparadis »

I agree that a visual solution would probably be the most foolproof because of all of the options there are for detection (color, corners, calculate difference from empty image, etc).

For the drift issue, you might be able to solve it in code because drift is (hopefully) a much slower increase/decrease than the event of mail arriving or leaving the box. You could further keep it in sync by having a micro switch that gets pushed when the door opens when mail is retrieved (and operate under the assumption that door open = all mail gone).

As for letters getting stuck in the flap, the only thing I can think of is a tiny actuator that flicks the door open periodically so the mail can eventually fall down. Maybe like the kind that opens the gas cap on older cars? (I've also seen them used in escape rooms to have boxes pop open when a puzzle is solved). This might be a bit of a heavyweight solution though :?
berkinet
Phidgeteer!
Posts: 95
Joined: Thu Sep 17, 2009 12:17 pm
Contact:

Re: Mail presence detection

Post by berkinet »

mparadis wrote:I agree that a visual solution would probably be the most foolproof because of all of the options there are for detection (color, corners, calculate difference from empty image, etc).
For the drift issue... I have been using the scale for a year+ now, and it is manageable. My first attempt was load cells, but they were all over the place. I now have a cheap (<USD10) used stamps.com scale). It is generally ok. The only problem is if it drifts enough below zero to bias it against an actual letter. But, this only happens once or twice a month and all I have to do to clear it is power cycle it when I know the box is empty. (I have a phidget controlled relay in series with the USB +power lead).

So, since you didn't mention it, I am assuming that you don't think looking for reflected luminance is going to work?

I am continuing to look at a camera-based approach. But, it would be nice to see at least one working example from someone. I am not into pioneering so much anymore :-)
berkinet
Phidgeteer!
Posts: 95
Joined: Thu Sep 17, 2009 12:17 pm
Contact:

Re: Mail presence detection

Post by berkinet »

mparadis wrote:… You could further keep it in sync by having a micro switch that gets pushed when the door opens when mail is retrieved (and operate under the assumption that door open = all mail gone). …
Good idea. but, unfortunately, or maybe fortunately, in France the post office has a key to the mailbox and uses it to deliver packages that will not fit through the slot. So, the door opening is ambiguous, and may indicate the arrival of mail rather than it’s departure.
fraser
Engineering
Posts: 138
Joined: Thu Nov 19, 2009 4:41 pm
Contact:

Re: Mail presence detection

Post by fraser »

My most immediate thought is to high-pass filter the loadcell data to look for spikes. Referencing the absolute value of the signal prior to and following the high-pass event would allow you to see whether mail was added or removed.

Albeit yes this doesnt solve the stuck in door problem
berkinet
Phidgeteer!
Posts: 95
Joined: Thu Sep 17, 2009 12:17 pm
Contact:

Re: Mail presence detection

Post by berkinet »

fraser wrote:My most immediate thought is to high-pass filter the loadcell data to look for spikes…
unfortunately, the problem was not spikes but drift. For example, I could reset the loadcell to zero in the morning and by the end of the day it might read 6 to 8 g. Not a big deal but a lot in relationship to a small letter or postcard.
berkinet
Phidgeteer!
Posts: 95
Joined: Thu Sep 17, 2009 12:17 pm
Contact:

Re: Mail presence detection

Post by berkinet »

Update: I think I have figured out why reflected light had not worked for me in the past. Very simply, when using IR devices, the amount of light is the minimum needed to calculate the distance to an object. And, when I tried an 1127 light sensor with two white LEDs as a light source, the light level was too low to give any useful range in the reflected luminance.

So, today I tried using a small LED closet light as the light source for 1127. and, it works. Both the LED array and 1127 are mounted to the inside top of the mailbox and the floor is a black rubber mat. When empty, the reflected light measures around 12 lux. Placing a postcard inside the mailbox immediately raises the reading to 25. That is a significant enough difference to work.

Note I have the LED controlled by a relay so I only need to illuminate it to take a reading. Right now, I am doing that every 5 minutes. However, if I fit the slot and door with open/close sensors, then I can take a reading after an open/close event. Also, now that I have a good light source in the mailbox, I can easily mount a camera as well and start playing with image processing.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests