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.

9 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA Image

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">