|
Post by chrisinkc on Feb 13, 2016 2:08:28 GMT
In Eric's original instructable, he uses a Ultrasonic Distance Sensor to detect that his garage door is open, however, I haven't seen anybody on this forum using the UDS. Instead, it seems people are using a reed switch. Is there a reason for this?
|
|
|
Post by lewishollow on Feb 13, 2016 6:21:37 GMT
A reed switch gives you exactly the data you need - 1 or 0. It's either open or it's closed. When you use a distance sensor, you need to write code that knows what analog value closed is vs open, and account for variance of the analog signal. The reed switch is much better for an open or closed situation.
|
|
|
Post by greginkansas on Feb 13, 2016 11:48:12 GMT
I use a UDS to see if the roomba is on the charging base.
Greg
|
|
|
Post by chrisinkc on Feb 13, 2016 22:23:34 GMT
Thanks for the feedback. That makes a lot of sense. Does anybody have a schematic of a reed switch node? Really, I just need to know if the reed switch is connected directly to ground and a pwr pin or does there need to be a resistor involved?
|
|
|
Post by greginkansas on Feb 13, 2016 22:49:16 GMT
Use a 10k from + to the SW then to a input- for a long run to the SW or just go GND to SW to input using the internal pullup
Greg
|
|
|
Post by papa on Feb 14, 2016 16:05:11 GMT
chrisinkc, I've wired my reed switch & coded it similarly to the pushbutton switch in the computourist DHT End node schematic & sketch.
|
|
|
Post by chrisinkc on Feb 14, 2016 18:37:51 GMT
Papa, you said in a previous post that you used a reed switch to check if your garage door was open or closed. You also said that the reed switch failed after a month most likely because the switch was in the closed position when the garage door was closed causing the switch to eventually fail. Have you figured out a way to have the reed switch stay open when the garage is closed? Where did you mount the reed switch? Was it where the garage door makes contact with the ground?
Has anybody thought of using the reed switch in such a way that instead of having the switch 'closed' when the door is closed and open when the door is open, you have the switch mounted in such a way that as the door passes a point, the switch is triggered for a moment which sends a change in status message. If the door was already open, then triggering the switch would signal that the door is now closed and likewise if the door was already closed, then triggering the switch would change the door status to open. This would keep the reed switch from ever being 'closed' for more than a few seconds at a time. Does this make sense?
|
|
|
Post by papa on Feb 14, 2016 20:11:28 GMT
chrisinkc,
Thanks for considering my past post that you mentioned & making a suggestion that I will keep in mind.
Some history & explanation: My first reed switch was just the bare glass bulb with short leads. I had to solder wires to the leads & do a makeshift protection / mounting. It worked a while then quit PERHAPS because it was fused by being mostly in the closed, power flowing state OR PERHAPS because what I used / made was fragile & prone to fail eventually. The next reed switch I used (still the normally open type) was in a protected plastic mounting package with wires attached. So far, it's lasted much longer than the original attempt. If this works, I'll continue that way. If it does not work I have a normally closed type reed switch that I will try with changed code logic.
My reed switch is at the bottom of the garage door frame. The magnet attaches near the bottom of the garage at the end of what anchors the garage door pull cable. As I desire it, when the door is completely closed (reed switch AND magnet both at the bottom), my user interface says "closed." Otherwise, as I also want, UI says "open," which could mean partially open.
Responding to your suggestion: I considered something like the approach in your second paragraph & decided on my approach. Why? Using only one reed switch, I want to be able to monitor the garage door reliably from a distance (no camera or eyes on the door) & know that it is COMPLETELY closed or (even partly) open. As I believe with most garage open/close systems, one press of a button starts the door, another press stops it, & another press restarts door movement (maybe in the opposite direction ?). As long as one type of reed switch works, I believe my approach is more certain to tell me completely closed or at least partly opened.
I suppose using your suggestion, I could accomplish something similar to my approach, if I mounted a normally open reed switch near the bottom of the door frame BUT just barely above where the magnet trips the switch. That way at the bottom, the reed switch would be open. However, it would depend on a reliable count of the magnet passing the reed switch. If the count is one off, it would represent the opposite of the door state. If this worked, it might be acceptable for a garage door which is somewhat fixed in place even partly open. However, for a gate, I'd think we'd want to know it is COMPLETELY latched closed so a pet could not "nose through."
So for the time being, I'll use my approach with either a normally open or normally closed reed switch, but will keep your suggestion in mind as is or with refinement. Thanks again. It's good to see things through other eyes & minds.
|
|
jtk
New Member
Posts: 1
|
Post by jtk on Feb 19, 2016 4:43:31 GMT
I really like the ultrasonic sensor on the ceiling looking down - it gives me three ranges. Door open, car present or empty.
|
|