Both sides previous revision Previous revision Next revision | Previous revision | ||
fpga_fan_controller [2016/08/25 19:32] joel [GNU Radio] |
fpga_fan_controller [2017/12/06 11:18] (current) |
||
---|---|---|---|
Line 8: | Line 8: | ||
Internally the device uses a [[http:// | Internally the device uses a [[http:// | ||
+ | It has a 4-bit DIP switch that controls the id of the fan that will be controlled. | ||
===== Capture ===== | ===== Capture ===== | ||
==== Gqrx ==== | ==== Gqrx ==== | ||
Line 30: | Line 31: | ||
With the modulation of the packets now known, I used GNU radio to construct a real-time version of the Inspectrum demodulator. | With the modulation of the packets now known, I used GNU radio to construct a real-time version of the Inspectrum demodulator. | ||
+ | |||
+ | ==== Packet Format ==== | ||
+ | Data is transmitted by a 2/3rd / 1/3rd PWM scheme at ~2000bps. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ^ Command | ||
+ | ^ Off | 0 | 0 | LSB | ⋅ | ⋅ | MSB | 1 | 1 | 1 | 1 | 0 | 0 | 1 | | ||
+ | ^ Speed 1 | ::: | ::: | ::: | ::: | ::: | ::: | 1 | 1 | 1 | 0 | 0 | 0 | 1 | | ||
+ | ^ Speed 2 | ::: | ::: | ::: | ::: | ::: | ::: | 1 | 1 | 1 | 0 | 0 | 1 | 0 | | ||
+ | ^ Speed 3 | ::: | ::: | ::: | ::: | ::: | ::: | 1 | 1 | 1 | 0 | 1 | 0 | 0 | | ||
+ | ^ Lamp On/Off | ::: | ::: | ::: | ::: | ::: | ::: | 1 | 1 | 1 | 1 | 0 | 0 | 0 | | ||
===== iCE40 FPGA Implementation ===== | ===== iCE40 FPGA Implementation ===== | ||
+ | I wanted to make use of the [[http:// | ||
+ | |||
+ | Because of the simple modulation scheme, it's possible to transmit the 350MHz packets by simply wiggling a pin with a flying lead attached, which acts as a monopole antenna. | ||
+ | |||
+ | The source is available on [[https:// | ||
+ | |||
{{: | {{: | ||
{{: | {{: | ||
{{: | {{: | ||
{{: | {{: | ||
+ | |||
+ | ==== Performance ==== | ||
+ | The ideal quarter-wave antenna length for a monopole 350MHz is ~214mm. With a flying lead of this length, I found that the FPGA could transmit to a distance of 150m. This range is quite excessive, so I trimmed the antenna to ~50mm which the reduced the transmission range to a more reasonable distance. | ||
+ | |||
+ | Given that there are only 16 id-codes possible with the 4-bit DIP switch, and that the transmit range is so long, and that the fans in my housing complex are presumably all the same type, it would be easy to prank the neighbors in the housing complex by transmitting random commands to all the ids at once. |