Advice for a small electronics project?

40 views
Skip to first unread message

Nathan Schrenk

unread,
May 11, 2016, 11:24:34 PM5/11/16
to arch-r...@googlegroups.com

I have a project in planning that involves a few sensors and switches and relays to power magnetic locks and a relay that provides power to a motor. I wanted to run my overall plan past folks at AR to get advice. I think the project involves a microcontroller, 6 sensors, 4 magnetic locks, a 12VDC power supply, 12VDC relays (perhaps a single 4-channel relay module) for the magnetic locks, and one 120VAC relay for an electric hoist.

The application is basically safety for the operation of a freight lift. There are two positions for the lift, up and down. There are two sets of double doors, one at the lift's "up" position and one at the lift's "down" position. Each of the 4 doors will be monitored by sensors that indicate whether the door is closed. For these I'm planning on either using a push-button sensor in the door frame, but a magnetic proximity sensor would work. Two more sensors will indicate if the lift is in the "up" or "down" positions. I'm thinking some kind of physical switch, but again a magnetic proximity sensor might work -- I haven't quite figured this out yet. Magnetic locks will prevent the doors from opening when the lift is not at the same position as the door (e.g. "up" doors only unlock when lift is in "up" position).

The logic for the project is something like this:

1. If lift_up then cut power to up_lock_1 and up_lock_2. Else supply power to up_lock_1 and up_lock_2.

2. If lift_down then cut power to down_lock_1 and down_lock_2. Else supply power to down_lock_1 and down_lock_2.

3. If up_door_1_closed AND up_door_2_closed AND down_door_1_closed AND down_door_2_closed then supply power to coil on motor relay. Else cut power to coil on motor relay. Note that this doesn't actually cause the motor to move, just allows the motor to be activated by a separate 2-button controller.

In combination these rules only allow the lift to move when all the doors are closed and prevent the doors at each level from opening when the lift is not present at that level.

I might also add a few status LEDs to let the operator know whether the system is detecting the doors closed or the lift at up or down position.

Here's a link to the magnetic locks I am considering using: http://www.amazon.com/dp/B00GPB4ETG
Since they use 0.32A each, it seems like a 12VDC 2A power supply would be more than sufficient to power all 4 of these locks?
I'd welcome advice on what microcontroller and multi-channel 12VDC relay module to use. I think I'd use 3 channels on the relay module: 1 for the upper door locks, 1 for the lower door locks, and 1 to activate the coil on the motor relay. A lot of the relay modules I've seen require 12V coil voltage, so it doesn't seem like those could be driven directly from GPIO pins on a microcontroller that are 3.3V or 5V.

What else should I watch out for / am I missing?

Nathan

Travis Megee

unread,
May 11, 2016, 11:33:13 PM5/11/16
to arch-r...@googlegroups.com
So far I'm not seeing anything so far that requires a microcontroller.  The elevator "detector" switch on each floor could directly trigger the relay to release or lock the corresponding maglocks.  Tie all the door switches together with another relay to allow elevator movement.

Travis

--
You received this message because you are subscribed to the Google Groups "Arch Reactor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arch-reactor...@googlegroups.com.
To post to this group, send email to arch-r...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/arch-reactor/CAK%2Bxjc85MKCP0GZTjVjC1TF8Sb1fdzog5bf9mW8rBOwd%2BqF4bQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

EschewObfuscation

unread,
May 11, 2016, 11:53:52 PM5/11/16
to Arch Reactor, nat...@schrenk.org
Just a few thoughts to consider:

The logic in your project could just as easily be random logic'ed, but micros are so cheap now, it's rather a toss up financially.

If you're using a micro, I'd say plan on optoisolators on all your GPIO's; not truly necessary, but it protects your CPU from spikes and noise picked up in a presumably industrial environment.

GPIO's can easily run higher voltages eg for relay coils, with just a small transistor or two. But... if you're already using optoisolators as above, the whole question becomes moot, as most optos will handle 30 V or so anyway. You get level shifting for free.

I'd suggest magnets and reed switches for your sensors. It avoids the issue of mechanical vibrations, banging about etc. You'll still need to debounce, either in hardware or software, but the less direct mechanical contact the better.

Don't forget in your design "assume this dies at the worst possible moment, ie with a person inside the elevator... how will he override it to get out?"

Nathan Schrenk

unread,
May 11, 2016, 11:54:25 PM5/11/16
to arch-r...@googlegroups.com
Yes, I suppose that's true. As long as the switches are rated to allow the coil activation current to pass through them, and if LEDs are added, that small additonal current, then I think this could just be two simple circuits. I imagine it would still be possible to light individual LEDs to show status for each door sensor, but I haven't figured out exactly what that circuit would look like in the minute I've been thinking about it.

Keith Rogers

unread,
May 12, 2016, 10:30:09 AM5/12/16
to arch-r...@googlegroups.com
If this is for a real life elevator, I'd be careful about implementing an elevator control as they have quite a bit of regulation, inspection requirements, etc... All for pretty good reason since they can kill folks when things go wrong.  There can be permits required, inspections, codes with things like a mandatory equipment room, license requirements etc.  Regulation aside,  I have no doubt it's doable.  But the redundancy, failure modes, etc are a lot trickier to sort out and much of those past failures would have driven the regulations.

