Imitating button press to trigger door lock open - Page 1
Forum section: electronics / beginners

author: symbianas
author_rank: Regular Contributor
timestamp: November 18, 2024, 04:33:21 pm
content: Hi I have old type intercom system with 5 wires. I want to trigger door open with MCU like STM32. I have found that GROUND and LZ wire short makes doors to open.How could I trigger it without a button using MCU?I have tried using "S9014" (NPN) transistor. It does the job, but interferes with the system, I hear some interference noise in the speaker. Do I need some kind of additional components? Also what if MCU loses power, how should I handle this case?I have found similar intercom door open schematics, but it uses 6 wire system where EZ1 and EZ2 need to be shorten to open the door. It also uses optocoupler and triacs instead of transistor.Is this a better solution and I should use it?

author: pcprogrammer
author_rank: Super Contributor
timestamp: November 18, 2024, 05:59:03 pm
content: There are several options to do this.The optical isolated triac route will only work if the intercom system uses AC on the line to open the door. In case of DC the triac won't turn off.A very simple solution is using a relay. This ensures full separation of the two circuits and works with both DC and AC on the switch side.A third option is using a FET instead of a BJT. But only works with DC.In all cases it is important to check what the used voltage is on the door lock line.If the MCU looses power, you can always use a simple push button switch to close the circuit and open the door. This can be connected in parallel to the triac, relay or transistor.

