Skip to content

Board W1401

Thomas edited this page Feb 11, 2017 · 26 revisions

W1401 Thermostat module

The W1401 (also XH-1401) thermostat board has 3x2 digits 7S-LED display. Instead of GPIOs a 74HC164 shift register is used as the segment driver.

  • 6 digit 7S-LED display,
  • 4 keys,
  • 2 LEDs,
  • relay,
  • buzzer
  • 10k NTC temperature sensor header

There is a capacitor erroneously connected to NRST. However, programming through SWIM is possible if NRST is not connected.

When I first examined the cheap XH-W1401 thermostat module ( I quickly noticed that using the GPIO PD1/SWIM for 3 tasks (SWIM for flashing, half-duplex RX and TX) wouldn't be that easy since it already serves for SWIM and to clock the 74HC164 shift register.

Now I found a solution: the shift register clock pulse can be short with respect to a UART bit time. I tested it with a two cycle operation (125ns) which a CH340 UART chip filtered out.

It's also possible to generate the clock with one cycle (64ns) and to use a very simple RC filter (e.g. 47R/10nF) to hide it even from an unfiltered UART like the interrupt driven implementation in this project.

It's further complicated by the fact that the 74HC164 is unlatched which means that any transition on the serial line alters the LED pattern of a currently displayed digit. This can be countered by refreshing the display contents in the stop bit.

It looks like the XH-W1401 has the potential to be a supported gadget (there are variants with a front panel, and at a price of about $2.60 it's still very cheap). The schematics still has some mysteries (e.g. what they did at the sensor input, and which STM8s pins are assigned to keys, relay and buzzer) but if you follow this little project ordering a W1401 now wouldn't be all too risky.

3621Bx and 5621Bx 7S-LED Displays

Common Anode type, differen types of compatible LED displays, and colors may be used. One sample has 9mm yellow displays marked ZT21036.Y instead of green, and a red 14mm center display marked ZT210501R7.3.

Dig1 L3621.10 STM8S.17 PC7
Dig2 L3621.5  STM8S.13 PC3
Dig3 L5621.8  STM8S.14 PC4
Dig4 L5621.7  STM8S.20 PD3
Dig5 L3621.10 STM8S.19 PD2
Dig6 L3621.5  STM8S.16 PC6

74HC164 and LED segments

Only 7 bits of the shift register are used, the decimal point (DP) isn't connected.

1  DSA STM8.15 PC5
2  DSB-DSA
3  Q0 R5 L3621.3, L5621.10 SegA
4  Q1 R6 L3621.9, L5621.9 SegB
5  Q2 R8 L3621.8, L5621.1 SegC
6  Q3 R9 L3621.6, L5621.4 SegD
7  GND
8  CP STM8.18 PD1/SWIM
9  /MR (+VCC)
10 Q4 R10 L3621.7, L5621.3 SegE
11 Q5 R11 L3621.4, L5621.6 SegF
12 Q6 R12 L3621.1, L5621.5 SegG
13 Q7 NC
14 VCC

NC: L3621.2, L5621.2 SegDP
Clone this wiki locally