Objective. Students configure a PLC program that reads multiple sensor types simultaneously, applies scaling, triggers discrete outputs based on sensor thresholds, and displays real-time values with alarm annunciation on an HMI screen.
This lesson, its worked examples and its practice questions has not yet been verified by a licensed engineer or certified journey-level tradesperson or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.
VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.
A mechatronics system is only as useful as the information it delivers to operators and control logic. In this lab you will connect three common sensor types to a PLC, condition their signals, trigger an alarm output, and display live data on an HMI screen. This mirrors real packaging, marine, and manufacturing applications where a single PLC scan must handle discrete presence detection, analog process variables, and temperature feedback all at once.
Before wiring any sensor or module, follow lockout/tagout procedures under OSHA 29 CFR 1910.147. De-energize the panel, apply your personal lock, and verify the absence of voltage with a calibrated meter before touching terminals. Wear appropriate PPE — safety glasses and insulated gloves rated for the panel voltage. All wiring must comply with NFPA 79, the electrical standard for industrial machinery, which governs conductor sizing, color coding, and overcurrent protection inside control enclosures. Do not defeat or bypass machine guarding in accordance with OSHA 1910.212; keep fingers clear of mechanical actuators during the live test phase.
A proximity sensor produces a simple ON/OFF signal: the output transistor switches when a target enters its sensing range. Most industrial units are three-wire PNP or NPN devices wired to a discrete input (DI) module. In your PLC program, one rung using a normally open (NO) contact reads that input bit. When the target is present the bit is TRUE, energizing the rung output. Ladder diagram in IEC 61131-3 makes this straightforward: place the contact address on the left, a coil on the right.
The pressure transducer outputs a 4–20 mA current loop signal. The PLC analog input (AI) module converts that current to a raw integer — commonly 0–32,767 on a 16-bit unsigned module, or 4,096–20,480 on a 12-bit module scaled to engineering counts. You must convert that raw count to engineering units (for example, 0–150 psi) using a linear scaling formula:
EU = (Raw − Raw_min) / (Raw_max − Raw_min) × (EU_max − EU_min) + EU_min
Many PLC platforms provide a built-in SCALE or SCL instruction that performs this calculation automatically once you enter the raw and engineering limits. Verify the calibration with a 4–20 mA calibrator by injecting 4 mA (should read 0 psi), 12 mA (mid-scale), and 20 mA (full-scale). Accept readings within ±2% of the calibrator reference.
Once the scaled value is available, add a comparison instruction (Greater Than, GRT) that compares the live pressure tag to a setpoint value stored in a data register. When pressure exceeds the setpoint, the rung becomes TRUE and energizes a discrete alarm output coil.
A thermocouple transmitter converts the millivolt output of a thermocouple into a standard 4–20 mA signal representing a temperature range (for example, 0–500 °F). This allows it to enter the PLC on the same type of analog input module as the pressure transducer. Apply the same scaling formula, substituting the temperature range for EU_min and EU_max. The transmitter handles cold-junction compensation internally, so no additional correction is required in the PLC program for this lab.
Organize your program into clearly commented rungs:
1. Rung 1 — Proximity input: Contact reads the DI bit; coil writes to an internal status bit used downstream or on the HMI.
2. Rung 2 — Pressure scaling: SCALE instruction (or equivalent math block) converts raw AI counts to psi and writes to a floating-point or integer tag.
3. Rung 3 — Pressure alarm: GRT instruction compares the psi tag to the setpoint register; output energizes the physical alarm output and an HMI alarm bit.
4. Rung 4 — Temperature scaling: Second SCALE instruction converts the thermocouple transmitter counts to °F and writes to its tag.
Use descriptive tag names (PROX_PRESENT, PRESS_PSI, TEMP_DEGF, PRESS_ALARM_OUT) so anyone reading the program understands its purpose without comments — a professional habit valued in industry.
On the HMI screen, create the following elements and link each to the corresponding PLC tag:
Download the HMI project and confirm communication with the PLC before calling the instructor for the integrated test.
During the test, the instructor will vary inputs: insert and remove a target near the proximity sensor, adjust pressure with the calibrator, and simulate temperature changes. For each condition, compare the HMI display to the calibrator reading. Record any discrepancy — this is your punch list. A punch list is a professional document identifying items that do not yet meet specification, along with the corrective action taken. All three functions (discrete, analog pressure with alarm, temperature display) must work correctly to pass the lab.
Answer each question, then check it. Nothing is recorded; this is your own practice.
A free tech program — complimentary, as our commitment to get America working. Help us build VoTechWorks. Tell us what works, what doesn’t, and what you want to learn.
Does the school offer financial aid?
No. We don’t offer financial aid because we’re free. No, really: completely free.
Do you offer industry certification?
No. We are not certified yet, so we can’t offer that to students. What we do offer is knowledge and understanding of a trade.
Enroll first in the trade you’re interested in. You get your key, your program opens, and you begin studying.
Enroll free →