Skip to content
Feb 2 / Greg

Monitor Tape Drives With PLC And IR

We have tape rotation services for many customers here at the datacenter. One of them does tape rotation of a specific job that only two people can verify. These jobs happen to run over night which means these guys can’t verify when we need to swap the tapes. If you don’t change the tape out quick enough the job fails, which means we have to check the tape roughly every 30 minutes all night long. That’s just madness!

This is where my newly acquired NANO-10 PLC comes in (Thanks John ;))

Nano features:

  • Built-in Ethernet port – Support MODBUS/TCP
  • Programmable via Internet
  • 4 inputs (24V NPN), 4 outputs (4A @24VDC)
  • 2 analog inputs (12-bit, 0-5V)
  • 1 RS485 Port – support Modbus RTU and ASCII
  • 4 Pulse Measurement, 2 Encoders, 2 PWM outputs
  • 1 channel Stepper Motor Controller
  • Very Fast 32-bit CPU
  • Built-in web server(controllable via browser)
  • Basic scripting engine built in. (this allows for math as well as advanced functions like email sending.)
  • I plan on taking at length about the Nano at some point, so I don’t know that I will spend too much time on it here.

    I matched this with a few products:

  • Nano-10 PLC ($120)
  • Project box from Ratshack
  • Momentary switch
  • Red LED – with limiting resistor
  • About 5 foot of cat5
  • RJ45 Jack
  • 24V PoE injector
  • INFRARED SENSOR, 3-80cm adjustable range ($10.95)
  • I mounted the LED, momentary switch, RJ45 Jack, and the PLC inside the project box:

    Inside the box I: wired input one to the switch, output two to the LED, and broke out the power that was injected into the Ethernet cable and connected it to the PLC.

    I then reused the aluminum bracket that was included with the project box to make a bracket for the IR sensor:

    Send/receive all in one unit.

    Screw on the back adjusts the power of the IR emitter. The little bump on the back is an LED that indicates when an object is detected...this is extremely helpful while tuning the sensor.

    The sensor has 3 wires: 5V+, ground, and data. When the sensor detects an object the data pin syncs to ground so your input will go high. When it doesn’t detect it puts the data high. I wired this guy to input four.

    Since we are using this to monitor tapes, I mounted it inline with the tapes so I can detect when either tape is ejected:

    An amazing feature of the Nano is the ability to send email directly from the PLC!!!! What happens is when the sensor detects an object it sends input four high. This starts a timer. If the input stays high for 1.5 minutes then an email is generated and sent. After this an internal output is latched. This latched output prevents the email from sending any more…otherwise an email would be sent several times a second until the sensor is cleared.

    I have another timer that resets the email output after 15 minutes, which means that every 15 minutes an email will be generated until the sensor is cleared.
    You will also remember the momentary switch that is installed in the enclosure. This enables a 15 minute sleep mode so you can change tapes without setting the email alert off.

    I also adjusted the ladder logic so that it updates a webpage on the internal web server so that you can login and see the status of the tape.

    These little PLCs are amazing and the IR sensor works a treat. Any questions or comments, please drop me a comment below.


    leave a comment
    1. Tim Payne / Feb 2 2012

      Now all you need is to rig one up in the privy, to alert you that the toilet paper roll needs replacing. 🙂 🙂 🙂

    2. Omega-00 / Feb 2 2012

      Hahah that’s a mad and awesome hack 🙂

    3. Greg / Feb 2 2012

      You could probably use a light sensor. The white of the toilet paper would reflect quite nicely. When the roll hit the brown center it would drop the light return and should be pretty easy to sense. 😛

      Today, all you hear is Arduino this and Arduino that. PLCs have been controlling the world before I was born! They have so much power and functionality already built in…just waiting for you to take advantage of it. If you want an Arduino to be networked and have the modbus functionality you would pay more than you would for this humble Nano-10!

    4. J.J. Boyd / Feb 3 2012

      Where is the photo inside the box? ;D Nice work! I Like it!

    5. Greg / Feb 3 2012

      Ha…I virtually put this all together in one night, so by the time I had my camera it was already in production. I didn’t want to go futzing with it…that or I’m too lazy to unscrew the cover…you decide which…hehehe

    6. iam8up / Feb 4 2012

      What’s wrong with notification when the job is done and the command to pop out the tape is executed?

      The box is amazingly cool, for sure =)

    7. Greg / Feb 4 2012

      We don’t have access to the server. We just change tapes when we are told. From what I understand the “systems aren’t capable of notifying us.” hehehe

    8. Jimmy / Feb 6 2012

      Why not just hire Lance?

    9. Greg / Feb 6 2012

      If we hire lance, then what do they need me for?

    10. Justin M / Feb 6 2012

      What about a webcam like air vision. Motion detect the tape poping out and send an email. You could also just watch from the computer. NOT AS COOL THO.

    11. Greg / Feb 6 2012

      Cam would work, though we would most likely have to remove the rack door and mount it across the aisle…plus we would get false positives from foot traffic. We also turn the lights off at night in some areas…

    12. meClaudius / Feb 17 2012

      Very clever. Actually thinking of adopting the PLC to email me of temperature alerts. A complete (quality) solution looks to be about $300 US. The PLC is $120 so I will have to look at the trade off. Thanks

    13. John / Feb 27 2012

      Cool VERY Cool, glad to see the Nano worked…. Also may I add, add a little CT the inline power so if the tape gets jammed or stuck you can monitor the amperage on the drive….. see the little CTs at
      the webstore will be up soon….

    14. Greg / Feb 27 2012

      I approve this shameless self promotion…hehe

    15. Allen / Nov 2 2012

      Hi Greg,

      Allen from Triangle Research here. Love what you have done with our Nano-10. Keep up the good work!

    16. Greg / Nov 2 2012

      Thanks 🙂 I love the little guys. I just did another install and it is monitoring an HVAC system in a 70 year old building. I have 3 CTs and two temp probes. It sends emails when things aren’t running correctly. It actually caught a failure within a week of being deployed and paid for itself in that one incident!

      If you guys wanted to send me some “review” samples I would be happy to do a few more write ups…hehe

    Leave a Comment