Proximity Sensor

Reverendj1

New Member
I need a proximity sensor that will detect if something is within 2-3 feet of it. I do not need to know how far away the object is, just that it is within 2-3 feet of the sensor. Does anyone know of a good cheap sensor that works well with the picaxe? In case you are wondering, I want to add an automatic flush to my toilet. :)
 

papaof2

Senior Member
The commercial auto-flush units use some type of IR, based on the deep red filter that is on them.

Maybe a Passive IR (PIR) sensor that is armed when it sees an object (body) warmer than X degrees, then is triggered when that onbject leaves the unit's line of vision. This should have some type of delay to prevent it being tripped by someone walking by.

Depending on the placement of the toilet, a beam-of-light sensor might work - perhaps two sensors, one for users that sit, another for those that stand...

John
 

Reverendj1

New Member
A beam of light sensor would not work because then it would flush every time someone uses the shower, as you have to walk past the toilet to get to the shower. Since the plumbing in my house is ancient, this would make for one uncomfortable shower. :) Do you know of any specific models of ir proximity sensors you have used?
 

BeanieBots

Moderator
I've used the GP2D12 frequently.
It gives out an analog voltage that represents distance so you could set your own distance threshold.
Range is about 4" to 30".
For more details, see the link I attached earlier.
 

Rickharris

Senior Member
I need a proximity sensor that will detect if something is within 2-3 feet of it. I do not need to know how far away the object is, just that it is within 2-3 feet of the sensor. Does anyone know of a good cheap sensor that works well with the picaxe? In case you are wondering, I want to add an automatic flush to my toilet. :)
SF05 Ultra sonic sensor,

Ordinary light sensor e.g. LDR will detect a light shirt at a few feet in good light.

Pressure pad in front of toilet or under the seat.

light curtain from roof to floor
 

BrendanP

Senior Member
Thanks BB for the link to the Acroname site, its a great resource. I found a couple of potential soloutions there to some design problems I'm having.
 

Reverendj1

New Member
BeanieBots, the GP2D12 seems perfect for what I want to do. The only problem now, is how do I read the distance? I know to use readadc, but I am not exactly sure what the range would be. It says that the output range is .25v-.55v. So, assuming a 5v supply, would the range be 13-28? Sorry if I sound dumb, this is my first project I will actually complete. I have a second one all programmed, I just don't have money for all the parts yet, and I'm itching to get my feet wet.
 

Reverendj1

New Member
Steve, funny you should say that. I read about that on MAKE's rss today and thought it would be a fun beginner's project using a picaxe, hence the questions. :) Mine won't push the handle though, it will pull up on the flush thing (technical plumber's term) inside the tank, so it won't need much strength. I have a feeling once I get some money I'm going to be putting microcontrollers in everything.
 
Last edited:

BeanieBots

Moderator
That .25v to .55v is the range of voltage at the maximum range of 80cm.
(they are a little imprecise at max range)
The difference in voltage will be much greater as the 'user' gets closer.
It is not a linear voltage to distance relationship so you would need to experiment. (the voltage starts to DECREASE again when closer than 4" which catches out many robots that use them).
There are two easy ways you could set it for a 'known' distance.
1. Measure the voltage comming from the sensor and set a threshold for the ADC based on that voltage.
2. Generate a simple software loop that outputs the ADC value (say via sertxd or debug) and note the ADC which is sent out at the distance you want.
 

Denzel

Senior Member
thats funny...

Only the last few days have I been trying to get my toilet to flush when I walk away. The only thing thats stumping me is the actual flushing. The proximity kit I found on some nz website cant quite recall but it basically connects to the picaxe and once an object is in range it waits till the object (person) is out of range again before flushing. But none of my steppers or motors are strong enough (even 18v!!) to push in the button of my new 'super strong' toilet gosh!!!!.

good luck! and ill tell you if I remember where I got the kit from as it was very simple and quite cheap ($35 NZD) and worked well with the 08M
 

Reverendj1

New Member
@Denzel, What I was planning on doing is, instead of trying to push the lever down on the outside of the tank, pull up on the flapper valve inside the tank. The unit would have to be installed inside the tank, but I think it would require significantly less force. See this picture for a better idea of what I'm talking about. Because of the way the handle acts as a lever, with the small side the one you push on, I think you need to apply a lot more force to get it to flush.
 

SD2100

New Member
Maybe one solution for activating the lever inside the cistern with some force is a small cylinder (linear actuator) thats connected to the water supply, the picaxe activates a low voltage solenoid valve which supplies water the cylinder, my water pressure is 30psi so this would give a good push with a cylinder that has a piston surface area of 1 square inch, these cylinders can be made at very low cost from PVC fittings etc and could be mounted inside the cistern.
 

Reverendj1

New Member
Okay, I have it all figured out, I think. I am going with the Sharp GP2D12 as suggested by BeanieBots, a 08M PICaxe and some random servo.
The code is all written and allows you to delay a flush for half an hour in case you have old plumbing (like I do) and need to use the toilet, then take a shower. There will be an indicator light, so you know if it is in 'delay mode'. It will also only activate if someone is in front of the toilet (between 5 in (~12 cm) and 2.5 ft (~76 cm)) for at least 5 seconds, so it will not be activated by walking past it.
I plan on installing the PICaxe and servo in an enclosure inside the tank, to make it easier to pull up on the flapper valve, instead of pushing down on the handle. I think I will install the delay mode button, indicator light and IR sensor in a candle that can be placed on top of the tank, so it doesn't look too conspicuous.
I will post the complete project with code, pictures and whatnot in the projects section pending my girlfriend's approval (she's scared I'm going to break the toilet or something) and project completion.
 

Reverendj1

New Member
:) Nice. Thinking about it, I can get about as many free aerosol air fresheners as I need. (My friend's dad works for an office tear-down company) Maybe I should look into adding a freshener module. That might be another selling point to my girlfriend, always having a fresh smelling bathroom. ;) Although I don't think I would go so far as to check the methane levels. :)
 

JBrookes

Member
as often is the case, the gf had more sense :)

Okay, I have it all figured out, I think. I am going with the Sharp GP2D12 as suggested by BeanieBots, a 08M PICaxe and some random servo.
n top of the tank, so it doesn't look too conspicuous.
************************
I will post the complete project with code, pictures and whatnot in the projects section pending my girlfriend's approval (she's scared I'm going to break the toilet or something) and project completion.
************************
 

SAborn

Senior Member
He's most likely died due to toxic air in the bathroom, has anyone noticed a wall or ceiling where these auto room fresheners have been fixed and the excess spray has coated over a year.
It cant be good for you to breath all that toxic rubbish just because you like the room to smell like flowers,.......plant a garden and sit out there if you want to smell flowers, i think.
 
Top