 Okay, yeah, so my talk is kind of more closer to hardware and electrical stuff. There's some software as well, but it's pretty simple. Okay, so how I came about doing this, I had a goal where I actually had a electrical door lock was bought from China, right? It has unknown reliability. And when you read up, or you have been using these devices for some time, they kind of fail in various ways. The boat gets stuck. You have a lock with unreliability, et cetera. So I really wanted to have a rig to test it and exercise it near real world operations. I actually want to move the latch up and down. I want to simulate about two years of lock and unlock actions and then observe if there's a mechanical wear or failure, how does it fail? If it gets stuck, why did it get stuck? So let's talk about test parameters, right? I built a rig in order for me to exercise the lock. Now, some people have told me, hey, you can actually just have a solenoid and actually the lock real quick, but I actually don't want to overheat the lock. I actually want it to have sufficient cool down time. The manufacturer recommends like five seconds between lock and unlock. I did test more harsh cases much later, but at least I wanted to do more real world simulation of this. The open and closed actions were made to be similar to a hinged door instead of just moving a magnet under the lock sensor. I wanted to reveal each cases, such as gems. I encountered once or twice that the boat was coming, there was some delay and it kind of got stuck in the slot that comes with it. So for two years worth of open and closed cycles, I basically ran this for about four to five days. Total, we actuated the lock about 36,000 times. And it's kind of like, yeah, I could sit there, press a button repeatedly to actuate the lock, but building a rig would make it more reproducible and essentially like saves me time if I need to test more than one lock. Okay, so this video over here is why it's like, how I build it up. It's just like me manually closing the lock. As you can see that this lock is kind of like different from other locks in that when you, if there's no power, right, you can actually like force the door to close and you can't open it. How does that go next slide? Okay, yeah, so electrical system is pretty straightforward. There's PC running a Python test script. Python test script communicates with Arduino on a custom PCB. It's something that I made a couple of years back. I'm repurposing it here. I'll talk more about it later. The Python test script communicates with Arduino over a virtual USB. The GPIO board would communicate with like the servo limit switch and the door lock that's under test. The notice that the servo and the door lock, there are like 12 devices. So I had to have like a GPIO board that essentially translate voltages. So something about this board, okay. So the original intent a couple of years ago is that it was actually meant to be a verifiable high voltage, high current, opto isolated IO. So there's a whole bunch of stuff there. That's why I kind of like found it's like easy to repurpose, right? Like it's opto isolated. So in case I accidentally shot a 12 volt wire to my Arduino, I don't like, or like whenever I shot some stuff on the high voltage side, I don't like blow up my USB port, for example. Yeah. Previously, this board was meant to be verifiable as in that there's two Arduino's. One of them would provide eight inputs, eight outputs. The other Arduino would read in 16 inputs to verify what the primary Arduino is doing. However, in my use case over here today, I only use half of the setup. Okay, only one of the two Arduino sockets was populated. Yeah. And it basically have sensor signals through opto isolators to drivers so I can drive high current input and output. The board kind of looks like this. I made this mail a couple of years ago and I put the designs up in the bid bucket which I'll share the link later. There's basically two sockets for Arduino Pro Micro, I think, but only one is used and they're kind of like LEDs there to help me debug what signals are on and off. The features of the firmware on over there, you know, it's an Arduino friendly code. Anyone who has like, is familiar with it, can just like open it and use it. It runs a byte-level protocol. So some people in the past may have heard of this thing called Universal Bitwacker. It's back in the PIC 18F era. So this kind of like follows that feature set. It allows you to manipulate GPIO on and off but the protocol level is not like string, is not like byte character, but you actually have to send bytes. So I had to write a like Python library in order to make it more user friendly. It does like scan the input so that any changes on the input side will just be reported. If there's no changes, then nothing's reported. So that kind of like saves bandwidth over the serial link. Yeah, TTL serial. I did use the PWM output to control the big servo over there. Okay. Yeah, I open source this in my BitBucket and the link will be shared in the last slide. So essentially we, how we run the test, right? We get the door. We test where the door is unlocked within a certain time limit. We wait five seconds and then we test that the door is swung shut within a certain time limit. If any of these time limits have timed out, right, we assume that there's a jam and we'll power down the lock and motor. So over the course of like 36,000 iterations, it did jam about like six times but of that six times, I think five of the times was because a screw was loose on my servo. Yeah. Okay. So this is like the overall setup over here. The, at the top is where the door lock is. Below the door lock, there's like a servo. I bought a servo from China. I think it was called Super 200 for probably one of the earlier versions. The main reason why I use it was because it's really crappy. I'm not going to use it for any other projects but it's useful for roughly opening and closing such a device. Yeah. And it's also really strong. I think it has a force of like 200 kilograms per cm. Yeah. The GPIO board is over there. The USB goes to PC behind and the stuff below is purely like converting like high voltage 110 volts when I stay to 12 volts, five volts and it goes to the GPIO board and the motors. Okay. And it's just a video of the motor opening and closing. So it just like repeats this action, this really dumb action continually for four to five days. Yeah. Okay. So what are the lessons learned from this whole exercise? Of course, building was pretty fun. Right? I actually like read the headway forums and I got some of you talk about using ferrules for like connecting wires. I actually bought a ferrule set and realized that, hey, it actually saves me so much time to wire things up with ferrules. Yeah. So what I learned over here, okay, the servo precision was terrible. So you know, compensate for the terrible so cheap China servo. So I had to essentially like adjust the, how would I say the movement, such that it actually slams the latch shut, right? But it will back off a little so that the, you know, the servo won't be in a stuck position where it's actually exerting force, right? Because that force actually cause wear in the joints and that also cause like the discrupt screw to wiggle off of the joint between the servo axle and the hub. Yeah. So I actually also stacked screws and lock tight to address these mechanical issues. And one of the things that I figured out these China locks, right? The trigger voltage is actually really weird. It's not TTL, it's not five volts, but you kind of like, it's probably like 12 volts. It expects like a large swing, right? Because originally you're supposed to connect it to a button, like a physical switch, right? So it really needs to swing between like less than two volts to more than eight volts initially because like my GPIO board was operating at five volts. What happens is that the pull down resistors kind of like kept the voltage below eight volts. So I was wondering like, you know, yeah, why, why is the, you know, I mean like swinging between like zero and five but the lock is kind of stuck in the open position. So if you saw in the right side, I had to throw in some random MPN transistor to eventually fix that. Yeah. So what about the lock? Right? We've been talking about the whole mechanism so far. So for this, probably go along, you know, what I've learned through testing, right? Like stress testing these things that you can see over here what you see here is a lot of metal dust. Essentially there's a lot of brass powder, right? A close-up. There's a lot of material coming out from a lock after 36,000 iterations. This is not good. What we find, this is what I tore down the lock to find that, you know, essentially there's no grease in there. There's no grease in there. There's a lot of metal wear, right? And that kind of like backs up the theory why many of these locks were just kind of like designed to fail, right? You know, you probably have to replace them the sooner or later, like real quick. I think the earliest I saw was like two months, you know, two months to a year, you probably have to replace the lock or they are designed to be commodity disposable things which I think is kind of bad, right? But I realized, you do a head-on, I realized that these locks have not very good construction. Yeah, another wear over here, which is actually on the axle, connecting the hammer to the solenoid. I can see there's some metal wear over there. And no, it does feel kind of rough. After 36,000 iterations, you try to move it by hand and it can feel it's more rough than it was brand new. Yeah, this is like the part where the hammer is like pushing the latch up and down. And you can see there is material loss here as well. This is literally a dent in the, the bolt is actually steel, but having a steel hammer coming down against a steel bolt, you will still have metal fragments falling out of it. Yeah. So, you know, a link to anyone who is interested in reference design for opto-isolated GPIO circuit, you can just check out the big bucket over here as well as the Arduino code Python library. Yep. This is like the power site, some old photos. Does anyone have any questions? In terms of noise, you leave this for like, I don't know, two months, clack, clack, clack, clack, clack. So you actually put some card box around to isolate or is it, is not noisy, is it? I only ran it for like five days, so it's not bad. And also it's kind of like in the garage. So it's kind of isolated from where I am. Yeah. I like this instead of testing. Yeah, thank you. Yeah, when you start buying stuff from China and you realize that your parts fail in your projects, you're kind of more interested to actually want to find out why they fail. And, you know, now if I buy the same lock, I'll actually put grease in there before I use it.