YOUYUE 858D+ hotair station — reverse engineering #1

The YOUYUE 858D+ I have in my possession uses an AVR ATmega8 microcontroller to control the fan-speed, drive a 7-segment display, read 2 buttons and drive the TRIAC via an opto-isolator.


I will not reverse-engineer the schematic 100%, I don’t care for the analog stuff too much, or the HV side of things (safety first!), but I’ll go far enough to treat most of the circuit as a black box and only care for what is directly connected to the ATmega8.


The Plan:

So out the ATmega8 goes, and in goes a spare ATmega168. Reading the potentiometer and 2 buttons is just a matter of minutes, translating that into fan-speed (hopefully using a PWM pin) shouldn’t take much longer. Then I’ll have a go at figuring out how to drive the display. Once all of the UI stuff works, I’ll look into reading the temperature sensor (presumably using another ADC input). Calibration and tweaking will be done later. Then I’ll very very carefully look into driving the heater (probably with PID control). Will I have to deal with zero-crossing detection, I’ll find out!

If all of the standard features work, I might look into adding useful extras: a fan-test would be nice. A non-intrusive way to do this would be to turn turn on the fan at low speed, then the heater for a second or two and check for a temperature increase. If no temperature rise is detected, either the fan or the heater are broken / not connected.

Step 1: DC power + a lot of guesswork

The power supply part (fan + mcu) was pretty easy to figure out. A couple of diodes + 7805 + caps are involved. The two switches directly connect to two AVR GPIO pins and pull them down to GND – as expected.


Please note that some capacitors etc. may not show up in the above schematic. It just covers the bare minimum to understand how it works.

It seems the air-speed is not directly controlled by a PWM pin (sadly). The fan itself is switched by a TIP122 (NPN darlington), which is used as a high-side switch (why?). There are quite a lot of SOT23 transistors (assumption) in the vicinity. Maybe they’re used to supply the base with a higher voltage… It is also strange that some capacitors are rated at 35V, although the rectified AC for the fan is about 37V. The fan itself is rated for 24VDC. Hmmmm. There are way too many small parts next to the TIP122 for just simple switching. I’ll have to investigate further. Maybe it does monitor the fan current?

I have a feeling this will take more time than expected. So for now I’ll turn my attention towards getting the 7-segment display working. That should be doable in a day.

Step 2: 7-segment display


The common anode 7-segment display is directly driven by the MCU. Three GPIO pins are dedicated as current sources to activate each of the three digits, relying on persistence of vision for a steady display. Another 8 GPIO are used to drive the 7 segments plus the decimal points (just one is used).

The 7-segment pins are:

  • PB0: 7-seg digit 1
  • PB7: 7-seg digit 2
  • PB6: 7-seg digit 3
  • PD0: 7-seg top
  • PD1: 7-seg bottom left
  • PD2: 7-seg bottom
  • PD3: 7-seg top left
  • PD4: 7-seg dot
  • PD5: 7-seg bottom right
  • PD6: 7-seg middle
  • PD7: 7-seg top right

Datasheet: SM310401K – note: pin-# in datasheet: (1…5) – (7…12)

Step 3: Buttons & reed switch


Step 4: Fan control


