Skip to Content

PC IoT Command — Pulse Counters

The PC command configures high-speed pulse counters for IoT devices. It includes 2 counters (PC00-PC01) that count pulses on falling edge.


What is it for?

📏 Odometer — Counts speedometer pulses to calculate distance
Fuel flow — Integrates flow meter pulses
⚙️ Revolutions — Counts engine or shaft rotations
🔢 Scale factor — Converts pulses to real units (km, liters)


Description

PC counters use OW0 and OW1 ports to count high-speed falling edge pulses.

If a PC counter is enabled (factor > 0), it will occupy the OW port and will not allow temperature reading or OneWire devices.

IMPORTANT: The OW port is UNPROTECTED, @3.3VCC MAX. Do not exceed this voltage.


Syntax

OperationCommandDescription
QueryQPCaaRead value and parameters
FactorSPCaaKbb..bbConfigure scale factor
SetSPCaaScc..ccDefine counter value
ResetSPCaaRSet counter to zero

Response

RPCaa,dddddd.ddd,bbbbbb.bbb
FieldDescription
aaCounter index (00-01)
dddddd.dddCounter value (scaled)
bb..bbCurrent scale factor

Examples

Query initial value

>QPC00< >RPC00,000000.000,000000.000;ID=1234;*61< // Counter at 0, factor at 0 (disabled)

Configure scale factor to 1

>SPC00K1< >RPC00,000000.000,000001.000;ID=1234;*60< // Factor = 1.000 → each pulse = 1 unit

After 54 pulses

>QPC00< >RPC00,000054.000,000001.000;ID=1234;*61< // 54 pulses counted ✅

Change factor to 10 (multiplies the value)

>SPC00K10< >RPC00,000540.000,000010.000;ID=1234;*61< // Same number of pulses, now shows 540

Configure factor to 500 (for odometer)

>SPC00K500< >RPC00,027000.000,000500.000;ID=1234;*61< // Example: 54 pulses × 500 = 27000 meters

Reset counter to 0

>SPC00R< >RPC00,000000.000,000500.000;ID=1234;*64< // Counter reset, factor remains

Compatibility

💾Firmware:v1.05.02
DispositivoNotas
Spider IoT
1 PC port
Smart IoT
2 PC ports
Last updated