fake lm35dz temperature sensors

Anything not related to STM32
dannyf
Posts: 447
Joined: Sat Jul 04, 2020 7:46 pm

Re: fake lm35dz temperature sensors

Post by dannyf »

It seemed this is still feasible as the RC step response is about 10 milliseconds,
one way to remain response time is to parallel (serial works as well but has limitations) a few of such sensors - each with its own individual resistors.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: fake lm35dz temperature sensors

Post by ag123 »

@dannyf thanks
The earlier LM35DZ, I got from AliExpress, didn't work. The current temperature sensors I used are LMT86.
I got them from Farnell element14. They are the real ones from TI. I think these can be recommended.

The real LMT86 are certainly good for the premium paid. Earlier on, the troubles are caused by unexpected radio waves interference. Currently, this problem is partially solved by connecting a 1 nF capacitor between ADC to GND.

The outlier samples problem is not totally fixed. If you look at 2 posts back, you can see spikes in the graphs when I did that heating experiment.
viewtopic.php?p=8524#p8524
dannyf
Posts: 447
Joined: Sat Jul 04, 2020 7:46 pm

Re: fake lm35dz temperature sensors

Post by dannyf »

The outlier samples problem is not totally fixed.
this is in reference to the spikes? they are always going to be there, even if you were to adc a perfectly fixed voltage. would be good to see how much variability you were getting.
AndrewBCN
Posts: 105
Joined: Sun Apr 25, 2021 3:50 pm
Answers: 1
Location: Strasbourg, France

Re: fake lm35dz temperature sensors

Post by AndrewBCN »

Unfortunately I didn't read this topic before ordering 5 x LM35DZ from a vendor on AliExpress. Of course I got a bunch of fake ones... :x
As far as I can tell they are just NPN transistors.
I opened a dispute and was promptly refunded.
And yes I am amazed that scammers will go as far as re-marking NPN transistors to fake such inexpensive components as LM35s. :!:

Image
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: fake lm35dz temperature sensors

Post by ag123 »

For mine, there is no response. LM35 are priced at quite a premium on TI's web, certainly not those aliexpress prices.

Either way, don't get LM35, the lesson learnt is RF interference can cross 10s of millivolts, huge !
And the wires to the probe becomes an RF antenna and if that temperature sensor is a diode after all, it becomes an AM radio (stm32 ADC can easily sample the whole AM frequencies, the unintended SDR) !

Get those LMT86 instead
https://www.ti.com/product/LMT86

LMT86 are 'NTC' ones, the voltage reduce kind of 'linearly' (not really) from 2.2v. There is an equation provided by TI in the specs sheet.
I actually used that equation, and since I'm using a stm32f401 which has an FPU, i did floating point math to translate from voltages to temperatures based on TI's formula for LMT86. Works well, saves coding a big table to look up and interpolate values.
Much neater codes, here is the implementation in my sketch TI's formula:

Code: Select all

// param: mv - millivolts from sensor
// returns: temperature deg C
float lmt86(float mv) {
	float t = 0.0F;
	float v = 1777.3F - mv;
	//t = 10.888 - sqrt((-10.888)*(-10.888) + 4.0 * 0.00347 * v);
	//t = t / ( 2.0 * -0.00347) + 30.0;

	t = 10.888F - sqrt(118.548544F + 0.01388F * v);
	t = 30.0F - t / 0.00694F ;

	return t;
}
Either way, my use of semiconductor sensors is mainly as a temperature reference, say to calibrate thermistors.
But that things like LMT86 may be useful for cold junction compensation for thermocouples, as well as measuring temperatures up to boiling point of water 100 deg C.
dannyf
Posts: 447
Joined: Sat Jul 04, 2020 7:46 pm

Re: fake lm35dz temperature sensors

Post by dannyf »

the lesson learnt is RF interference can cross 10s of millivolts
10-bit adc will likely have a 8 LSB fluctuation. on a 3.3v Vref, that's 25mv, on a steady adc source.

So what you observed may not be the output volatility.

if indeed there is some output fluctuations, a RC filter will help cure it.
FarhanKhosravi
Posts: 1
Joined: Sun May 01, 2022 12:24 pm

Re: fake lm35dz temperature sensors

Post by FarhanKhosravi »

fpiSTM wrote: Wed Sep 15, 2021 12:08 pm Thanks.
About ADC sampling it can be redefined using the build_opt.h:

https://github.com/stm32duino/Arduino_C ... pp#L33-L47

Simply defined ADC_SAMPLINGTIME with the value you want ;)
Help..!
I tried every way, every suggestion inside your forum or whole internet about setting ADC sample time in arduino IDE... NOTHING WORKS!
I made build_opt.h and did everything you said, tried multiple suggestions and syntaxes and nothing worked.
this is inside my build_opt file right now:

Code: Select all

-DADC_SAMPLINGTIME=ADC_SAMPLETIME_7CYCLES_5
that's not working too... look at attached photo..
please help me, I need very fast ADC readings and can't find any solution...
i tried both official and roger's stm cores, no luck... :cry:
Attachments
Screenshot 2022-05-01 170500.png
Screenshot 2022-05-01 170500.png (11.25 KiB) Viewed 2382 times
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: fake lm35dz temperature sensors

Post by GonzoG »

@FarhanKhosravi
it cannot be simply done.
analogRead() works slow because it's foolproof. Redefining ADC_SAMPLINGTIME won't do much as actual ADC reading is quite fast, but all that needs to be done before and after takes time.
If you want fast ADC you need to use HAL or LL and probably DMA, but this means that you need to setup ADC by yourself.
Post Reply

Return to “Off topic”