Tuesday, September 22, 2020

PLC A/D converter read ladder diagram instruction

In a digital control system, it usually require an analog input. The analog input, created by any external sensors - an analog temperature sensor, an NTC/PTC or an LDR. These devices create output an analog voltage corresponding to its measuring quantity.
Analog Output Sensors

To read the value from these sensor, the PLC need to command to its analog reading instruction. The A/D converter read instruction is a unique ladder diagram instruction that accomplish the analog input reading using only PLC cycle time.

A/D Converter Read Instruction Symbol

It's configured as follow.

A/D converter Read instruction property

Without any optional settings, the A/D uses a single-end reading mode. The references voltage is internally wired to GND and VDD of the target MCU - for example PIC16F876. For other MCU such as AVR, it's convenient to check the device datasheet and the user's manual of this ladder diagram IDE.

PIC16F876 comes with a 10-bit A/D converter module. It gives a 10-bit resolutions, creates a digital value of 1024 (0 to 1023).

An introductory example show how to use this instruction to read an analog input fed to RA0. The PLC convert the analog input value to digital value before it sends to the host PC via UART terminal. This task is accomplished using a rung of ladder diagram instructions. This rung is activated for every 400 mS, powered by a cyclic on/off timer instruction.



PLC A/D converter read ladder diagram instruction
A/D converter read ladder diagram example

The selected processor of this PLC is PIC16F876, clocks to maximum frequency at 20 MHz. The PLC UART baud rate is 9600 by default due a minimum system requirements.



PLC A/D converter read ladder diagram instruction
Schematic Diagram

Click here to download the zip file of this ladder diagram example.


No comments:

Post a Comment

Labels

ADC (10) Analog (14) Arduino (12) Atmega16 (19) Audio (2) AVR (20) Charger (1) Cortex-M0 (1) Counter (10) CPLD (25) Digital I/O (22) Display (34) EEPROM (2) Environment Sensor (1) esp8266 (2) Experiment Board (10) I2C (4) Interrupt (7) LCD (1) LDmicro (29) measurement and instrumentation (7) Microchip Studio (3) MikroC (1) One-Shot (3) OpAmp (1) PCB (31) PIC16 Microcontrollers (16) PIC16F877A (2) PIC16F887 MikroC (22) PLC (35) PWM (11) Regulator (1) RTC (2) Sensor (8) Shift Registers (5) SPI (5) Timer (34) UART (2) ultra-sonic sensor (1) USB (1) VHDL (21) xc8 (1) XC95108 (9) XC9536 (15) XC9572 (1) Xilinx (23) Xilinx ISE (22)