Author Topic: Purpose of a strange diode/resistor combination  (Read 433 times)

0 Members and 1 Guest are viewing this topic.

Offline mwalleTopic starter

  • Newbie
  • Posts: 3
  • Country: de
Purpose of a strange diode/resistor combination
« on: June 28, 2024, 08:06:08 pm »
Hi,

After googling for an alternative firmware for my cheap chinese hot plate UYUE 946 I've stumbled across the following website:
https://www.weigu.lu/microcontroller/uyue_946_hack/index.html

Someone already reverse engineered the PCB. Most makes sense (although the uC could also be a CH32V003) but I cannot make any sense of the D1/R1 combination. D1 is also a through hole component, you can look at the backside picture. If you have a look at the schematics, the diode is connected to Pin 3 of the uC which might be an analog input. I could just image that this is some kind of voltage reference. But the uC should also have an internal voltage reference...

Does anyone have an idea what that might be for?

-michael
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4636
  • Country: gb
Re: Purpose of a strange diode/resistor combination
« Reply #1 on: June 28, 2024, 08:18:50 pm »
My guess would be a temperature sensor.  Silicon diodes, usually reduce the voltage drop (Vf) across the silicon diode, by around 1.8 millivolts per degree C.  Especially useful for seeing relative temperature changes, as the initial voltage drop (at room temperature), can vary between devices, to a small degree.

More about it here:
https://en.wikipedia.org/wiki/Silicon_bandgap_temperature_sensor

The bandgap is a more sophisticated version, but I was referring to the low cost, single diode method.

Quote
If high precision is not required it is enough to bias a diode with any constant low current and use its −2 mV/˚C thermal coefficient for temperature calculation, however this requires calibration for each diode type.
« Last Edit: June 28, 2024, 08:22:52 pm by MK14 »
 

Online Phil1977

  • Regular Contributor
  • *
  • Posts: 137
  • Country: de
Re: Purpose of a strange diode/resistor combination
« Reply #2 on: June 28, 2024, 08:20:56 pm »
To read out a thermocouple you need a reference temperature.

Is it possible the circuit is reading the forward voltage of this diode for the absolute temperature measurement? I didn't see any NTC or comparable part.
 

Offline mwalleTopic starter

  • Newbie
  • Posts: 3
  • Country: de
Re: Purpose of a strange diode/resistor combination
« Reply #3 on: Yesterday at 08:33:22 am »
Thanks for your guesses :)

Quote
My guess would be a temperature sensor.

Might be. But then it will be a very crude one because the voltage directly feeds into the ADC and if the reference of the ADC is 5V (just a guess, it might also be switchable to an internal generated voltage), 3mV will be in the range of a few digits with a 12bit ADC.

Quote
To read out a thermocouple you need a reference temperature.

Could you elaborate a bit more on that? Doesn't a thermocouple return a specific voltage for a given temperature? Also, like above the reference would be very inaccurate for the same reason as above. Whereas the voltage change of the thermocouple is amplified by the opamp.
 

Online HwAoRrDk

  • Super Contributor
  • ***
  • Posts: 1532
  • Country: gb
Re: Purpose of a strange diode/resistor combination
« Reply #4 on: Yesterday at 08:49:33 am »
(although the uC could also be a CH32V003)

It's almost certainly not - as the linked page suggests - an STM8, nor a CH32V. It's probably one of any number of STM8S003 pin-compatible asian-brand microcontrollers that are typically 8051 or Cortex M0+.

Looking at the reverse-engineered schematic on the linked page, one thing stands out to me that can dismiss the STM8 and CH32V, and possibly narrow down the potential candidates: that there are two signal lines from the microcontroller that go to the programming header. Neither the STM8S nor CH32V003 need this - they each only have a single data line for programming. In fact, an STM8S could not work in the configuration shown, because it requires a capacitor on the VCAP pin for the internal voltage regulator (CH32V does not have such a thing; pin 8 is a regular GPIO).

One microcontroller that I am aware of that has a TSSOP-20 '003 compatible pin-out and that has programming signals on pins 8 and 18 is the WHXY CW32F003F4P7 ARM Cortex M0+ micro. Pin 8 is SWDIO and pin 18 is SWCLK. It's probably not this exact chip, but some other that also has clock/data programming lines on those pins.

