Connect with us

bathroom door automation design - grab a coffee first!!

Discussion in 'General Electronics Discussion' started by davpankhur, Jun 6, 2014.

Scroll to continue with content
  1. davpankhur

    davpankhur

    25
    3
    Jun 5, 2014
    Hi,
    I plan to automate my yet to be installed, sliding bathroom door.

    The aim is to have a door slide open or slide to close (and locked) - e.g by a button press, or by a sensor trigger.
    I think i have the design down right, mostly. It would be great to get some improvements, suggestions or corrections. My priorities are, that it is simple in operation and to build so not too many things that can break/fail; and then low cost of parts. It doesn't have to be pretty or last 10 years :p i have a lot of space to hide wires and stuff too.

    Here's the basics of the system.
    Parts:
    1) a working barn door - uses a top mounted rail to slide left and right.
    2) a 12v high torque geared dc motor to pull the door - the door itself will be made to glide with little drag, i hope.
    3) a pulley setup to allow the motor to pull the door left and right.
    4) a heavy duty 12v switch to power and control the motor direction, it has 3 positions, On_1, Off, On_2, its DPDT?
    5) momentary buttons, IR sensors and PIR sensors to control the heavy duty switch.
    6) 3 limiter lever switches to stop the door from flying off the rails
    7) a small dc motor to control the heavy duty toggle switch - need suggestions here!
    8) a 12v door strike solenoid - used to lock the door.


    So I'll try to explain how its all glued up in writing and then show the diagram.

    a) 2 simple mom buttons are wired to the small dc motor so that the left button rotates the motor clockwise and the right button rotates the motor CCW, both using the same 12v power supply.
    The small motor has a wheel on it, with a quarter of it cut out (like pacman). This wheel basically rotates which in turn flicks the heavy duty toggle switch from left to middle to right and back (so this little dc motor is like a servo for the big switch). Maybe it also needs 2 limiter switches as well... maybe the whole design can be replaced with something way simpler and better? all it does is, it flicks a 3 position toggle switch when the buttons are pressed. Can 2 buttons be pressed at once? Yes, and i have not thought of a solution to protect the small dc motor from being shorted out. maybe use 2 little motors, one stronger than the other?

    b) Next... the 12v heavy duty switch is then connected to the big high torque 12v motor that pulls the weight of the door. It is wired so that the left On_1 contacts spin the motor clockwise and the right On_2 contacts spins the motor CCW, and the middle contacts are not used. So now when you press the left mom button, the heavy duty toggle switched is flicked left, and the high torque motor pulls the door and slides it to the left end and thus opens the door.

    c) Limiters (normally closed) are connected to each of the high torque motor power lines so that when the door hits the limiter, power is cut to the motor and it wont be able to spin that direction further, rubber stops are used to help protect the limiters. The middle position of the heavy duty switch is important, in that it wont allow the motor to spin both ways at the same time and get shorted.

    d) The door strike solenoid is fixed to the closing end of the door way. Its just a triangle pin that pokes out when its connected to 12volts. Thus the door strike is connected in parallel with the high torque motor (the right On_2 contacts).
    So when the door is opened, and the right mom button is pressed for 1 second, the heavy duty switch is flicked to the middle, then further flicked to the right, which powers the door strike (pokes it out) and also spins the high torque motor to close the door. The door slides to close and hits the door strike and locks the door. One could just slightly tap the mom button and have the heavy duty switch stop in the middle position, depends on the speed of the small dc motor.
    The third limiter is used here to cut the circuit of the left mom button outside the bathroom, this stops people from opening the door when someone has locked it from the inside. The third limiter switch is located on the right side of the door way.

    e) So... when the left mom button is pressed, the small dc motor flicks the heavy duty toggle switch to the middle, this un-powers and unlocks the door strike solenoid (the door is not being pulled yet), then continues to flick over to the left On_1 side, which starts the high torque motor and pulls the door open.

    f) Now add PIR sensors and IR sensors in parallel to the mom buttons and go without touching anything at all. I plan to have a PIR sensor outside the bathroom, it triggers the door to open when you walk 3m close to it, and then have an IR sensor inside the bathroom to wave at, so the door can be closed and locked (positioned so it doesn't trigger easily of course). The momentary buttons would actually be large kick foot buttons 20cm from the floor, for those who hate technology :p plus its nice to have one near the toilet for when you rush in and start work but forget to close the door.


    Sorry for the super long post.
    If you look at the diagram (diagram coming soon), it actually seems simple, with of course some small bugs/issues to be resolved. Im sure other people out there would love to have this functionality, which i think shouldn't cost more than $100, excluding the barn door.


    diagram coming...
     
    KrisBlueNZ likes this.
  2. davpankhur

    davpankhur

    25
    3
    Jun 5, 2014
    heres the basic diagram
     

    Attached Files:

  3. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Wow! That diagram is priceless! You should win an award for it. Especially the yoga lady hitting the emergency release button! And your description in post #1 is pretty clear too.

    There's heaps of detail there, but I want to go through your requirements just to make sure I understand them.

    You have a bathroom with a sliding door that is driven by the high torque door motor (reversible 12V DC motor) between the open and closed positions.

    There is a lock solenoid, which is activated into the Lock position by 12V DC. When the door is closing, and while it is closed, you want the lock solenoid to be activated. When the door reaches the fully closed position, with the lock solenoid active, it will click into the lock and stay locked. It would only unlock immediately before opening.

    There is a normally closed limit switch at each end of the door travel which interrupts the door motor current in the corresponding direction so the motor stops when the door reaches its limit.

    You have two non-contact infra-red sensors that are triggered by a hand. One unlocks and opens the door; the other closes and locks it.

    There are also two manual pushbuttons for use if the non-contact sensors fail. The one that opens the door is inside the room as an emergency escape.

    Is that all correct? Is there anything I'm missing?


    My first thought is that you don't need a switch motor and a switch. Any sequencing or delays can be done with relays, resistors, capacitors and transistors, or a circuit made with some logic ICs, depending on the complexity required.

    You can drive the motor using two relays - either use one for ON/OFF and one wired as a "reversing switch", or one for OPEN and one for CLOSE. (In the latter case, they can be interconnected so it's impossible for them to activate simultaneously.)

    Using a microcontroller such as a PIC or AVR would enable you to simplify the control circuitry somewhat, and make it relatively easy to change behaviour, and add enhancements such as having the door slow down as it approaches the limit, so it moves quickly initially but doesn't slam into the limit. But you don't need to use a microcontroller; this can also be implemented in a version using logic ICs or relays and transistors. This also fits more with your desire to have it simple to reduce the chance of failure.

    No matter how you do it though, I think you should have some "master switch" in the bathroom that you can hit to unlock the door and enable it to be slid open by hand. I wouldn't want to see the news report of your accidental death from being stuck in your bathroom!

    How much current does the door motor draw? Do you have a manufacturer and model number for it? Or a link to some data on it?

    How much current does the lock solenoid require?

    What kind of signals do the motion detector and the non-contact detectors provide? What supply voltage do they need?

    What sources of DC power do you have available?

    Are there any other states you want apart from (a) opening, (b) fully open, (c) closing, and (d) fully closed and locked? You mentioned that "one could just slightly tap the momentary button and have the heavy duty switch stop in the middle position". Why would you want to do that?

    I think you want to distinguish "closed and vacant" from "closed and occupied" so that the outside motion detector doesn't open the door when you walk past if someone is already inside, right?

    I'm not totally clear on the user controls.

    You want a movement sensor outside the bathroom to detect when someone is approaching and open the door (assuming it's not locked from inside). You don't want the door to be normally open? What happens if you walk past the door, and it opens, but you don't go inside? Should it close automatically after a short time?

    When you go into the bathroom, you want to activate a non-contact detector to close and lock the door, and you want another non-contact detector to unlock and open the door when you've finished, right?

    And you want an emergency "unlock and open" button inside the bathroom? I suggest that you use something that can't fail to allow you to escape.

    So looking at this from the point of view of the inputs and outputs to the control board:

    Power circuits:
    • 12V DC with enough current to run the door motor;
    • 12V DC outputs to the proximity detectors.
    Emergency controls:
    • Inside emergency switch to kill power to everything so the door will unlock and can be dragged open by hand;
    • Outside emergency switch (ditto).
    Inputs:
    • Outside motion detector (3 m range) to trigger door opening unless it's locked;
    • Inside non-contact switch to close and lock the door;
    • Inside non-contact switch to unlock and open the door;
    • have I missed something?
    Outputs:
    • Door motor control: +12V to move the door towards fully open, and -12V to move the door towards fully closed;
    • Lock solenoid control: +12V to activate the lock solenoid into Lock position;
    • Maybe an indicator to show whether the bathroom is occupied? (i.e. door closed and locked)
    This sounds like an interesting project but I think there is still some detail to work out.
     
  4. davpankhur

    davpankhur

    25
    3
    Jun 5, 2014
    Thanks for your reply Kris! very detailed indeed. You are spot on with everything.

    Furthermore...

    "My first thought is that you don't need a switch motor and a switch. Any sequencing or delays can be done with relays, resistors, capacitors and transistors, or a circuit made with some logic ICs, depending on the complexity required."
    I totally agree, i just dont know what component would replace this horrible switch-motor contraption i made :p
    The main benefit is that the middle position allows the door lock solenoid to release before the motor starts to pull on the door and possibly jam up.? I assume one would have to use timers to replace this push button-to-motor-switch design?
    Pressing the push button momentarily powers the small dc motor which pulls the big switch from on end to the other (3 states). This ensures all circuits are off for a certain time (depending on the small dc motor speed) when ever the open or close state is requested. How would you uss logic ICs to replicate this logic?


    "There are also two manual pushbuttons for use if the non-contact sensors fail. The one that opens the door is inside the room as an emergency escape.
    Is that all correct? Is there anything I'm missing?"

    Correcto!, but the push momentary buttons are for daily use too, not just emergency use. There will be a set (Green coloured open button and a Red close button) inside and another set outside the bathroom. The problem is both open and close request buttons can be pressed at the same time, which powers the small dc motor in both ways, which isnt good! Have not got a fix for this yet...

    I think there will be 6 push buttons in total. 2 button for open and close, inside the bathroom. 2 for outside. 1 close button near the toilet. and 1 open button as the override, hidden in the kitchen (which is actually a switch to kill the 12v power to the motor and lock, as you stated above).
    The door will be pine wood and easy to break/ kick open if required, it is just an internal door and doesnt need any security structures.


    "How much current does the door motor draw? Do you have a manufacturer and model number for it? Or a link to some data on it?"
    I already have a cheap ebay motor. I plan to use the alloy scooter wheels on those kids push scooters as the door rail wheels. They have built-in ball bearings so it should roll smoothly and with little friction (I hope). I think the 12v motor has 3 gears for high torque and draws 50-80ma. It surely is strong and could easily pull 5kg upwards (slowly). I will replace the motor will a stronger and faster one as a 2nd version :)

    The door lock solenoid is a 12v 150ma, 12mm stroke (how far the pin moves). It unlocks when the power is cut so is a fail-safe version.


    "What kind of signals do the motion detector and the non-contact detectors provide? What supply voltage do they need?"
    The IR sensor is 5v and just has the receiver and a transmitter all in one. You stick it on the wall, connect it up, and it output 3.3v on high signal (when a hand reflects the IR light) and zero volts otherwise. I plan to connect the 3.3v signal wires to a 12v relay, which would do the same thing as a hand pressing a push button manually. I believe ebay has IR sensors with relays but these cost more. A transistor would be fine here right?

    The PIR sensor is actually a portable mini led light with a PIR sensor on it. It uses 4x aaa, so 6volts (tested and works on 4v). I will just be taping in to one of the led light's power source (about 4v) and attach that to a relay too. I could just use a PIR module which is cheaper, but I already have the PIR LED light hardwired on the ceiling there. The PIR sensor is good, because it has a bigger detection range and so will have more time to open the door, where as the IR sensor would require the user to wait for the door to fully open... thus the IR sensor is good for door-close actions.


    "What sources of DC power do you have available?"
    I already have a 12v 300ah house battery bank in place. They are 2x 50kg 6volt 300ah batteries. These use to be inside those sit-on cleaning machines they use in shopping centres (petrol engines wouldnt be nice indoors running for hours).
    I plan to have dc-dc converters where 5v power is required, everything else should be 12v and all fused.


    "Are there any other states you want apart from (a) opening, (b) fully open, (c) closing, and (d) fully closed and locked? You mentioned that "one could just slightly tap the momentary button and have the heavy duty switch stop in the middle position". Why would you want to do that?"
    I meant that, that the situation could be possible, where a user slightly taps a button... but yeah, I would not stand there trying to get it to the middle position :p i would just use the kill switch and push the door to where need. This might hurt the high torque motor? should there be a lever to release the motor from the track or pulley?
    I dont think one would need the door in any other position or state... i think once you get use to an automatic door, you just want it open when you approach and close when you need it to, and sometimes stay open for cleaning purposes only.



    "I think you want to distinguish "closed and vacant" from "closed and occupied" so that the outside motion detector doesn't open the door when you walk past if someone is already inside, right?"
    Yeah, I have not fully thought about how this will work without issues.
    For starters, I have a led light that says "On Air..." outside the bathroom - its like the On Air sign for when the radio broadcast room is online/ on air :p do not enter, you know :)
    It is wired to the PIR led light inside the bathroom. So when someone moves inside, the PIR led light, lights up for about 2mins and then turns off, and turn lights up again if there is more moment. This in turn powers and lights up the outside On-Air sign :) the led sign is bright enough to see it from far away.
    The next method is to cut the circuit of all outside buttons/sensors (except for the kill switch). I think I will do this by using NC relays attached to the PIR led light as well. The issue here being that there will be a 5sec gap when the PIR light resets it timer, where the buttons will not be cut off. I could kinda fix this by having a second PIR light, with a different delay time, but this is more a patch-up :p


    "I'm not totally clear on the user controls."
    Ideally it would be all touchless.
    1) user walks to toilet hallway, the PIR sensor detects user and triggers door to open. (or door is kept in open state by default). Also user can kick the Green, foot push button (big 10cm lit up button, placed 20cm from the floor, on the hallway wall).
    2) user walks in and waves hand at IR sensor (IR sensor can have adjustable 5cm to 80cm detection distance) I will set at 10cm and place at the left side of the basin/vanity, with the IR pointing 60ish degrees up - this makes it near impossible to trigger it - useless you have been sent to the naughty corner and it happens to be the bathroom basin wall :p Now the door closes and also locks. User can also walk to the toilet, which will trigger another IR sensor (this one having a 80cm detection range, pointing downwards so its impossible not to trigger it if you use the toilet. Also user can kick the Red foot button on the wall next to the toilet (just in case).
    3) After washing hands with sensor soap and taps :) User can wave hand at another IR sensor, but on the right side of the basin, it unlocks and opens the door. The Green foot kick button near the door also can open the door.
    These foot button will be mostly for the kids, i think. They are arcade quality punch buttons, so they can kick it all day long!
    4) User walks out and is done. Having IR sensors outside to close the door would be tricky but of course its possible...



    "You want a movement sensor outside the bathroom to detect when someone is approaching and open the door (assuming it's not locked from inside). You don't want the door to be normally open? What happens if you walk past the door, and it opens, but you don't go inside? Should it close automatically after a short time?"
    Yeah, Im still deciding on what to do here. The bathroom door is opposite to the linean cabinet, so no worries having the door open by default. And even if it did trigger to open but no one walks inside, its fine too, the toilet is not is sight when the door is open.
    I guess this is a personal pref thing and can be decided later on.


    I thought an emergency kill switch hidden outside for override usage would be enough, plus, the door is a pine extra light-weight door and can be kicked out - but i guess you must provide for all, including 90 year old ladies :p I will definitely put a kill switch inside as well now.


    I think the details to work out are:
    1) how to replace the controlling of the heavy duty toggle switch that powers the high torque door motor.
    2) How to detect when someone is inside and then disable the outside buttons/sensors
    3) replace switches and relays with transistors and logic IC thingys? i'll surely research these.
     
  5. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Yes, some kind of timing circuit. Relays, driven by transistors, with delays implemented with resistors and capacitors. Logic ICs can be used to perform logical functions such as AND and OR, and latching.
    Well... I can point you to an example: a Whac-a-mole circuit I designed (just for fun). It uses latches, gating, and R-C delays. The schematic is here: https://www.electronicspoint.com/threads/electronic-whack-a-mole.254398/#post-1509714 and the circuit description is here: https://www.electronicspoint.com/threads/electronic-whack-a-mole.254398/page-2#post-1509715 (Don't get freaked out by the size of the circuit - yours will be a lot smaller than that!)

    If you have trouble understanding the circuit description, Google some of the relevant keywords. There should be plenty of tutorials out there. Also, download the data sheets for the relevant ICs - CD4001, CD4013, CD4017, CD4093, CD40106. All or most of those ICs would have a place in your circuit.
    That can be avoided with logic. But my confusion about location and use of the buttons points to the fact that you should write up a clear definition of your system. I started this with my list of inputs and outputs; I think you should start from there but expand the detail for each input and each output - for each pushbutton input, include the colour, type, and location of the pushbutton, and how it is intended to be used, as well as what function(s) the control circuitry needs to perform when it is activated.
    Good. Can you incorporate that information into a definition that is laid out like my input/output summary?

    For example, each input could have certain standardised information. For example, one of the pushbutton inputs could have the following details (these are just made up as an example):
    • Signal name: BR_WALL_BTN_OPEN
    • Source: Pushbutton, fist activated, momentary, green, marked "OPEN", locatied inside bathroom, on wall near door
    • Polarity: pulled to GND while button is pressed
    • Action: Unlock door, wait, open door
    With a list of information like this, we should be able to design the logic with minimal confusion :)
    OK, so it won't draw more than a few amps, so you won't need any special relays.
    Great! You should add that information to the comments for the lock solenoid output.
    Right. You don't need a relay. The control board can take the 0V/3.3V signal from the detector directly. It would feed a transistor, for "level shifting", to create a signal that swings between logic low and logic high.

    Can you update the documentation to include information on the power supply requirement and the signal description for these non-contact sensors please.
    OK, good. So it will need a +5V supply, like the non-contact sensors. And you need to describe the signal that it generates. Is it normally 0V and swings to +5V when motion is detected? Add that info to your documentation.
    Cool! That's perfect. The logic circuitry can run on +5V from a 7805 regulator, and the motor and lock can be driven from +12V using relays or MOSFETs. Relays are simpler. That's nice and straightforward.
    You'll have to answer that question. After you have installed the large door motor.
    OK, cool.
    OK. Well, if the door is closed, any movement means there's someone in there, and that's not going to change until the door is open, so the "On Air" sign can stay ON until the door is opened, at least.

    So does this mean that your control circuit should have another input for the bathroom motion detector, and another output for the On Air sign?
    Sorry, I don't understand, but I expect this could be handled by logic on your control board. You just need to add inputs and/or outputs with descriptions of their behaviour and how you want the control board to deal with them.
    Sounds great! All of this information should go into your document. Describe each button or detector in detail (location, size, range, label (if any) and general purpose) in the inputs section, and associate a unique signal name to it.

    Then in the behavioural description, define how the control board has to respond to that input. This section needs to include any definitions for latched states, time delays, etc. But to start with, you can just describe the behaviour in simple (but clear) language. Then we can define the states and internal signals that the control board will have.
    Sure; fine. If you want, you can define an input that selects between those two behaviours, and describe the control logic for each. This could help you clarify which behaviour would be best, or identify problems or conflicts with a particular behaviour. Then you could keep your options open right to the end, and use a DIP switch on the control board to select the behaviour, or decide on one or other behaviour once other decisions have been made.
    Right. It's good that you aren't relying on mains power - you don't want people stuck inside and having to force the door when there's a power cut.
    Those things are pretty straightforward. Logical gating and time delays are easy to implement - see my Whac-a-mole circuit. Relays can be driven by transistors that are driven from logic-level signals.

    Some keywords you can Google to learn about logic circuits are:
    • 4000 series CMOS ICs - this is an old (but still viable) range of ICs (chips) that implement a range of logical functions that are relevant to the control system
    • AND OR NAND NOR Exclusive-OR - basic logical functions
    • D flip-flop JK flip-flop latch - types of latches
    • RC delay circuit - simplest way of implementing delays and timed pulses
    You might want to create your specification document on Google Docs. I haven't used it before, but it's supposed to allow collaboration between two or more users. My Google username is KrisBlueNZ (you may need to "allow" me editing access to your document).
     
  6. davpankhur

    davpankhur

    25
    3
    Jun 5, 2014
    awesome, looks like you are going to help me with the documentation, I will setup a google doc account. I must admit, I am mostly a dreamer and very hands on with very little will power to do documentation, but i will continue with another drawing which should show the locations, specs of each component, inputs/outputs, etc. and maybe a high level logic diagram to shows the basics of the system.

    I am in training for a 50km walk for my fitness and so please forgive for some up coming delays.
    I am half way gathering all the components and its nive to have your help, thanks Kris!
     
  7. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Sure :) I'm a bit strange... I actually LIKE documentation!
    Cool. That should be an interesting learning experience for both of us.
    Well, you've written some very detailed and pretty clear specifications and messages on this thread. I think you just need to organise your thoughts into a structure that makes them easier to work with. That's why I started making a list of inputs and outputs.

    I like to imagine myself in the shoes of someone who knows nothing at all about the project. (I have to assume that he knows some general electronic and mechanical terminology though, and that he is intelligent and technically minded). Then I think of how best to present the project to that person. I would start by introducing the project - what it does (broadly), where it will be used, the specific reasons why you want to do it that way, etc. Then progress to a broad description of the components - the PIR motion sensors, the non-contact sensors, the kick buttons, the door motor and the latch.

    Then I would get down to the "nitty gritty" - detailed definitions of the components, and a definition of function for the control logic.

    For the components: location, summary of its purpose, details such as size and labelling, voltages and currents required, outputs it provides and the characteristics of those outputs, and so on. Each input to the circuit can be given a shorthand name, like my example "BR_WALL_BTN_OPEN", that can be used in the logic definition to avoid ambiguity.
    I find text easier to work with, in general. What I think would help would be a drawing of the overall setup - a plan view of the bathroom showing the fittings, the walls, and the door, and the locations of all input and output devices, but without any detail. You could then add separate diagrams showing the layout of control panels in the various locations, and even photographs of the sensors or the kick buttons if you want.

    I hope Google Docs has a diagram editor. I guess we'll find out :)
    No problem. This sounds like an interesting project, and you sound like an interesting guy. This project isn't urgent, and that's the kind of project I like :)
     
  8. davpankhur

    davpankhur

    25
    3
    Jun 5, 2014
  9. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Bummer about your knee! Can you walk on it?

    I'll PM you my email address.
     
  10. davpankhur

    davpankhur

    25
    3
    Jun 5, 2014
    yeah, its healing fast but hurts.
    ill check PM. thanks.
     
  11. davpankhur

    davpankhur

    25
    3
    Jun 5, 2014
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-