“Option IO” factory configures the WattNode® Modbus meter to use the spare X terminal (pin) on the “MODBUS” connector (upper left corner) for digital input or output (I/O). The C terminal provides the ground reference.
Option IO may be used for any of the following purposes, and others:
- Count pulses from another device: pulse output electric meter, water meter, gas meter, etc.
- Monitor a digital control line, like a load shed signal.
- Signal or control an external device.
- Send a load shed signal.
- Control an external relay.
Note: A separate Modbus master (data logger, energy management system, PC, etc.) is required to initiate the output operations.
When specifying “Option IO=m“, the m value is used to configure the IoPinMode (1623) register. You can also change the IoPinMode in the field. The m value or IoPinMode may be one of the following values:
- 0 – All input and output functions on the I/O X pin are disabled.
- 1 – The I/O X pin acts as a pulse counter and/or a general-purpose digital input. The pulse count increments on falling edges. PulseCount reports the 32-bit count. IoPinState reports the present input state.
- 2 – Same as mode 1 except PulseCount increments on rising edges.
Open-Drain Output Modes
The term “open-drain” refers to a type of output that drives the output line low, but lets it float for the high state. This allows multiple devices to connect to the same line – any of the devices can pull the line low since none of the devices actively drive the line high. The output pin includes a weak 10kΩ pull-up resistor to 5V. An external pull-up may also be used, but the pull-up voltage must not exceed 5V.
- 3 – The I/O X pin acts as an open-drain output. If power is lost and restored, the output is restored to the state (low or high) it was in before power was cycled. IoPinState controls the output logic state.
- 4 – Same as mode 3 except the output will always go low after power is cycled.
- 5 – Same as mode 3 except the output will always go high after power is cycled.
Push-Pull Output Modes
The term “push-pull” output refers to a type of output where the line is actively driven in both the high and low states. If two devices try to drive the same line, they may sometimes conflict. Push-pull provides a high output drive (up to 25 mA).
- 6 – The I/O X pin acts as a push-pull output. If power is lost and restored, the output is restored to the state (low or high) it was in before power was cycled. IoPinState controls the output logic state.
- 7 – Same as mode 6 except the output will always go low after power is cycled.
- 8 – Same as mode 6 except the output will always go high after power is cycled.
The following registers are associated with Option IO:
Reading IoPinState reads the immediate state of the X pin (high = 1, low = 0). If the pin is configured as an output, you will read back the output state: the last value written to IoPinState.
If the I/O X pin is configured as a push-pull output, writing 0 will drive the pin low (0V), writing 1 will drive the pin high (~5V). If the I/O X pin is configured as an open-drain output, writing 0 will drive the pin low (0V), writing 1 will let the terminal float. Depending on the external load, the 10kΩ pull-up resistor may pull the terminal up to 5V.
If a configuration passcode is set, it must be given before IoPinState may be written.
PulseCount (1362, 1363)
These two registers comprise a single 32-bit unsigned integer count, where register 1362 is the least significant part and 1363 is the most significant. Normally the PulseCount is read to determine the count of pulses received.
The PulseCount may also be written to zero (or another value) to reset the count.
There are some tricks to using the PulseCount:
- You could reset the value each time you read the count, but there is a risk of losing pulses that arrives between the read and the reset (writing 0) commands. Instead, a better approach is to just keep reading successive values and subtracting the old value from the new value, similar to the approach used when reading the electric meter on a house or business.
- If you use the full 32 bit count, rollovers will be very rare (maybe never), depending on the typical pulse frequency of the device you are monitoring. PulseCount rolls over from 232-1 = 4,294,967,295 to zero. Alternatively, you could use just the least significant register (1362), which rolls over from 65535 to 0. So long as you sample the value frequently enough that less than 65536 counts have occurred, you can correct for the rollover as follows:
- Compute the count difference as:
- If D is negative, then a rollover occurred between the old and new readings, so add 65536 to D to correct:
- Compute the count difference as:
If a configuration passcode is set, it must be written before PulseCount may be written.
This disables (mode 0) or configures the pin as an input (modes 1 or 2) or output (modes 3 to 8), as described above in the section I/O Configurations
If a configuration passcode is set, it must be written before IoPinMode may be written.
This register reads 1 if the WattNode was ordered with the “Option IO” feature, or 0 if not.
This shows the original factory configured IoPinMode (the m part of the “Option IO=m” order number), in case the mode was changed.
In all the IO modes, the X pin is connected to 5VDC CMOS logic circuitry. Therefore, negative voltages and voltages above 5V on the X pin may damage the WattNode meter. Even in the “open-drain” mode, the voltage must not exceed 5V. If higher external voltages must be switched or more than 25mA sink current is required, consider the Option SSR instead.
The X pin has an internal 10 kΩ pull-up resistor to the internal 5V supply. This serves two purposes: it allows the X pin to monitor or count pulses from a contact closure, dry contact, or opto-isolator output without the need for an external power supply. It also provides a positive bias voltage that pulls the line high if the X pin output is used in the open-drain mode, which floats the output for the high state.
ESD / EMI Precautions
The normal Modbus RS-485 lines are rated to handle 15kV of ESD (electrostatic discharge). Furthermore, the WattNode Modbus meter without Option IO has passed all FCC Class B and CE Mark EMC (electromagnetic compatibility) tests. However, the Option IO version has not been separately tested.
- The IO line X terminal (or pin) could conduct some radio frequency noise from the meter. We recommend keeping this line short if possible. You may also want to verify the FCC performance of the final configuration.
- The IO line X pin may be more susceptible to ESD and other forms of electromagnetic interference. Try to keep the line short and protect it from ESD and severe electric or magnetic fields. Use a shielded wire for longer lengths.
- Pull-up Resistor: 10 kΩ to 5VDC
When configured as a push-pull output, the nominal output voltages are 0V (low) and 5V (high), but the actual voltages may be different, depending on the loading.
- VOH = Output High Voltage (push-pull mode):
- VOH > 4.2 V when sourcing < 5 mA
- VOH > 3.8 V when sourcing < 10 mA
- VOH > 3.2 V when sourcing < 16 mA
- VOH (typ) = 4.9 V with no load
- VOL = Output Low Voltage (push-pull and open-drain modes):
- VOL < 0.2 V when sinking < 5 mA
- VOL < 0.4 V when sinking < 10 mA
- VOL < 0.6 V when sinking < 16 mA
- VOL (typ) = 0.0 V with no load
Note: In push-pull mode, the X pin can source or sink as much as 25mA but if 16mA is exceeded, the output voltage levels are no longer guaranteed.
Input and Pulse Counting
In order for the meter to detect a high pulse or high level, the voltage must exceed the Input High Voltage (Minimum). And for the meter to detect a low pulse or level, the voltage must drop below the Input Low Voltage (Maximum).
- Input High Voltage (Minimum): 3.5V
- Input Low Voltage (Maximum): 1.1V
The pulse counting feature has no lower limit on the pulse frequency: it could count one pulse per day or slower. The maximum frequency is limited to 100 Hz as documented below. The minimum high and low periods provide a debounce feature, so that contact bounce or noise will not be counted as extra pulses.
- Pulse Count Maximum Frequency: 100 Hz
- Pulse Count Minimum Low Period: 5 ms
- Pulse Count Minimum High Period: 5 ms