Humble Arduino As PLC

On the surface, a programmable logic controller (PLC) might seem like nothing more than a generic microcontroller, perhaps outfitted to operate in industrial settings with things like high temperatures or harsh vibrations. While this is true to some extent, PLCs also have an international standard for their architecture and programming languages. This standard is maintained by the International Electrotechnical Commission, making it so that any device built under these specifications will be recognizable to control engineers and maintenance personnel worldwide. And, if you use this standard when working with certain Arduinos, this common platform can become a standard-compliant PLC as well.

The IDE itself supports programming ladder diagrams, functional block diagrams, and other programming systems covered under the IEC 61131-3 standard. Not only that, it allows the combination of these types of PLC programming with Arduino sketches. The system offers many of the perks of PLC programming alongside the familiar Arduino platform, and supports a number of protocols as well including CANOpen, Modbus RTU, and Modbus TCP. It can also be used for monitoring a PLC system, essentially adding IoT capabilities to existing systems, enabling continuous monitoring, debugging, and program updates.

While not every Arduino is a great platform to build a PLC around, there are a few available for those looking for a system a little less proprietary and a little more user-friendly than typical PLC systems tend to be. There’s a reason that PLCs are built around an international standard and generally have certain hardware in mind to run it, though, and this comparison of a Raspberry Pi with an off-the-shelf PLC goes into detail about why certain components aren’t good choices for PLCs.

Reverse-Engineering An Elevator Control Panel Results In Clicky Goodness

We have to admit that in the hardware hacking universe, there aren’t generally too many chances to hack elevators. Well, at least not opportunities that don’t also include the risk of incarceration. But fortune favors the bold, and when he found the remains of an elevator control panel in an abandoned Croatian resort hotel, [Davor Cihlar] undertook an extensive and instructive reverse-engineering of the panel.

The video below highlights his efforts, which were considerable given the age and state of the panel. This is a relay-only control panel, after all, with most of the relays missing and a rat’s nest of wires connecting the sockets. So [Davor] put his “RevIng” concept to work. This uses a custom PCB with a microcontroller on-board that plugs into each relay socket and probes the connections between it and every other socket. Very clever stuff, and it presented him with the data needed to develop a ladder-logic diagram of the board, with the help of some custom software.

With the original logic in hand, [Davor] set about building a simulator for the panel. It’s a lovely piece of work, with buttons and lights to mimic the control panel inside the elevator car, as well as the call stations that would have graced each lobby of the hotel. Interestingly, he found logic that prevented the elevator from being called to some floors from anywhere but inside the car. The reason remains a mystery, but we suppose that a hotel built by Penthouse publisher [Bob Guccione] would have plenty of secrets.

We love the supremely satisfying clickiness of this build, and the reverse engineering prowess on display, but we can’t find much practical use for something like this. Then again, DIY elevators are a thing.

Continue reading “Reverse-Engineering An Elevator Control Panel Results In Clicky Goodness”

PLCs In Your Browser

If your usual tools are the Arduino and the Raspberry Pi, you might find it surprising that the industrial world tends to run on Programmable Logic Controllers, or PLCs. You can think of a PLC as a very rugged industrial Arduino, but it’s best not to take that analogy too far. Some PLCs are very simple and some are quite complex, but one thing they do have in common is they are usually programmed using ladder logic. If you’ve ever wanted to learn how to program PLCs — a very marketable job skills in some places — you can now build and simulate ladder logic in your browser. [Garry Shortt] has a video walkthrough of the tool, that you can see below.

If you are used to conventional programming, you may find ladder logic a little frustrating. Originally, it was a documentation tool for relay logic but has grown to handle modern cases. It may actually help you to not think of it so much as a programming language, instead as a tool for drawing relay schematics. Contacts can be normally open or closed and in series or parallel to form AND and OR gates, for example, while coils can activate contacts.

Continue reading “PLCs In Your Browser”

PLC And Linear Actuators Automate Double-Hung Windows

Very few residential architectural elements lend themselves to automation, with doors and windows being particularly thorny problems. You can buy powered doors and windows, true, but you’ll pay a pretty penny and have to go through an expensive remodeling project to install them. Solving this problem is why this double-hung window automation project caught our eye.