author: symbianas
author_rank: Regular Contributor
timestamp: November 18, 2024, 06:21:28 pm
content: Quote from: pcprogrammer on November 18, 2024, 05:59:03 pmInteresting, I believe both 5wire and 6wire intercom systems are DC low voltage systems, max 24V (you can touch wires and wont get electric shock or something). And the circuit I sent is from supposedly working example of 6wire intercom system (https://www.edaboard.com/threads/intercom-opened-by-morse-code.248580/).Quote from that page:Electric strike is connected to the triac, and the triac is connected to the optotriac, controlled by MCU port. The system asleep consumes 10mA (8mA 7805 + 2mA Attiny). This can be reduced. During the operation of opening the lock, it consumed >20mA, so it is impossible to power it from microphone line or electric strike. That is the reason why external power supply has to be applied. The intercom is connected to the power supply from the router, which does not read the additional 20mA.Quote from: pcprogrammer on November 18, 2024, 05:59:03 pmPower consumption is also important as this thing might be powered from battery. I think the relay would consume much more than 10mA?I also have idea to power it from super capacitor which would charge while calling if that will work...Quote from: pcprogrammer on November 18, 2024, 05:59:03 pmHow do I do that?

author: pcprogrammer
author_rank: Super Contributor
timestamp: November 18, 2024, 06:32:51 pm
content: Quote from: symbianas on November 18, 2024, 06:21:28 pmWith a multi meter that can measure both AC and DC. When set to AC and you try to measure a DC voltage there will not be a reading. (0.00 on the display)When using a triac, relay or transistor it is also important to know the maximum voltage, because they all have maximum ratings.

author: pcprogrammer
author_rank: Super Contributor
timestamp: November 18, 2024, 06:42:52 pm
content: Quote from: symbianas on November 18, 2024, 06:21:28 pmI'm sure you will be able to find low power relays where the coil works on 3.3V, and even if it draws some tens of milliamps it won't be on all the time. Opening the door will be a momentary action so a couple of seconds at most.As an example there are cat flaps that run on batteries for months on months with cats going in and out on a daily basis. The opening is done by activating a coil to pull down a pin.

author: symbianas
author_rank: Regular Contributor
timestamp: November 19, 2024, 03:06:23 pm
content: Quote from: pcprogrammer on November 18, 2024, 06:32:51 pmInteresting, I have measured voltages AC ~11.5V and DC ~0.02V. So I guess its AC powered lock?So I guess I should stick with triac solution correct?

author: SteveThackery
author_rank: Super Contributor
timestamp: November 19, 2024, 03:21:35 pm
content: I'd use a relay. It's ideal for this job as the contacts are completely isolated from your circuitry. Just connect a "make" contact (normally open) across the button terminals. The relay contacts won't care whether it DC or AC, nor what the voltage is (provided its adequately rated, obviously). It'll just work.

author: pcprogrammer
author_rank: Super Contributor
timestamp: November 19, 2024, 03:42:23 pm
content: Quote from: symbianas on November 19, 2024, 03:06:23 pmCorrect that it is AC powered.That rules out the transistor option and explains the noise you hear in the speaker when the transistor option is used.Depending on how much current the lock draws you might get it done with just the MOC3022.Or like SteveThackery wrote stick with a relay. But for this you also have to make sure the contacts of the relay are rated for the AC current.You can measure the current with a multi meter that has current measurement too. Start on the highest current setting to not wreck your meter and hold the leads on the contact points that open the door. The meter will now act as the switch.

author: symbianas
author_rank: Regular Contributor
timestamp: November 19, 2024, 04:30:48 pm
content: Quote from: pcprogrammer on November 19, 2024, 03:42:23 pmI guess If I use MOC3022 I can just implement full schematics just to be safe. But now the questions is does the GND and LZ positions do not matter and they can be placed at any position of EZ1 and EZ2?Also if MCU will use same GND is it ok?

author: pcprogrammer
author_rank: Super Contributor
timestamp: November 19, 2024, 05:42:04 pm
content: You don't connect the ground of your MCU part to the intercom system. That is why one uses an optocoupler, to keep the circuits separate.I looked up the datasheet of the MOC3022M and it is intended to drive another triac, but for instance the IL410 most likely can do the job without the additional triac. It depends on the current needed to work the lock.The BT138 can handle 12A which will be overkill for a door lock. The IL410 can handle a constant 300mA which might be to low.https://www.datasheet4u.com/datasheet-pdf/ONSemiconductor/MOC3022M/pdf.php?id=1418748https://media.digikey.com/pdf/Data%20Sheets/NXP%20PDFs/BT138%20Series.pdfhttps://www.vishay.com/docs/83627/il410.pdf

author: symbianas
author_rank: Regular Contributor
timestamp: November 19, 2024, 06:27:45 pm
content: Quote from: pcprogrammer on November 19, 2024, 05:42:04 pmI am kind of planning to do so:So I guess ground is common for both for MCU and MOC3022?Not sure if super capacitor will be able to charge while calling to power MCU after call to unlock the doors... There is no other power wires there.

author: SeanB
author_rank: Super Contributor
timestamp: November 19, 2024, 06:32:36 pm
content: I have met a lot of those intercoms, and while the door release is AC powered ( or DC powered if you put in the optional battery back up unit, which keeps the entire system running with power loss for a few hours) the actual door contact really needs to be either a dry relay contact, or an optocoupler with darlington output, which is not exactly stellar speed wise, but which will operate with 1mA of LED drive no problem. 4N32 or 4N33 is cheap and will work, just connect emitter to 0v and collector to LZ, as the door interface unit operates that section using all DC, so as to reduce hum on the long internal wiring.Power wise you cannot draw any power from anything, as the ring actually is a tone used to operate the handset speaker as sounder, so it has only a 2 or 3 tone AC signal, driving a 30R speaker and is generated by a pair of CMOS hex inverters in the head unit, so has only limited power capacity. You either need to have a local battery, either lithium or primary cell, or a local DC supply from say a old phone charger.

author: pcprogrammer
author_rank: Super Contributor
timestamp: November 19, 2024, 06:46:17 pm
content: If the ringing is a described by SeanB, than it will not be able to power your setup.Another question is what the intent of the MCU is. When you want to automatically open the door without human interaction you don't need the MCU. Just some logic to pick up the ring signal and a simple 555 timer to hold the optocoupler on for a while will do. Power draw will be much lower.

author: pcprogrammer
author_rank: Super Contributor
timestamp: November 20, 2024, 07:01:14 am
content: I have been thinking about how to power your setup, and it might be possible to use the ~12V door lock for this.Connect a bridge rectifier with it's AC inputs to the door lock control wires and a big capacitor (1000uF 25V) to it's DC output wires. Use this to power a buck converter to bring it down to 3.3V. Try loading the circuit to see if the door lock stays quiet.Use the optocoupled triac option or a relay to close the door lock circuit. In this case do not connect the ground of the door lock circuit to your MCU circuit.When opening the door the input supply will be cut but if the current draw of the MCU circuit is low enough it will stay awake for the time it takes to open the door. If not more capacitance is needed. This can be added after the buck converter, but you might need a diode in the circuit to avoid the new capacitor to be drained by the buck converter.To detect if someone is ringing the door bell you have to use another optocoupler to keep the circuits separate.

author: symbianas
author_rank: Regular Contributor
timestamp: November 20, 2024, 05:31:56 pm
content: Quote from: pcprogrammer on November 19, 2024, 06:46:17 pmI guess my idea is kind of dead as there is no other source of power there.Quote from: pcprogrammer on November 19, 2024, 06:46:17 pmThe MCU should not consume a lot of power too, I think it consumes <5mA when I was testing, its for later use to try to make some kind of "code" entry, so that not all of the people would be using this. But I guess timer could work too.Quote from: pcprogrammer on November 20, 2024, 07:01:14 amInteresting idea, but does that mean that lock will be always powered? How it might be impacted if it stays quite?I need to try to find/buy these components and try it out if door lock stays quite.Quote from: pcprogrammer on November 20, 2024, 07:01:14 amNot sure how to use optocoupler here, but I guess its to early to understand as it might not work in the first place.

author: pcprogrammer
author_rank: Super Contributor
timestamp: November 20, 2024, 06:26:59 pm
content: With the door lock staying quiet, I mean that the coil is not humming to loud. For the lock to open there will be a minimum current and below that there will be a bit of humming, but with really low current you might not even hear it.So with your micro consuming less then 5mA at 3.3V the current drawn from the door lock circuit would be even less due to the transformation in the buck converter. Lets assume an 85% efficiency of the buck converter and a rectified input voltage of 16V, the current through the door lock will be around 1.2mA.You can test the lock with a resistor of 10kOhm to see what happens. Lower the resistor step by step down to say 100Ohm. This way you can see how much current can be taken from the circuit without causing problems.The optocoupler on the ring circuit has to have the LED connected via a resistor to the speaker in the intercom. It will take some testing and finding an optocoupler that works with low forward current to see if on the other side of the optocoupler the ringing is seen.Without actual specifications and schematics of the intercom system it is hard to say if any of this will work properly. These are things that just come from a creative mind and need to be tested to see if they actually work. It is how a lot of my work came together.

author: symbianas
author_rank: Regular Contributor
timestamp: November 20, 2024, 07:11:49 pm
content: I found fathers ancient KC405A Bridge Rectifier(did not connect 1000uF 25V capacitor for now) attached multi-meter to measure the current, then step-down converter and STM32. Power consumption seems to be 3.6mA.The door look does not make any sound which is good! But I hear increased humming in the phone if I connect this system and less humming if I disconnect it.

author: pcprogrammer
author_rank: Super Contributor
timestamp: November 20, 2024, 07:23:21 pm
content: Most likely some cross talk in the wiring. That will be difficult to tackle. The capacitor might help a bit.

author: symbianas
author_rank: Regular Contributor
timestamp: November 30, 2024, 03:25:26 pm
content: Quote from: SeanB on November 19, 2024, 06:32:36 pmAnd what about taking power from MIC? It seems to have DC 14V when Phone is hang up. Once lifted it goes to 3.5-4V. Would it be a better solution?

author: pcprogrammer
author_rank: Super Contributor
timestamp: November 30, 2024, 04:21:06 pm
content: Quote from: symbianas on November 30, 2024, 03:25:26 pmAs long as you keep the current low it might work.

author: symbianas
author_rank: Regular Contributor
timestamp: December 15, 2024, 06:08:18 am
content: Quote from: pcprogrammer on November 30, 2024, 04:21:06 pmSadly it create even more noise than powered from Lock line... I guess I am out of options? Unless I charge super capacitor when line is 14V and then somehow disconnect if MIC gets 3.5V when phone is picked up? Not sure if MIC gets 3.5V if anyone else picks up the phone from other flats?

author: symbianas
author_rank: Regular Contributor
timestamp: December 15, 2024, 01:07:13 pm
content: Quote from: pcprogrammer on November 20, 2024, 07:01:14 amI am back to you original idea. Maybe if I would implement clever deep sleep mechanism in software (deep sleep if no ring detected for some period of time or if mic is on) I could reduce power supply and maybe that would avoid humming?Quote from: pcprogrammer on November 20, 2024, 07:01:14 amThe capacitor needs to be electrolyte?

author: pcprogrammer
author_rank: Super Contributor
timestamp: December 15, 2024, 02:11:39 pm
content: Disconnecting the power to your circuit when the phone is of the hook should cut out the noise. With a big enough capacitor it should be ok during the time it takes on the phone.So a super cap might be good, but limit the charging current to it. Otherwise some electrolytes should also help. For big capacitance it is the best solution I think.

author: symbianas
author_rank: Regular Contributor
timestamp: January 26, 2025, 04:21:02 pm
content: So just to confirm, are my BT138 pins correctly attached to "-0 (GND)" and "LZ (Lock)" - does it mater if I invert them?