Search My Blog

Wednesday, May 4, 2011

PLC [Hardware Project] - QEEWiki

PLC [Hardware Project]


    I spent years in industrial plants working with PLCs.  They are great, off the shelf, upgradeable and best of all they use LADDER LOGIC.  I love them.  So one day I decided to build one.

    Now, this is just a hardware project so the code example will be very simple.


    So one day I realized that I used PLCs all the time at work BUT I never actually looked at the inner guts of the things.  

    So I decided to sit down and build a little PLC of my own.  At the time I had very little experience building PCBs (since industrial Electrical Engineers tend not to do circuit board design).   So I started designing the board in my good old trusty AutoCAD.  This proved to be a HUGE pain the <<insert whatever word you want here>>.  So I hit the net did a bit of research and discovered EagleCAD.  After fighting with Eagle for a few weeks I eventually got use to it and I designed a decent little board.  So now I encountered my next problem.  

    My Electrical Engineering program had an Automated Systems Technologies (ie. Industrial Automation) specialty and like all Industrial Electrical Engineers I had never build my own circuit board.  So once again Google to the rescue.  I did some digging and found out about the different methods of building PCBs and eventually found the Toner Transfer Method (my tutorial coming ... well eventually).  I did manage to find a PCB etching kit at my local Radio Shack however, it did not have enough material in order to create the board I needed and, the FeCL proved to be a pain in the ass.  So I started looking for alternatives and I found CCiAHAS.  Dispute being honorables at chemistry making some CCiAHAS up was really easy.  I was able to get all the materials (pool acid and Hydrogen Peroxide) and managed to whip the stuff up at home. WOOT.  And it worked great.

    I got some drill bits from Drill Bit City and started drilling....drilling.... more drilling.   And a little over a hundred holes later I started soldering.   So now I know why people use surface mounted components over through hole components.

    Once all of my drilling was done, I taped up the headers and terminal blocks and sprayed the top and the bottom of the board with clear  top coat to keep things from oxidizing.  The pros use "Conformal Coating" but the stuff proved to be much more expansive.

Skippin on down...


    Last year, I wired my X-mass lights to the PLC.  Extension cords were on sale so I purchased 7 of them, and wired them into a waterproof electrical enclosure.  I then built a small adapter board that let me communicate with the PLC via Xbee. (no going outside to turn on X-MASS lights for me).

    I then wrote a small program that would read the 1-6 key on my keyboard.  Every time I hit the key it would switch the output state.  This was great till I started playing a video game.  Which caused my lights go crazy.

    Since I was going away for a few weeks over the holidays I hacked an Xbee into my old Linksys router and then was able to communicate with the PLC via internet ... which I rarely ended up using because being back home meant drinking with old friends, Hence forgetting to turn on the lights.

Picture 6: X-mass lights Example - Enclosure 1

Picture 7: X-mass lights Example - Enclosure 2



PLC Hardware Project
Build your own Programmable Logic Controller - Hack a Day
PLC [Hardware Project] - QEEWiki

No comments: