Skip to content

Sonoff 4CH

Calin Crisan edited this page Jul 25, 2020 · 7 revisions

Device

Description

Sonoff 4CH and Sonoff 4CH Pro are 4-channel Wi-Fi smart relay boards.

By default, they run Sonoff proprietary firmware.

The following models are available:

  • 4CH/4CH R2
    • button inputs and relay outputs directly connected to ESP GPIOs
    • 90-250V AC power
    • relays control the L (live) AC power output
  • 4CH Pro/4CH Pro R2
    • inputs and outputs connected through a secondary MCU
    • supports interlocking, self-locking and inching operating modes
    • also supports 5-24V DC power
    • NO/NC relay outputs available

Configuration

Provisioning configuration name: espqtoggle/sonoff/4ch.

Flash Parameters

  • flash mode: DOUT
  • flash frequency: 40MHz

Pins

Number Function Remarks
0 push button 1 active low
4 relay 3 active high
5 relay 2 active high
9 push button 2 active low
10 push button 3 active low
12 relay 1 active high
13 status LED active low
14 push button 4 active low
15 relay 4 active high

Ports

Id Type Description Range/Unit Remarks
push_button1 boolean on/off button 1, setup button
push_button2 boolean on/off button 2, setup button
push_button3 boolean on/off button 3, setup button
push_button4 boolean on/off button 4, setup button
relay1 boolean relay 1
relay2 boolean relay 2
relay3 boolean relay 3
relay4 boolean relay 4

Installation

Requirements

Procedure

  1. ⚠️ Do not power the device from mains! Do not connect it to AC at all during this procedure!

  2. Read the flashing instructions and be prepared to follow the flashing procedure.

  3. Open the device by unscrewing the 4 screws:

  4. Take out the board and identify the RX, TX, GND and VCC connectors. For the "Pro" model, also identify the GPIO0 pad:

  5. Ensure the USB-to-serial adapter is not plugged into your laptop.

  6. Connect the following USB-to-serial adapter wires to their corresponding connectors on the board: RX, TX, GND and VCC.

  7. Ensure device will boot into bootloader mode by:

    • 4CH model: pressing and holding L1 button
    • 4CH Pro model: connecting and holding the USB-to-serial adapter second GND wire to the GPIO0 pad
  8. Plug the USB-to-serial adapter into your laptop, effectively powering the ESP chip on the board.

  9. You can now release the L1 button or disconnect the secondary GND from GPIO0.

  10. Follow the flashing procedure to flash the espQToggle firmware on the ESP chip.

  11. Disconnect all wires and reassemble the device.

Next Steps

You can now power your device by connecting it to mains. Follow the initial setup instructions to connect the device to Wi-Fi and add it to your qToggle system.

Clone this wiki locally