2024-12-11 09:29 PM
Hi, I am kinda new to this community.I am working with STM32L432KC micro controller and using it to control a PTC heater having power rating of 20Watts.The control is basically ON/OFF control with single pin activating the relay and switching the heaters ON.I am continously measuring the temperature of these heaters through k thermocouple and MAX6675IC.The problem is when below a certain threshold temperature heater is switched ON the the temperature immediately drops to zero. Any one having any insights on this Problem?
2024-12-12 12:38 AM
Hello @arham1026 and welcome to the community,
As per MAX6675 datasheet, this IC is using SPI. What actually did at this stage as debug? did you probe MISO pin?
When you say:
@arham1026 wrote:
The problem is when below a certain threshold temperature heater is switched ON the the temperature immediately drops to zero. Any one having any insights on this Problem?
What do you mean by the temperature drops to 0? how you did conclude that? in a value read in your software?
What tool are you using STM32CUbeIDE/STM32CubeMx? Cube HAL as STM32 drivers?
2024-12-12 01:38 AM
I am using STM32CubeMX software.The value i am reading is exact temperature which is 12bit value by left shifting it in the 16 bit data of SPI.So the value of temperature i am getting becomes zero when heater is switched ON
2024-12-12 01:43 AM
Have you used an oscilloscope or logic analyser to see what's actually happening on the SPI wires?
@arham1026 wrote:i am getting becomes zero when heater is switched ON
Have you checked the power supply? Maybe you're getting a "brown-out" when the heater turns on ... ?
Show your full schematic.
Some good, clear photos of your setup may also help.
2024-12-12 01:51 AM
@arham1026 wrote:
So the value of temperature i am getting becomes zero when heater is switched ON
I assume it's a HW issue. Mainly the power supply part and a drop on VDD line when the heater turns on.
You said you switch on the heater using a relay. What is the relay characteristics? especially the coil voltage and current activation? how are you connecting the relay to the STM32? directly on a GPIO pin or using a transistor or something else?