ProtoVoltaics RTD Shield with RS232 and RS485 Transceivers Version 8
Thanks for taking a look at our shield! We value your feedback and contributions. Contact us at email@example.com if you find any errors.
This Arduino shield has multiple channels to read Resistance Temperature Detectors as well as transceivers to communicate with RS232 and RS485 devices. The Arduino communicates with the shield over the I2C (Wire) pins, so the RS232 (3-wire RS232) and RS485 transceivers don't connect to the Arduino's serial ports. The shield can also connect to the Arduino's D2, D3, D4, and D5 pins to alert the Arduino of various conditions such as new data from the shield's RS232 or RS485 ports or if an RTD reading meets some criteria.
RTDs have better linearity and accuracy compared to other temperature measurement technologies such as thermocouples. However RTDs are typically limited to measurements less than 600 degrees Celsius.
Changes in temperature cause a change the resistance of the RTD. The shield is actually just measuring the resistance on its terminals, so it's really just a very accurate ohm-meter. Since the temperature changes cause only slight changes in the sensor's resistance, very accurate measurements must be made.
The shield has a 12-pin screw terminal for connecting RTDs (or other resistance based sensors), a 3-pin terminal for RS232 communication, and a 2-pin terminal for RS485 communication. The RS232 and RS485 terminals are wired to transceivers that perform voltage level shifting for UARTs on a microcontroller that manages the shield. The RTD terminals are wired to a 24-bit analog-to-digital converter (ADC) which also provides excitation for the RTDs. A precision current source is used to excite the RTDs. The voltage across the RTD is then measured and the resistance is calculated based on the voltage and current values.
The shield can connect to seven two-wire RTDs, four three-wire RTDs, three four-wire RTDs, or certain combinations of various RTDs. The "or" in the previous sentence is an exclusive-or: meaning you can't connect seven two-wire RTDs, "and" four three-wire RTDs, "and" three four-wire RTDs. If a channel is used to connect to a three-wire RTD then the pins used for that channel cannot be used to connect to a two-wire or four-wire RTD.
The RTD channels are labeled in numeric order starting from the RS232 port down to the RS485 port. Meaning channel 1 is the closest to the RS232 port, channel 2 is next, and so on. The last channel is channel 7 for the two-wire ports, channel 4 for the three-wire ports, and channel 3 for the four-wire ports.
Directly behind the screw-terminals for the RTDs on the shield is the labeling diagram for making two-wire connections. Two-wire RTDs have two wires. One wire must go into a numbered terminal, which are labeled 1 through 7. The other wire must go into a terminal labeled 'C'. The 'C' stands for "common". It doesn't matter which 'C' pin is used and a 'C' pin can be used to connect to more than one two-wire RTD. The RTD is not polarized, so either wire can go in the numbered terminal and either wire can go in the 'C' terminal.
If two-wire RTDs are used, the jumper terminal labeled "2W" must have a jumper installed on it.
If two-wire RTDs are used, then the pin labeled '7' can only be used for two-wire RTDs. You cannot use the pin labeled '7' for three-wire or four-wire RTDs when a jumper is installed in the jumper terminal labeled "2W".
Three-wire RTDs have three wires, obviously. Two of the wires are connected together at the tip of the sensor. If you measure the resistance with an ohm-meter you will see zero or almost zero. The two wires that have nearly zero resistance go into the terminals labeled '-'. The other wire, which will have a measurable resistance much larger than zero (it depends on the RTD type, but 110 ohms or 1100 ohms are typical values), should go into the terminal labeled '+'.
If three-wire channel 4 is going to be used to measure a three-wire RTD then the jumper terminal labeled 'LAST RTD PIN' must have a jumper installed between the middle pin and the pin labeled '3W'.
Four-wire RTDs are the most accurate type of RTDs. Two wires are connected to each side of the RTD element at the tip of the sensor. The wires in a pair will have zero or nearly zero resistance between them. One of the pairs gets installed in the terminals labeled '+' and the other pair gets installed in the terminals labeled '-'.
If four-wire channel 3 is going to be used to measure a four-wire RTD then the jumper terminal labeled 'LAST RTD PIN' must have a jumper installed between the middle pin and the pin labeled '4W'.
The general process for reading a temperature measurement is the following:
Since the shield is really just a precision ohmmeter, the performance of the shield can be verified by connecting a precision resistor of known accuracy to the shield and taking multiple readings. The factors that will impact the quality of your measurements the most are the speed ( PV_RTD_RS232_RS485::Set_RTD_SPS() ), gain ( PV_RTD_RS232_RS485::Set_RTD_PGA() ), and drive current ( PV_RTD_RS232_RS485::Set_RTD_Idac() ) settings. The graph below shows how the speed settings impacts readings.
As you can see slower speeds provide less variation when the input is fixed. However, at a speed of 5 samples-per-second the shield only updates the temperature measurement about once every 6.6 seconds. The 6.6 second time is due to the speed setting, time for internal calibration, and sampling of multiple readings done internally by the shield.
The settings for PGA and Idac depend on the maximum temperature you need to measure and the type of sensor you are using. Our team can provide you with these values based on your application.
The following graph shows a histogram of readings made a precision 100 ohm resistor using a four-wire connection. Typical Pt100 RTDs have a resistance of 100 ohms at 0 degrees Celsius.
The graph above gives an indication of how repeatable the shield is. The spread between the maximum and minimum reading for this test was 0.007675 ohms, which corresponds to 0.020 degrees Celsius or 0.035 degrees Fahrenheit. This data was collected at 160 samples-per-second.
The following graph shows histogram data for a fixed resistor connected in a 3-wire configuration: a jumper wire connected between the two "-" terminals.
This time the spread between minimum and maximum readings was 0.00975 ohms, 0.025 degrees Celsius, or 0.045 degrees Fahrenheit. This data was collected at 160 samples-per-second.
A two-wire connection is almost never used. This is because the two-wire connection has no compensation for wire length, which will have a dramatic impact on measured values. Do not use two-wire RTDs unless you are an expert.
This time the spread between minimum and maximum readings was 0.007531 ohms, 0.019 degrees Celsius, or 0.035 degrees Fahrenheit. The results demonstrate good repeatability, but the accuracy of the measurements will decrease with every millimeter of distance from the shield's screw terminals to the active part of the RTD sensor. This data was collected at 160 samples-per-second.
The maximum measurable resistance value is controlled by the programmable gain amplifier (PGA), which is controlled with the PV_RTD_RS232_RS485::Set_RTD_PGA() method. Using a larger gain gives better resolution but reduces the maximum measurable resistance, which reduces the maximum measurable temperature. Lower gain values reduce the resolution in the readings, but allow larger resistances to be measured.
For version 1 of the shield (that is for shield's with a date stamp prior to "2-MAY-2014") a gain of 1 will allow resistances up to 833 ohms to be measured for two-wire and four-wire RTDs and up to 1666 ohms for three-wire RTDs. As the gain is doubled, the maximum measurable resistance is cut in half. The maximum gain of 128 allows readings up to 6.5078125 ohms to be made for two-wire and four-wire RTDs and up to 13.015625 ohms for three-wire RTDs.
For version 2 of the shield (that is for shield's with a date stamp of "2-MAY-2014" and after) a gain of 1 will allow resistance up to 4300 ohms to be measured for two-wire and four-wire RTDs and up to 8600 ohms for three-wire RTDs. As the gain is doubled, the maximum measurable resistance is cut in half. The maximum gain of 128 allows readings up to 33.59375 ohms to be made for two-wire and four-wire RTDs and up to 67.1875 ohms for three-wire RTDs.
The factory reset value for the PGA is 1 for version 2 of the shield. This means that you can measure the full range for Pt-100 and Pt-1000 RTDs without having to make any changes. You may want to change the PGA value to increase your temperature resolution if you will not need to take measurements across the entire temperature range of your sensor. See the details in the description for PV_RTD_RS232_RS485::Set_RTD_PGA().
Communication between the Arduino and the shield takes place over the I2C pins. The software provided with the shield performs the necessary communication operations, so most users won't need to know about or care how this communication occurs at the low level. For those who are interested, the source code is available to see how this communication is used to control the shield. The registers are enumerated in the PV_RTD_RS232_RS485_Memory_Map.h file if low-level communication is needed.
Solder pads on the top of the shield are used to set the I2C address of the shield. The default value is 82. The only reason you might want to change this is because you need to use multiple RTD shields or if you have another I2C device using address 82. You will have to cut the gold line connecting the center pad before adding a solder jumper to connect it to the other pad.
The shield has two pull up resistors for the I2C bus. These are 10 kilo-ohm resistors. To disable the pull-ups the solder jumper pads on the top of the shield can be removed with solder wick. The I2C pull up pads are under the pads for setting the I2C address. They are labeled "I2C PU". The pin next to the 'D' is connected to SDA and the pin next to the 'C' is connected to SCL.
Older Arduino Unos that do not conform to the Arduino R3 specification have their I2C pins in a different location. To enable the shield to communicate to those pins a solder jumper must be installed on the solder jumper ports labeled "UNO SDA" and "UNO SCL"
The RS232 screw terminal exposes pins for connecting the Tx (transmit), Rx (receive), and GND (ground) lines. No provision is included for connecting other RS232 control signals such as CTS or RTS. The pins are also labeled for connecting to DB9 connectors: Tx on DB9 pin 2, Tx on DB9 pin 3, and GND on DB9 pin 5.
Data can be written to the shield's RS232 port with Arduino's print() and println() functions if configured. Configuration is done by calling the PV_RTD_RS232_RS485::Connect_Print_To() function.
The RS485 screw terminal exposes pins for connecting the A and B lines to an RS485 network. The shield has a 120 ohm termination resistor installed between the A and B terminals. Different hardware will define ports A and B differently. If communication is not working properly, often it is useful to try reversing the pins to see if this solves the problem. Refer to the transceiver's datasheet if necessary. Transceivers from Texas Instruments and Maxim are typically used.
Data can be written to the shield's RS485 port with Arduino's print() and println() functions if configured. Configuration is done by calling the PV_RTD_RS232_RS485::Connect_Print_To() function.
The shield has jumpers to connect to pins D2, D3, D4, and D5 on the Arduino. When the jumpers are installed the shield can signal the Arduino when certain events occur. For example, the shield can send an alert when new data arrives on the RS232 port, or on the RS485 port, or when RTD data matches a given criteria.
The shield has a basic microcontroller to perform the functions of the shield. Having a separate microcontroller frees up the Arduino's processor for other tasks.
Non-volatile EEPROM memory is used on the microcontroller to store all static variables. This means when the shield is powered off and then powered on the shield will go back to processing the same RTD channels and using the same alert configuration that was being used before the power was turned off.
Dynamic variables, such as the last RTD measurements, RS232 buffers, RS485 buffers, and internal ADC registers are not stored in EEPROM and will be erased when the power is turned off. The variables that are retained in non-volatile EEPROM are those with addresses below FIRST_RAM_REGISTER in PV_RTD_RS232_RS485_Memory_Map.h
The shield's microcontroller has an ICSP port on the top of the shield. A Microchip programmer, such as the PICkit3 is needed to program the flash memory on the microcontroller. The firmware on the shield's microcontroller cannot be updated directly from the Arduino at this point in time.