Another reason we took an interest in this project is that [deeewhite] chose to use a PLC to control his windows. We don’t see much love for industrial automation controllers around here, what with the space awash in cheap and easy to use microcontrollers. They have their place, though, and a project like this is a good application for a PLC. But the controller doesn’t matter at all if you can’t move the window, for which task [deeewhite] chose 12V linear actuators. The fact that the actuators are mounted in the center of the window is probably necessary given the tendency of sashes to rack in their frames and jam; unfortunately, this makes for a somewhat unsightly presentation. [deeewhite] also provides the ladder logic for his PLC and discusses how he interfaces his system with Alexa, a WeMo and IFTT.

We’d love to see this project carried forward a bit with actuators hidden under the window trim, or a rack and pinion system built into the window tracks themselves. This is a pretty good start and should inspire work on other styles of windows. While you’re at it, don’t forget to automate the window blinds.

[via r/DIY]

Reading Smart Cards From A PLC (with A Little Arduino Help)

If you’ve spent any time on a factory or plant floor, it is a good bet you’ve run into PLCs (Programmable Logic Controllers). These are rugged computers that do simple control and monitoring functions, usually using ladder logic to set their programs. [plc4u] wanted to connect a smart card reader to an Allen Bradley PLC, so he turned to an Arduino to act as a go-between.

The Arduino talks to a USB card reader using a USB host shield. Then it communicates with the PLC using an RS232 link and the DF1 protocol that most Allen Bradley PLCs understand. You may not need a smart card, but once you know how to communicate between an Arduino and the PLC, you could do many different projects that leverage other I/O devices and code available on the Arduino and connects to existing PLC installations. Just remember that you’ll probably need to ruggedize the Arduino a bit to survive and be safe to the same level as a PLC (which might include a NEMA enclosure or even an explosion-proof box).

Continue reading “Reading Smart Cards From A PLC (with A Little Arduino Help)”

Custom PLCs For Automation Industries

For many years, factories have used PLCs for automated control over industrial equipment. These systems are usually expensive, proprietary, and generally incapable of being reprogrammed. [Oliver], an engineering student in Ireland created a system for factories to develop their own application-specific PLCs as a final project for Automation Engineering.

In-house PLC creation has many benefits for manufacturers, not the least of which is the opportunity for customization. Making your own PLCs also means no licensing fees and total control over equipment automation. This system is a complete setup including an HMI interface with touchscreen input and a SCADA system for remotely controlling various pieces equipment of equipment from a laptop.

[Oliver] built a metal frame out of industrial-grade strut channel to house an XP machine, two monitors, and the beautifully breadboarded PLC design station. It’s based around a PIC16F887 and includes rugged features expected of a system that never goes into sleep mode, like eight channels of opto-isolation. [Oliver] also developed an environment for engineers to easily program their custom PLCs through a simple HMI interface and ladder logic.

Building An Industrial Control Unit With An Industrial Control Unit

Back in the 70s, industrial control was done with either relays and ladder logic or new programmable logic controllers. These devices turned switches on and off, moved stuff around a factory, and kept the entire operation running smoothly. In the late 70s, Motorola came out with an Industrial Control Unit stuffed into a tiny chip. The chip – the MC14500 – fascinated [Nicola]. He finally got around to building an ICU out of this chip, and although this was the standard way of doing things 30 years ago, it’s still an interesting build.

[Nicola]’s ICU is extremely simple, just eight relays, eight inputs, the MC14500, a clock, and some ROM. After wiring up the circuit, [Nicola] wrote a compiler, although this chip is so simple manually writing opcodes to a ROM wouldn’t be out of the question.

To demonstrate his ICU, [Nicola] connected up an on/off switch, a start button, and a stop button. The outputs are a yellow, green, and red lamp. It’s a simple task for even a relay-based control scheme, but [Nicola]’s board does everything without a hitch.

If you’re looking for something a little more complex, we saw the MC14500 being used as an almost-CPU last year.

Video below.

Continue reading “Building An Industrial Control Unit With An Industrial Control Unit”