The MCU can stop the fan by pulling the base of the power transistor (TIP122) low. This is done with the help of a small SOT23 transistor and pin PC3. The MCU can also measure the emitter voltage (via PC5 / ADC5 / pin #28) of the TIP122, most likely to detect fan issues (no fan / stall). I will have to verify that.

R4 and Z1 form a crude reference voltage generator. Together with U7, this forms a comparator of sorts.

When the TIP122 is on (pull-up-resistor R5), C7 gets charged to a voltage set by the potentiometer (which is derived from the 122’s emitter voltage. As long as that voltage is higher than the Zener-voltage of Z1 (plus one base-emitter drop of about 0.7V of U7), U7 turns on and reduces the base current of the TIP122. The fans slows down. This forms a basic speed control mechanism for the fan.

At first I thought this circuit would oscillate, but I was mislead by the zener-diode + U7 “comparator”. If you forget about Z1 etc, this is just a simple current limiter. If U7’s V(BE) voltage is too high, too much voltage drop across the load, it turns on and “tames” the power transistor.

They could easily have driven the fan directly from the MCU, but maybe they wanted to make sure the fan always runs, just in case the MCU locks up. However, hardware PWM is very reliable… and the MCU drives the TRIAC as well. Who knows…

Step 5: Heater control (ON / OFF)


Step 6: A mystery



What works so far:

  • display
  • reading the 2 buttons
  • reading the wand sensor (reed contact)
  • fan ON / OFF override
  • crude heater control – just ON / OFF


  • read the thermo-couple voltage from the OP-7
  • implement a control loop for the temperature (most likely PID) + sensible calibration
  • read the fan status signal (not quite sure what it is)

Continue reading: Part II

This entry was posted in Arduino., Soldering & PCBs. and tagged , , , , . Bookmark the permalink.

45 Responses to YOUYUE 858D+ hotair station — reverse engineering #1

  1. Renato Caldas says:

    Hey Robert,

    I must make a small correction to your interpretation of the fan control circuit. It’s not PWM at all, the TIP122 is operating in active mode (that is, behaving somewhat like a controlled resistor).

    In more detail, the potentiometer sets a voltage reference that is amplified by the transistor U7. The resulting amplified voltage signal is still low current/low power, but is the voltage that we want at the fan. It is then fed to the base of the TIP112, which is really just being used as a buffer (see “open-collector”). The voltage at its output is exactly the same as that at its input (unity voltage gain), but it can supply a lot more current.

    Nice job, keep up the good work!

    • robert says:

      Hmmm… I’ll reactivate my old scope and probe the base of the power transistor. I would’ve sworn this circuit oscillates. Maybe I was tricked into thinking that by the presence of the zener diode in U7’s emitter.

    • robert says:

      I must have been half asleep when I wrote the post :-)

      If you ignore all the Zener business, this is just a simple current limiter… I must be getting old.

      I’ve corrected the graphics and the text.

  2. Erwin Ried says:

    Any particular reason to do this besides learning? I have a pretty similar ATTEN station (the one with soldering iron and reflow) and the only thing I miss is some kind of alarm when I forget the iron on, but everything else works perfectly.

    • robert says:

      The initial driving force to do this was the fact that the device never showed the true air-temperature when heating up. There was a gigantic overshoot. After discovering that it used an ATmega8 (which I’m familiar with), I chose to fix it.

      And it was fun!

  3. Erwin Ried says:

    What is your initial motivation besides learning to reverse this uC? Bad temp control?

    • robert says:

      Sorry for answering late. WordPress mistook your post as spam.

      Temperature control wasn’t that great AND the device was dishonest about the temperature. It only ever showed the set-point, never the true temperature when heating up [massive overshoot].

      It also didn’t have a timeout, kept running forever. And some other safety-related issues, which I could fix with the new firmware.

      • Erwin Ried says:

        (My comment was duplicated because I tough I failed to send it the first time :D)

        I see the reasons. How did you checked the overshoot? I have checked the iron part of my station and it seems very very precise. However I don’t know really how to check the reflow temperature. I have seen that if I set 150 for example or some lower temp to work with shrink tubing it reaches 190-200 easily (looking at the display)

        • robert says:

          The device showed the actual temperature when cooling down (wand placed in cradle). So if you set it to e.g. 350°C waited a few seconds to heat up (display showed 350°C instantly) and then placed the wand into the cradle, it would cool down and show something like 450°C (guessing here). Not so good.

  4. Marco says:

    Dear Robert,
    I tried your firmware on a board Version 4.10 from 20140112 (my Hotair Station is marked without a “plus” in the name). The Fantest at the program start hangs a few seconds, the firmware version is displayed a second time and then “FAN” is blinking in the display. But when I disable the fantest in program code, everything works fine as described ! The PCB looks a little bit different from yours (specially the silk screen) and the holes are at the right position ;-)

    • robert says:

      Change the fan-speed using the potentiometer. Set it to about 3.

      Without hardware modifications, the fan-test is just spinning up the fan and measuring the voltage at the motor. There is a mod to measure the true fan rpm, but I myself haven’t implemented it fully yet.

      As of now it is just a feedback for you to hear that the fan actually works.

      Could you send me pictures of the board?

  5. sudhir says:

    I have a similar model,
    The temperature reading is off by 100 degrees. It shows 230 when it should be showing 330 degrees.
    when it is off shows 000, when it should be showing 100. can it be corrected using your method?

    • robert says:

      Well… similar model can mean anything. That is too vague for a definite answer. All I can say is that my firmware supports offset-correction for temperature. It can be changed using the buttons and is stored in EEPROM. If your model uses the same micro-controller (ATmega168) and the board revision is close enough, you might give it a try.

  6. sudhir says:

    thank you for the quick response,
    the model number is QUICK858D,
    HD-858D – 2009.07.14 is printed on the board, processor is atmega8l-8pu.
    the components are not smd, but the layout looks similar to your photo. I even think the board can be swapped and it would work, maybe the programme is different.
    that is what I want to know, can it be changed, Not afraid of bricking it.
    thank you

  7. robert says:

    The atmega8 is most likely locked, so you can’t make a backup of the current firmware. If you want to give it a try, get an atmega168 and keep the atmega8 safe. I’d also use a multimeter in continuity-tester mode to check if the pins are used in the same way. If that is the case, it might work.

  8. sudhir says:

    Thank you for your quick response,
    I will do as you say, about using the atmega168.

    The code that you have written, Is it the whole program or just part of the main program?

    My pc does not have parallel port or serial port, working on a workaround.

    I am trying to build a pre-heater, to use on motherboards and mobile, I have a manual one that I made myself that works well, I just want to automate it.

    How do you check the pins of an IC? I did not know they could be checked.

    What is the small hole “that says calibrate” for?
    thank you

    • robert says:

      > How do you check the pins of an IC? I did not know they could be checked.

      I meant the way they are connected on the board.

      >What is the small hole “that says calibrate” for?

      I haven’t checked it myself, but it is part of the thermo-couple amplifier circuit. My guess: gain or offset control. I’ve never touched it.

      • sudhir says:

        Ok, I will check the traces for compatibility, and find out what the “calibrate” hole is for.
        Might take some time before i give feedback.
        I would like to implement your code, It sounds better functioning.
        thank you

  9. Aric says:

    Looks like a good upgrade to me. I just purchased one of these except the board is marked V 6.0 . One item of note is that the manufacturer seems to have updated the program to show the actual temperature but it still has the “quirk” after entering power down mode. It appears that even the newer version of these units will still benefit from your work from both operational and safety perspectives. I plan on trying out your program in the coming days. Thank you

  10. Mark Baker says:

    Three months ago I decided to get back into electronics after 25 years. After being stung with fake soldering irons I decided to take apart some hardware and redesign it as a way of learning forgotten skills. Ive ordered a Youyue rework station and then find you have done the work already.

    Actually I am glad as I can use it as an example of the design process and learning exercise. I might be an old fart but I love fixing things and learning from others. Thanks for your efforts. I look forward to getting a postal delivery soon and then I can start ripping it apart.

  11. MoonshineSG says:

    I just received my YOUYUE 858D+ and the behaviour was a bit strange. After a bit of research on the net, I found this. Upgrade the firmware is the way to go!!

    When I opened it i noticed that it comes with ATmega8 on a ver 6 (20140415). DO I need to change to a ATmega168 in order to use the custom firmware, or I just re-compile ? If a new micro processor ATmega168 (or atmega328 woudl have any advantage?) is needed, which model should I get ?


  12. robert says:

    I cannot guarantee that my code works on an ATmega8 without adapting the code, it is not register-compatible with the ATmega168/328. You’re on your own if you go that way. Get either an 168 or 328P, whichever is cheaper. These are known to work, assuming you get a real one. There have been issues with some chips and I suspect they were either fakes or factory rejects.

  13. MoonshineSG says:

    I got a ATMEGA168PA-PU from RS so I assume it’s a real one.. I’m waiting for the USBasp I ordered and I will try to burn the new firmware…

  14. Zen1 says:

    Hey, I just wanted to say this is an awesome little project. I have gotten your newest firmware(1.43) working wonderfully on my rev 6 board with an atmega328. I’m continuing to modify mine to address some possible thermal issues to ensure the unit has a long safe life. I took the liberty to snap some pics of the rev 6 board, but I don’t really see much of a difference. Anyways, you may or may not find the info useful but I’ll keep posting my findings on my blog .
    I have placed many of the pictures I took of the rev 6 board here:

    Anyways, thanks for all the effort! It’s people like you who make the electronics community better.

  15. robert says:

    Too much praise! Let’s not forget the other contributors to this project ;-)

  16. game says:

    What is temperature measurement circuit? It is the only essential thing in this device and you did not said nothing about it

  17. sudhir paul says:

    confirmed to work on

    HD-858D – 2009.07.14

    I printed a new circuit and built a pcb preheater out of your firmware, works perfectly,
    well thought out firmware that does the right things.
    I am using firmware 1.43,

    I was just wondering if you could just leave the fan on for cooling the board,
    after the fan switching off the board still stays hot.

    thanks for the firmware
    sudhir paul

    • robert says:

      1.43 has an option to blow cold air.

      • sudhir paul says:

        Hello Robert
        What I meant was let it blow cold air without decreasing set temperature. Modified this for pcb preheater,
        After switching off, somehow the temp doesn’t go below 80.c, at startup it is ok. I am monitoring temp with an external probe, and also the air is quite warm.
        maybe I’m missing something.
        One more thing, what does parameter “avg260” do?

        • robert says:

          I assume you’re talking about the “AVG” parameter in the setup menu.

          This can be used to tweak the way the PID algorithm calculates the average temperature (to avoid random fluctuations). Be careful when changing it, it may make the thing unstable and overheat.

          Regarding cooling down the board. I think it would be easiest to add a mechanical switch and modify the firmware to turn off the heater & keep the fan running when it is triggered.

          • sudhir paul says:

            Hello Robert,
            thank you for the quick reply and for clearing my doubts,
            I think that having a switch to keep the fan on would be the simplest solution,
            thanks again
            sudhir paul

  18. game says:

    Hello Robert,
    Thank you for replay.
    Problem is that thermocouple suppose cold junction compensation. Without it measurement is inaccurate because different room temperature will give different airflow temperatures while airflow temperature is constant.
    Also tables for thermocouples are for cold junction reference temperature 0 degree Celsius, and room temperature may vary somewhere about 20-30 degrees Celsius so values in thermocouple tables cant be used

    • robert says:

      A well known fact.

      I did not reverse engineer that part of the circuit, as it was irrelevant for the changes introduced with the new firmware. I assumed the hardware was OK and treated is as a black box, much like the TRIAC circuitry.

      • game says:

        Robert thank you for replay.
        I am asking about thermocouple circuit because I need hot air station, and I think to make it by myself. I think to buy only heating handle with fan and to build control by myself so I need to know how handle works.
        As I understand heater is directly supplied to mains voltage of 220V and controlled by 100% on and full off but not PWM but with hysteresis, and thermocouple voltage is directly gained and measured without any cold end compensation. Fan is DC type probably 12V or 24V. Is this correct? Thanks.

  19. Raffael says:

    Hi, thanks for sharing this really cool project.

    I have purchased one of these stations quite recently, with board version 6.1 (20150603, which doesn’t differ much from v6.0), and it worked just fine in the beginning, but then the fan control didn’t work anymore: the output voltage for the fan is constantly around 9.4V.

    Opening the device and checking some of the transistors, my guess is that U7 is dead, and/or the zener diode. To reassure this, could you tell me what should be the zener voltage of Z1?

    • Raffael says:

      (EDIT) Well, no, after re-assembling the whole thing again, it turned out to work again, but only after I applied some force on the potentiometer. Seems to be some bad contact there.

      For anyone interested, I measured a Zener voltage of 8V.

    • robert says:

      I’ll take a measurement tomorrow.

      One thing to check is the potentiometer! Mine broke and the fan didn’t run properly any more. The wiper broke.

Comments are closed.