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.

IMGP8602

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.

IMGP8603

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.

youyue-858d-plus-DC-supply

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

youyue-858d-plus-7seg-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

Step 3: Buttons & reed switch

youyue-858d-plus-buttons-and-reed-switch

Step 4: Fan control

youyue-858d-plus-fan

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)

youyue-858d-plus-TRIAC-drive

Step 6: A mystery

youyue-858d-plus-mystery

Step 7: FIRST LIGHT

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

Todo:

  • 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)
This entry was posted in Arduino., Soldering & PCBs. and tagged , , , , . Bookmark the permalink.

20 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 ;-)
    Marco

    • 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?
    thanks
    sudhir

    • 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
    sudhir

  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
    sudhir

    • 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:

        Hi,
        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
        sudhir

Comments are closed.