By the way, a datasheet for the SZ2525C was easy to find on LCSC.

Edit: I think I may have found a candidate for the MCU. :) The Wisesun WS51F0030. It's an 8051-based microcontroller. Has the programming clock/data pins in the aforementioned locations. Also runs on 5V (some ARM MCUs are not a match as they only run on 3.3V). And, according to the pictures on LCSC at least, has no top markings.
« Last Edit: Yesterday at 09:10:07 am by HwAoRrDk »
 

Online Phil1977

  • Regular Contributor
  • *
  • Posts: 137
  • Country: de
Re: Purpose of a strange diode/resistor combination
« Reply #5 on: Yesterday at 10:03:26 am »

Quote
To read out a thermocouple you need a reference temperature.

Could you elaborate a bit more on that? Doesn't a thermocouple return a specific voltage for a given temperature? Also, like above the reference would be very inaccurate for the same reason as above. Whereas the voltage change of the thermocouple is amplified by the opamp.
No, a thermocouple circuit just allows you to measure the voltage difference between two points in its circuit where the different materials touch (=junctions).

That´s why each thermocouple-meter needs its own absolute temperature reference. In good old days of school physics labs you put the reference junction into a bath of ice water so you knew it was 0°C. In all modern equipment you have a NTC or some other form of absolute temperature sensor near to the instrument-side junction.

If the ADC has 12bits and measures from 0 to 5V, it roughly has 2mV resolution. That´s enough to measure the forward voltage if a diode and get a temperature with a few °C of tolerance. A solder station does not need single-°C-tolerance so that generally should be okay.

The thermocouple on the hot side needs the opamp because the thermocouple voltages are much lower than the diode forward voltage and also full of common mode noise/voltage. The opamp is a perfect tool to amplify the low voltage and get rid of common mode stuff.
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 355
  • Country: ie
    • LinkedIn
Re: Purpose of a strange diode/resistor combination
« Reply #6 on: Yesterday at 10:18:49 am »
Quote
Doesn't a thermocouple return a specific voltage for a given temperature?
Yes, but there is physically more than one thermocouple junction. A thermocouple consists of two different wires (as the name suggests). If you manage to connect both of them to the PCB pads made of the same material, then it will be only 1 thermocouple. But this is impossible - wires of different materials will be connected to the same wires going into the system (I think copper). This will form 2 more thermocouples when connecting the output wire. So you have 3 thermocouples in series. 1 at measuring temperature and 2 at room temperature (connected in opposite direction). You should compensate voltage of the last 2.
 

Offline mwalleTopic starter

  • Newbie
  • Posts: 3
  • Country: de
Re: Purpose of a strange diode/resistor combination
« Reply #7 on: Yesterday at 05:02:31 pm »
Thanks for all the explanations and the research what uC it might be ;)

FWIW, I've just disassembled mine, removed the uC and had a look underneath. There's a number, but its probably just a batch or date code. In any case, i've also verified the schematics and found some errors. I might get around to draw my own one soon.

I was thinking about replacing the uC with the winchiphead one because that one doesn't need the VCAP pin (instead of the STM8, dunno if theres a STM32 one with the same pinout). But I've already have enough projects on my stack ;) So maybe in the future..

Btw, the forward voltage of D1 is 1.4V and the reverse one is 0.51V. I measured it in circuit, so there might also be clamping diodes on pin 3 of the uC..

-michael
« Last Edit: Yesterday at 05:14:14 pm by mwalle »
 

Offline MathWizard

  • Super Contributor
  • ***
  • Posts: 1494
  • Country: ca
Re: Purpose of a strange diode/resistor combination
« Reply #8 on: Yesterday at 09:34:05 pm »
I found a 1N4002 tucked away inside the cable bundle of a 750W PSU. It literally only went from 5V on the anode, and on the cathode was 12V output pin to the fan, and cap, the fan BJT output, and another diode pointing into this node. And they could have put the diode on the PCB, yet they ran a few inches of wire, on each end, to place it in the cable bundle.

I reverse engineered the whole PSU, and in my case, I don't see why they put it like a temp sensor.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf