protocol - smouldery/shock-collar-control GitHub Wiki

BASIC STRUCTURE

_ONE WAY transmission - collar is RECEIVER only. _ Consists of a string of 42 binary bits, with the first bit being a special length (unclear if this is required) zero:

  • transmit for 220 uS
  • wait for 820 uS

one:

  • transmit for 740 uS
  • wait for 300 uS

(both zero and one have a sum of 1040 uS)

'S' (special starting 'one' bit)

  • transmit for 1540 uS
  • wait for 800 uS

these three elements are assembled into a string of 42 bits

Note - these timings are based on code not measurement of signals. they are likely mostly accurate but don't rely on them if it's critical

Sequence

<opening bits (2 bits)> <mode(4 bits)> <channel(3 bits)> <remote ID (17 bits)> <power level (7 bit binary encoding of number)> <Inverse mode (4 bits)> <inverse channel (3 bits)> <closing bits(2 bits)>

opening bits

Length: 2 bits changes?: NO sequence: S1 (special starting bit, one bit)

mode

length: 4 bits changes: YES sequence: for 'flash' mode, 1000 for 'beep' mode, 0100 for 'vibrate' mode, 0010 for 'shock' mode, 0001

channel

length: 3 bits changes: YES sequence: for channel 1, 000 for channel 2, 111

remote ID

length: 17 bits changes: NO (unique to remote) sequence: 17 bits, seems to be random based on remote? for example 00101100101001010

power level

length: 7 bits changes: YES sequence: decimal integer between 0 and 100 encoded in a 7 bit binary number binary space would allow for 127 to be encoded but unclear what will occur when numbers above 100 given.

inverse mode

length: 4 bits changes: YES sequence: for 'flash' mode, 1110 for 'beep' mode, 1101 for 'vibrate' mode, 1011 for 'shock' mode, 0111

inverse channel

length: 3 bits changes: YES sequence: for channel 1, 111 for channel 2, 000

closing bits

length: 2 bits changes: NO sequence: 00

Time

Simple time-regulation - it does the thing for as long as it receives the signal. auto-safety cutout after 10s. unclear if there's a 'minimum time' but times less than 0.25s reliably don't work. above that USUALLY works, 0.50 almost always works.

examples:

1:

  • S10000100001011001010010100000001110111100

  • S1 000 0100 00101100101001010 0000001 1101 111 00

  • mode: 2 (beep)

  • channel: 1

  • power: 1

  • remote ID used: 00101100101001010

  • transmitted for as long as you send the signal (max 10s)

here's a visual representation (recorded RF output of the remote): a screenshot of audacity showing pulses described in this wiki page

2:

  • S11110001001011001010010100011001011100000

  • S1 111 0001 00101100101001010 0011001 0111 000 00

  • mode: 4 (shock)

  • channel: 2

  • power: 25 (0011001)

  • remote ID used: 00101100101001010

  • transmitted for as long as you send the signal (max 10s)