Giving An Industrial Push Button USB, Elegantly

[Glen]’s project sounds perfectly straightforward: have a big industrial-style push button act as a one-key USB keyboard. He could have hacked something together in any number of ways, but instead he decided to create a truly elegant solution. His custom PCB mates to the factory parts perfectly, and the USB cable between the button and the computer even fits through the button enclosure’s lead hole.

It turns out that industrial push buttons have standardized components which can be assembled in an almost LEGO-like manner, with components mixed and matched to provide different switch actions, light indicators, and things of that nature. [Glen] decided to leverage this feature to make his custom PCB (the same design used in his one-key keyboard project) fit just like a factory component. With a 3D printed adapter, the PCB locks in just like any other component, and even lines up with the lead hole in the button’s enclosure for easy connecting of the USB cable.

What does [Glen] use the big button for? Currently he has two applications: one provides a simple, one-button screen lock on a Linux box running a virtual machine at his place of work. It first disengages the keyboard capture of the virtual machine, then engages the screen lock on the host. The other inserts a poop emoji into Microsoft documents. Code and PCB design files for [Glen]’s small keyboards are available on GitHub.

37 thoughts on “Giving An Industrial Push Button USB, Elegantly

  1. his own bottom line:

    “An Important Safety Note
    As fun as this project may have been, please do NOT use USB for an actual safety-related emergency stop or emergency power off. USB is just not reliable enough for safety-related devices.”

    nothing to add here…

    1. I could not agree more. :-) Those big red buttons are expected to be effective at the most basic iso stack level of 0. Any higher and you are merely asking the computer to shut down. Sometimes you need to force the issue and that is what the big red button is all about. Such devices in this project would also distract form finding any actual switches that people would need to press. Similarly, imagine if it became stylish to decorate one’s walls with objects that merely look like fire extinguishers. (Yes, I know only certain kinds of minds can come up with such silliness, but it does demostrate the point. :-) )

  2. Glen Atkins has done a good job. But I think the switch could simply be wired to a convenient GPIO pin. This would require some software on the host using the switch, but would reduce the cost considerably. You already considered electrostatic discharge (ESD) protection, but not high voltage protection, since such a switch probably would go with many kiloWatts, if not megaWatts.

    The final words of the article are “USB is just not reliable enough for safety-related devices.” So wiring to GPIO would need to follow the recommended safety requirements, or provide an opportunity to establish new ones. I cannot read his mind, but perhaps Glen has some sense that the new generation of boards and convenient tools that HackaDay members use everyday, are not only suitable, but necessary as some of the older industries are linked into newer industries and systems.

    There is nothing wrong, and much right, about the safety switch. I do not see any way to mount it on a wall, nor on a control panel. I think it needs lights, in addition to a moderately bright color, but in a busy visual and probably noisy environment, you cannot be too sure.

    If the cost of this switch is high, and the repair costs include electronics experienced technicians, this might be a step backwards. It is certainly an elegant and professional looking board and assembly.

    Have you considered where it “might” be appropriate to use USB, wireless, GPIO, serial, ethernet, ultrasound, or other signaling protocols in industrial environments, where life and safety and money and equipment are at stake? If this is just an interesting way to wile away the hours? Or some kind of demonstration to younger generations what else is out there?

    Why is USB “not reliable enough”? Or is that simply wrongly remembered propaganda from competitors? Has USB been tested and found wanting? If so, this is engineering, and ANYTHING can be corrected, can’t it? So what would USB need to be acceptable? What of the other possible connection technologies and controls would be acceptable?

    It certainly gives clear instructions on the tools needed for this kind of project, so a “toy” problem has provided a condensed set of learning. I guess my conclusion is this is a good project, but I would rather have also learned about the safety protocols, systems and procedures that prevent its use in the “real world”. We are supposed to be having fun, but the ultimate goal is to re-engineer the world. Isn’t it?

    I like this, but I am trying to understand all the reasons it is somewhat dissatisfying. Maybe I just want to see it shut off a giant generator going out of control – saved by one man – at the last moment. All those switches need people.

    Thank you for an interesting hack. It makes me think of many other things that need change, or rethinking.

    Richard Collins, The Internet Foundation

    1. He just wanted a neat button on his desk. The USB thing is clearly just an arse-covering exercise. Don’t read so much into what is just a hack. A very neat and thought-through hack, but a hack all the same.

      1. Alphatek,

        I am very new here. So I really don’t understand anyone’s motivation. Do people just have a lot of time on their hands? There seems to be a strong stream of doing things that will potentially help others to learn. Just getting something 3D printed, or a PCB board built, or god forbid, I could get a cheap off the shelf working interferometer — all those things are hard, if you have never done them.

        I call those things that are like locks on a door, or passwords to login to somewhere, “magic words”. Until you know how something is spelled, you cannot even use a dictionary, you cannot even search. Without a few magic words, PCBs, 3D printing and interferometers are impossible, not just hard.

        Yes, I understood he has a fascination with buttons. But I am not sure if it reaches fetish. I was thinking that it is more likely he genuinely might think that such industrial tools and methods have a place in today’s changing world, but need to be adapted somehow.

        Is there any way to ask questions here? Or to ask for help? I could really use some help with getting some amplifier modules and ADC modules built. I need dozens of them, but I do not know where to start. I can go back and start googling “Gerber files” since a video mentioned them. I am so tired, but I promised myself I would try to at least document a few of the things I have learned about gravity in the last two years especially. It is frustrating to see so many possibilities, but not have the lab skills to build them. The simple message I have been trying to get out is that we are immersed in a chaotic gravitational potential field here at the earth’s surface, and most of the “kT” noise is connected with that. I am trying to sort the gravitational contributions from the natural and human electromagnetic, acoustic, radioactive, and other noise sources. I have been begging people for their noise records, and they don’t seem to understand how important it can be. Just trying to get people to stick a basic amplifier/ADC on their thermometer is worse than pulling teeth. I have spent 15 years working on it, so I am very comfortable with the gravitation potential, its changes and gradients. That any analog sensor, if you amplify its signal sufficiently, and records at high sampling rate will contain information on natural and manmade gravitational sources seems completely alien to people I guess. I don’t know how to build them, but I have used the data from the superconducting gravimeters and broadband seismometer for more than a decade, so I know it works, and how it works, and what would work better. If I could just find a few “magic words” to get started. :)

        Nice to meet you.

    2. I think you have completely misunderstood the goal of this project. It’s a button that you put on your desk and connect to your computer. When you press it, it executes some action on the computer.

      USB is the best, most convenient way of connecting a device to a computer, as most PCs don’t have accessible GPIOs. The cost of the device doesn’t matter since he’s not making it in volume. Reliability/safety doesn’t matter, because the device isn’t performing any kind of critical function.

        1. That is entirely my assumption.

          (There are plenty of industrial switches that don’t look like an estop… Although I can see how the “push to latch, twist to release” approach of most estops would be desirable for certain non-safety applications. I would never use an estop switch for any such application where I work due to the risk of confusing someone into thinking the switch actually stops something nearby)

          1. Good point. I’m in a cube two buildings and a floor away from anywhere with real e-stop switches. Still maybe a green or blue non-mushroom button would be more appropriate.

    3. I think you may be reading too much into this hack, from what i see it is a man who wants to integrate industrial controls into his computing environment. As such, USB makes the most ammount of sense as it is the most common method of connecting prepherial devices to computers (desktops and laptops dont tend to have GPIO pins).

      as for this:
      “Why is USB “not reliable enough”? Or is that simply wrongly remembered propaganda from competitors? Has USB been tested and found wanting? If so, this is engineering, and ANYTHING can be corrected, can’t it? So what would USB need to be acceptable? What of the other possible connection technologies and controls would be acceptable?”

      In industrial settings USB should never be used for emergency stop things. Emergency stops are generally hardwired to a power kill relay or something that stops the machine with out any extra processing. USB should never be used for safteyt situations as it requires processing, for health and saftey all emergency stops MUST be hardwired to some sort of shutoff that happens instantaneously (think discrete electronics), there is no engineering solution that will ever get USB to fufill that requirement and as such USB should never be used in emergency or saftey situations. The only approperiate solution for emergency or saftey situations is direct wiring so none of the other connection solutions you have suggested would work.

      Finally to answer this gem:
      ” this is engineering, and ANYTHING can be corrected,”
      USB does not need correcting as it is an approperiate tool to be used in the situations that the protocol was designed to be used, by trying to “fix” USB you are approaching the problem incorrectly as there is nothing to fix with USB. USB is already a fix to an existing problem (parallel busses) and in this case it is only used because there is a lack of GPIO on his desktop. In industrial settings, these switches are hardwired to reduce possible points of failure and will never have another protocol attached to them for their main function (i have seen other protocols attached for other reasons but the main function of the button is always hardwired).

      1. USB might be usable in safety related machinery. It needs a safety protocol, which there are, it might not be an issue that the physical layer is USB. Although getting it certified is an enormous project.

        I tried searching, but i guess nobody has done that work, because there are other ways to have a safe machinery and ethernet is better than USB for that sort of thing.

        “emergency stops MUST be hardwired” is not exactly true. You can wire the E-Stop into a remote safety I/O and have the safety protocol on industrial ethernet (or other accepted physical layer), which connects to a safety PLC, which controls outputs on another safety remote I/O.

        I would’ve bought different color button, they exist, but i don’t think it matters in this case really, since nobody would even know what that button would stop. Different situation if there were that sort of machinery around and it was attached to one.

        1. I might order a black mushroom actuator–they’re easy to enough to swap out. The mushroom shaped actuators in anything other than red opaque and amber transparent are tough to find in stock though.

          1. Yeah, those kinds of buttons are mostly used as E-Stop buttons, that’s why the yellow case and red button. Other colors as soft stops and perhaps other functions(although i can think of one right now), but seems like that sort of thing is not that usual.

            I really wouldn’t worry about it in your case, but if you do, then painting the top of the button is another option instead of buying a new button.

      2. This is exactly correct. There’s a lot of complex systems that *usually* work, but life safety systems like this are specifically made to deal with situations where something has unexpectedly broken. Simple is best, because you don’t want to have to try and guess all of the possible issues that might result in someone needing an emergency stop, and then trying to analyze how those might impact a complex system with many hardware and software layers. Mostly, because there’s no way to anticipate every possible issue.

        If you look at any life safety system where you actually have to use complex hardware and software they are very time consuming to develop, and usually have special styles and standards to meet. For instance, aircraft avionics.

        1. Seth,
          Now you have broadened the topic to “exceptional situation recording and emergency measures”, I guess you could simulate the system – in its social, economic, financial, legal, technical context — and then introduce monitoring systems that are triggered by an event. I do that sort of thing routinely, but it can be much simpler.

          His button is not the focus, but what he does, in addition to sending a “shut down” command, when it happens. That implies a framework in which a smart sensor and switch is exactly what you want — regardless of the channel and specific chips used. You give the “smart event logger and alert device” the responsibility, then trust it to do its job.

          AND, you keep records of EVERY such device so you can show its reliability and value in the actual situations.

          Which brings me to something – how does the smart device get its logic updates? If is a safety related, or control related device, you want rock solid methods for updating. The smart system monitoring flow and turbulence on the wing of an aircraft with hundreds of passengers aboard, probably doesn’t want to do updates in flight. Unless there is a critical notice and lives are at stake. I am tracking technologies for optimizing flight with smart sensors and adroit control systems. They are different in that the hardware investment is in many sensors and smart controllers and less in framework and large engines and fuel. Getting thousands of devices to coordinate is a developing art.

          And it seems to start with “When would you put a smart device in the loop where someone hits an emergency button?”

          [One of the odd things I have ever done was to vet the scenarios for the Joint Chiefs planning session for Y2K. That required thinking about EVERY smart system used in critical and noncritical situations on the planet, and judging the impact on safety and security of nations if they failed. Down to the chip level. So there are cases where it is necessary to consider revamping entire industries and methods. HackaDay has the technology in many cases. Where these smart devices are used in society is the question. I count all the hacks here as smart in some sense or other.]

          Richard Collins, The Internet Foundation

    4. >>Why is USB “not reliable enough”? Or is that simply wrongly remembered propaganda from competitors? Has USB been tested and found wanting?

      Yes. I would invite you to read ISO-13849 which is the standard for machine safety. USB definitely has no place there.


        “Users who would like to implement an openSAFETY-based safety solution with their existing data communication system must only ensure that the safety protocol is integrated on the Application Layer of their bus system.”

        So might be actually pretty-easy(tm) to do over USB. Same with other safety protocols like safety over Ethercat.

        Obviously making the actual safety devices that communicate over the openSAFETY over USB is going to be hell of a task and needs to follow safety standards and certification processes. If the USB communication trips a lot it’s going to be annoying as hell to actually run an operation on it, but it will fail in safe way.

  3. USB micro, ugh! Definitely not on the rugged and reliable side. Only because of the ever thinning of phones did this abomination show up, USB mini was alright but has faded away.

      1. Yes. One might think that micro is more fragile due to being smaller – but there’s a key difference in design. With USB-A and Mini-USB, the springs for the contacts are in the device connector. When they wear out, your device needs replacement or repair. Engineers where I work have worn out USB-A ports on their PCs…

        MicroUSB and USB-C connectors move the spring contacts to the cable. If they wear out, just replace the cable. Almost always MUCH cheaper.

  4. Um, I think you may have missed the point? This is a toy keyboard utilising a lovingly over-engineered solution in an an industrially ruggedised case. It’s not intended to be an actual industrial control.
    E-stops are generally hard-wired “dumb” circuits using more or less specialised equipment and circuit designs. The whole point is to make their stop function independent of the machine controller. There are newer systems that can operate over various types of networks, but these are generally highly engineered and certified by a third party.
    If somebody wanted to spend the time and money to develop, certify and carry the risk of an industrial safety system that utilises USB as it’s network infrastructure, sure why not? Not likely, though, given the alternatives already out there.

    1. You’re right it’s not useful as a way to shut off equipment, but it can be useful to detect that someone has pushed in that button and turned off the equipment.

      1. Julian,
        You hit it on the spot!! There is the internal record (perhaps) associated with the shutdown, but if the switch itself initiated an external record of the event (start recording, send shut down signal to appropriate devices, send alerts to critical logging systems normally idled, send alerts to humans, etc). It would be useful device. It it were done well and certified, then you would not have to put that kind of logic into the equipment itself, nor try to become and expert on the safety and monitoring every time you want to plug in a new industrial module or unit. The memory of the event by something outside what is being controlled could have huge financial and legal value. Interesting idea.

    2. >>If somebody wanted to spend the time and money to develop, certify and carry the risk of an industrial safety system that utilises USB as it’s network infrastructure, sure why not? Not likely, though, given the alternatives already out there.

      Yikes. There are actual standards that specify industrial safety. You can’t just slap something together. Read ISO-13849. You go to jail for violating this stuff in your designs.

  5. I pulled one of these out of the scrap bin the other week and wired it up as an e-stop for my 3d printer. It’s an NC type switch with ball detents in the button action so I wired it up to the GPIO of my raspi 3 which is powering my 3d printer with klipper and the octoprint-enclosure plugin.
    Hit the button and it will interrupt the signal and trigger the enclosure plugin to output the gcode M112 and halt everything in its tracks.
    The button was built originally as a mains voltage interrupting switch for industrial applications but I found wiring it up to my 3d printers power supply a bit overkill.

    I might also have it set up to trigger one of those Budweiser Red Goal Sirens … but that’s another story haha

    1. What happens when the enclosure can’t execute the M112? E-stop should STOP everything. You want it interrupting mains.

      Maybe introduce a second button, one being the soft e-stop that you have currently and one being a real e-stop.

  6. I built something similar. The “Button Of Doom” complete with a mushroom cloud printed on it, flashing lights, a countdown timer, and sound effects. Sends a Ctrl-Alt-Del.

    1. I have several of those switches,
      years ago I was going to build a game show buzzer (like the Jeopardy buttons) for a youth group, but never got around to it.
      I wanted switches that would stand up to some slamming.

  7. Modifying a Staples “That Was Easy!!” button would be even bigger and less controvercial. It would make a great here comes the boss button considering such Staples buttons are such a cliche that they hardly get noticed anymore anyway.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.