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
| Operation | Command | Description |
|---|---|---|
| Query | QPCaa | Read value and parameters |
| Factor | SPCaaKbb..bb | Configure scale factor |
| Set | SPCaaScc..cc | Define counter value |
| Reset | SPCaaR | Set counter to zero |
Response
RPCaa,dddddd.ddd,bbbbbb.bbb| Field | Description |
|---|---|
aa | Counter index (00-01) |
dddddd.ddd | Counter value (scaled) |
bb..bb | Current 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 unitAfter 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 540Configure factor to 500 (for odometer)
>SPC00K500<
>RPC00,027000.000,000500.000;ID=1234;*61<
// Example: 54 pulses × 500 = 27000 metersReset counter to 0
>SPC00R<
>RPC00,000000.000,000500.000;ID=1234;*64<
// Counter reset, factor remainsCompatibility
💾Firmware:v1.05.02
| Dispositivo | Notas |
|---|---|
Spider IoT | 1 PC port |
Smart IoT | 2 PC ports |
Last updated