stm8ef icon indicating copy to clipboard operation
stm8ef copied to clipboard

Board ZFC39, Fan speed controller

Open PSLLSP opened this issue 7 years ago • 17 comments

Hi Thomas,

just FYI, new board ZFC39 with STM8S003 micro-controller. It can control up to three PC PWM fans.

http://www.ebay.com/itm/PC-CPU-12V-4-Wire-Fan-Temperature-Control-PWM-Speed-Control-Module-W-Alarm/282460745283?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649

http://www.formfactors.org/developer/specs/4_wire_pwm_spec.pdf

BTW, I am sorry for new issue but there is no contact email noted.

PSLLSP avatar Jun 26 '17 10:06 PSLLSP

Hi PSLLSP,

Opening an issue is good way for submitting a feature request. Thanks for including the fan specs. Do you own such a board? If yes, did you trace how the STM8S pins are used?

TG9541 avatar Jun 26 '17 11:06 TG9541

Hi Thomas,

I have a sample board. There is 78L05 regulator on the board and STM8S003F (TSSOP20) MCU.

MCU is connected in this way:

1 (BEEP) - 150R - 1uF - BUZZ - GND 2 (AIN) - 1k - 50k NTC - GND; 10k pull-up to VCC (10k - 50k NTC is voltage divider) 3 (IN) - DP5 (label BF2) 4 (NRST) - 100nF - GND; there is a pad connected to NRST at the bottom of the PCB. 5 (IN) - DP4 (label BF1) 6 (IN) - DP3 (label TP2) 7 (VSS) - GND 8 (VCAP) - 1uF - GND 9 (VDD) - VCC (+5V); there is a pad connected to VDD at the bottom of the PCB. 10 (IN) - 150R - FAN2-3 (RPM); signal is filtered by pull-up 10k and pull-down 470pF 11 (IN) - NC ?? 12 (OUT) - red LED - 10k - VCC 13 (OUT) - 150R - FAN3-4 (PWM) 14 (AIN) - trimmer 10k F3; signal is filtered by pull-down 100nF; voltage divider between VCC and GND 15 (IN) - DP2 (label TP1) 16 (OUT) - 150R - FAN2-4 (PWM) 17 (OUT) - 150R - FAN1-4 (PWM) 18 (IN/SWIM) - DP1 (label TFL) 19 (AIN) - trimmer 10k F2; signal is filtered by pull-down 100nF; voltage divider between VCC and GND 20 (IN) - 150R - FAN1-3 (RPM); signal is filtered by pull-up 10k and pull-down 470pF

NOTE, RPM signal from FAN3 is not connected to MCU (no feedback from FAN3, no detection of blocked fan) NOTE, DPx switches connect signals to GND NOTE, buzzer has to be actively driven by MCU, it is not self oscillating type NOTE, NTC is NTC50K3950 (label on PCB)

images of PCB can be found on internet, one example: https://images-na.ssl-images-amazon.com/images/I/51Pn9NLqUlL.jpg

Video on YouTube: https://www.youtube.com/watch?v=ZldI9R1zOGE

PSLLSP avatar Jun 27 '17 22:06 PSLLSP

OK, looks good: it's easy to get a console (e.g. PD1 "SWIMCOM", or PD1/PD6). Retrofitting the FAN3 RPM input isn't hard, and I think that the trimmer inputs can be converted into additional temperature sensor inputs.

I've ordered one of those boards. If you'd like to start experimenting: you can flash the SWIMCOM image to the board, and start some experiments:

  • getting it to produce PWM signals takes some Forth words
  • a simple stall detection would be easy (several options, e.g. pin change interrupts, T2 capture)
  • if you want to actually measure, let alone closed-loop-control, the RPM, writing simple pin-change interrupt handlers is maybe the easiest option.
  • Functional dependencies (temperature to RPM, time to RPM) can be done easily with interpolation code here.

TG9541 avatar Jun 28 '17 07:06 TG9541

I now have a board, still no fans, though :-)

TG9541 avatar Aug 03 '17 20:08 TG9541

Just note about new board. "DC-DC adjustable Power supply module with LCD display", that can be ordered for about 4USD is build around STM8S003K3T6 MCU. This MCU is in LQFP32 package and is hidden under LCD. I see 4 holes on PCB those could be SWIM interface. I see MP2307, LM358, HT7133-1 (3.3V LDO voltage regulator), two buttons, one induktor and several rezistors, capacitors and diodes. LCD has back-light.

http://www.ebay.com/itm/DC-DC-Adjustable-Step-down-Power-Supply-Module-Voltage-Current-LCD-Display-Shell-/142218535015?hash=item211ce2a067:g:WIMAAOSw2xRYWQNf

https://www.youtube.com/watch?v=tskURZyHbhk https://www.youtube.com/watch?v=N_H4sVyhIaU

PSLLSP avatar Oct 11 '17 22:10 PSLLSP

Thanks, ordered one. Do you know how they controlled the LCD?

TG9541 avatar Oct 13 '17 05:10 TG9541

I don't know HW details. It could be a challange to write firmware for this board. Some ideas how to drive LCD display could be found here:

http://www.atmel.com/Images/doc2569.pdf http://www.ti.com/lit/an/slaa516a/slaa516a.pdf http://www.st.com/content/ccc/resource/technical/document/user_manual/ca/6a/61/13/08/c4/48/f9/CD00278045.pdf/files/CD00278045.pdf/jcr:content/translations/en.CD00278045.pdf

PSLLSP avatar Oct 13 '17 13:10 PSLLSP

Thanks for the links! I'll be looking into how LCD control works in the power supply once it's there.

TG9541 avatar Oct 14 '17 11:10 TG9541

Since the LCD hides the µC I'll have to disassemble the board I have. A second device is now in the mail. Help with reverse-engineering would be appreciated.

TG9541 avatar Nov 25 '17 08:11 TG9541

Just in the case: if anybody would like to see some progress on this board, just drop me a note here. It shouldn't be too hard to program a fan control application on it provided that your requirements are known!

TG9541 avatar Apr 02 '18 07:04 TG9541

Does anyone know if it is possible to make the temperature ranges lower? Let's say, while TP1/TP2=OFF/OFF, the lowest accelerating at 25℃ and Full speed at 35℃

TP1 | TP2 | Accelerating temperature | Full speed temperature
-- | -- | -- | --
OFF | OFF | 35℃ | 45℃
ON | OFF | 40℃ | 55℃
OFF | ON | 50℃ | 70℃
ON | ON | 60℃ | 90℃

berrydejager avatar Sep 01 '18 21:09 berrydejager

Hi @berrydejager, I have no knowledge of the code that defines the behavior of the ZFC39 as-is but you can, of course, program the µC on the board to any temperature to fan speed ratio. Right now my time to do programming and testing is a bit scarce, but I'd be happy to help.

TG9541 avatar Sep 02 '18 20:09 TG9541

For reference: a specification document "4-Wire Pulse Width Modulation (PWM) Controlled Fans" from the Wayback Machine is here: 4_Wire_PWM_Spec.pdf

In chapter 2.1.4 the specification requires the PWM frequency to be between "21 kHz to 28 kHz", typical 25 kHz. At that frequency there are 640 steps between 0% and 100% (16Mhz timer clock). The fan PWM inputs have a pull-up to 3.3V or 5V (older models). µC GPIOs should be in open-drain mode (low side) and should be able to sink 5mA (chapter 2.3.1).

Both requirements shouldn't be a problem for STM8S.

TG9541 avatar Nov 16 '19 07:11 TG9541

Maybe there are some other Folks which like visualizations so I made a quick grapic: ZFC39

dirkscheffer avatar Mar 23 '21 20:03 dirkscheffer

@dirkscheffer thanks for the schema :-)

I've left this issue open because it appears to be useful to people looking for information on the ZFC39 fan speed controller. Currently this type of fan speed controller is marketed as NTC3950 or DC 12V Pwm PC CPU Fan Temperature Control or maybe HW-585.

The µC on this board is most likely a Nuvoton N76E003AT20, not an STM8S003F3P6. This means that in order to use the Forth OS in this repository instead of the stock firmware you need to replace the µC.

TG9541 avatar Mar 24 '21 06:03 TG9541

i have now such a board , the CPU has a sticker with new label also my board has i2c pins near MPU and two pins that looks like button ( label SY and TP) did someone know the funktion ? also when need i can try read the pins or maybe dump the rom when someone tell me how

RaptorSDS avatar Jan 14 '24 18:01 RaptorSDS

IMG20240122214342

RaptorSDS avatar Jan 22 '24 20:01 RaptorSDS