Ladder Logic running on an Arduino UNO

Happy Canada Day!

Some of you may wonder if I’d fallen off the face of the Earth, but the truth is life just gets busy from time to time. Just for interest’s sake, here’s my latest fun project: an Arduino UNO running ladder logic!

Ladder Logic on a UNO

You may remember I wrote a ladder logic editor about 5 or so years ago called SoapBox Snap. It only had the ability to run the ladder logic in a “soft” runtime (on the PC itself). This is an upgrade for SoapBox Snap so that it can download the ladder logic to an Arduino and even do online debugging and force I/O:

Arduino UNO Ladder

I haven’t released the new version yet, but it’s very close (like a few days away probably).

Edit: I’ve now released it and here is a complete tutorial on programming an Arduino in Ladder Logic using SoapBox Snap.

14 thoughts on “Ladder Logic running on an Arduino UNO

  1. rafael

    Hello ! I wonder how I would command on / off
    in android , app inventor on how they would already have two logical one for screen and other to chart and I have more easy with ladder because we already work with instrumentation industrial.thanks up soon.

  2. Mild Lee Interested

    Thanks so much for this! I’ve been looking for an easy to use ladder IDE for Arduino for years!
    Looks like to took less time than expected, based on your 6/7/13 comment under “finally-getting-an-arduino”.
    Are you interested in feedback, or is your bug and request list already stretching off into infinity…

  3. Scott Whitlock Post author

    @MildLeeInterested – Development is stalled until I find some more time. I’m hoping to do another release sometime this winter, but the new features are pretty much set: I want to add analog PWM output capability, and support the Arduino Mega.

  4. Dani

    Hi Scott!

    Thank you very much for this piece of Software!!!
    My first impression is that it works OK in development and learning, I’m a student in automation and robotics, and i must for use limited PLCs in my school (one for eeach 8 person group) Now i’m probing exercises and ideas for my own with an inexpensive Arduino!

    Thanks again, and please write me if you need translation into Castilian or Catalan, would be happy to do them!

  5. dan

    just wondering if more complex programming, like moves,arrays etc can programmed with soapbox,and where would you get the instructions for these commands

  6. Scott Whitlock Post author

    @dan – You can use the Choose Number instruction to remember a number as state, which is equivalent to a MOVE instruction. There are currently no array, stack (LIFO) or queue (FIFO) instructions. That is something I might add in the future. For an array you could use a bunch of Choose Number instructions.

    The SoapBox Snap ladder language doesn’t include the idea of addresses or a memory map. That’s all handled internally (so when you drop a coil on the page, it internally allocates a bit to hold the state – you don’t have to manually assign a bit for it). It works this way for all instructions, so the idea of having an array is too “low level” for Snap. Instead I’d add a higher level instruction like a Queue, Stack or maybe even a List.

  7. Ron Kierstead

    I’m a mature student taking Industrial Electrical Technology at a local College here on Prince Edward Island, and as they don’t allow us to take the Allen-Bradley units home with us, I spend a fair bit of time playing with an Arduino, and SoapBox Snap just took it to a whole new level of ‘homework’.

    Thanks for your efforts!

    Cheers,

    Ron

  8. Adithya

    Hey I have a doubt. I have compiled and ran the firmware code given soapbox snap on arduino nano and, I started practicing PLC ladder programs on that. So, my doubt is that, can I use LCD display to show the value of counter on the LCD? Can the LCD be used even after the change in the firmware?

    Thank you.

  9. Jayson

    Hello I cant seem to get soapboxsnap running and I went to try the suggested fix but the file is unavailable, can you help?

  10. Steve. Ansuini

    I am interested in running ladder logic on an Arduino. The link above did not work. Is the software still available?

Leave a Reply

Your email address will not be published. Required fields are marked *

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