Sent from my mobile device

Ryan Williams

unread,
May 12, 2016, 10:56:53 AM5/12/16
to arch-r...@googlegroups.com
I'd agree with Travis on the microcontroller being unnecessary; if you'd like to involve one it'd be most useful monitoring the system he describes without being it involved in the control system for logging and troubleshooting purposes. 

EschewObfuscation

unread,
May 12, 2016, 1:53:04 PM5/12/16
to Arch Reactor, nat...@schrenk.org
Okay, let's restate the logic as I understand it.

If platform is at top, power is available to upper doors. 1 switch.

If platform is at bottom, power is available to lower doors, 1 switch.

If all doors are closed, power is available to the motor, 4 switches in series.

Indicator lamps as desired.

Is that an accurate summary?

Nathan Schrenk

unread,
May 12, 2016, 4:33:33 PM5/12/16
to arch-r...@googlegroups.com
Yes, that's an accurate summary, except for the nit that when platform is at top, power is removed from the mag locks at the upper doors, and similarly for the lower doors when platform is at bottom. I was planning on using the normally-closed connection on the relay for that: when the platform-at-top switch closes it connects the circuit that drives the upper door lock relay coil, removing power from the mag locks.

Nathan 

EschewObfuscation

unread,
May 12, 2016, 4:54:40 PM5/12/16
to Arch Reactor, nat...@schrenk.org
Okay, preliminary comment:

The lock style you linked to is called Fail Safe, in that it uses power 24/7 to remain locked, and releases when power is lost. (That style also is designed for hinged doors; I don't know if you are looking at hinged or sliding doors.) Those (linked) magnetic locks are used in jails, dementia wards etc to confine people, but allow them to escape in the event of power loss (which will often accompany fire).

The other style is Fail Secure, which remain latched/locked except when the solenoid is being powered. My first impulse (no pun) would be to use fail secure for this application, but your preferences may vary, or be driven by considerations of which I'm unaware.

If you were to use fail safe, the upper door power can be supplied by a SPDT relay, in one state, the doors can be operated. When the relay is in the other state, the lock is powered. I can envision a minor failure mode in that the carriage arrives at the top, power becomes available to the doors, lock becomes de-energized, doors flop open a half inch, elevator becomes inoperable until the doors are snugged tight. This may or may not be an issue, depending on how the doors behave.

If you were to use fail secure, then the same power that becomes available to the doors also becomes available to a push button that operates the lock solenoid.

Either way, the maximum logic required for the project would be a SPDT relay for each set of doors, two relays total, plus several switches as position sensors.

Nathan Schrenk

unread,
May 13, 2016, 1:13:04 AM5/13/16
to arch-r...@googlegroups.com
This project regards a dumbwaiter, not an elevator, and the requirements are different, but your concern regarding regulations are valid.

On Thu, May 12, 2016 at 9:30 AM, Keith Rogers <phog...@gmail.com> wrote:

Keith Rogers

unread,
May 13, 2016, 8:25:07 AM5/13/16
to arch-r...@googlegroups.com
Nathan - Ahhh ok, it sounds like a fun project.  Arduino is what I would use... So cheap now, why not?  And you get fine control over timing, delays, and extras like data logging and or status messaging, etc.  


Sent from my mobile device

Nathan Schrenk

unread,
Jun 2, 2016, 1:41:33 PM6/2/16
to arch-r...@googlegroups.com
Someone asked for me to send an update after this project was completed, so here goes:

I ended up taking your collective advice and just using three simple circuits with no microcontroller involved. It works well. Recall that there is 1 set of double doors at the top of the lift and one set at the bottom. A switch in each of the 4 door frames detects whether the doors are closed. These switches are wired in a loop that includes the relay coil that supplies power to the hoist, and a 12V power supply. The hoist only operates when all the doors are closed.

There is one circuit each for the upper and lower door locks. A limit switch detects whether the car is at the lower or upper level, and that switch triggers a relay that unlocks the doors at the appropriate level. I ended up using fail safe mag locks to hold the doors closed. I didn't see a good way to use fail-secure locks with double doors and the mag locks were easy. One unexpected thing I did need to add was a cabinet latch to hold the doors closed when the mag locks are not energized. Without the latches the doors would pop open slightly when power was removed from the mag locks and the mag lock would not draw them back in when power was restored, leaving the doors unlocked.

Overall this project turned out well and I'm happy with the result. I didn't end up adding any status LEDs. The relay board I board for controlling the maglocks has LEDs on it that show the status of the relay coils and that is nice. One improvement I might make in the future is to add some status LEDs for whether the lower or upper lift position switches are closed. If I get really ambitious I might try to replace the manual hoist control with an automatic control and add buttons to send the elevator up or down, but I doubt I'll ever get around to that.

Nathan


--
You received this message because you are subscribed to the Google Groups "Arch Reactor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arch-reactor...@googlegroups.com.
To post to this group, send email to arch-r...@googlegroups.com.

EschewObfuscation

unread,
Jun 2, 2016, 6:50:12 PM6/2/16
to Arch Reactor, nat...@schrenk.org
Cool; it's good to hear 1) we helped, and 2) the project succeeded! :)
Reply all
Reply to author
Forward
0 new messages