cancel
Showing results for 
Search instead for 
Did you mean: 

Temperature Drop at k type thermocouple when heater is switched ON

arham1026
Associate II

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?

7 REPLIES 7
SofLit
ST Employee

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? 

SofLit_0-1733992476037.png

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?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

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

 

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.

 


@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?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

AndrewNeil_0-1734076857665.png

 

 I am controlling Relay which controls heater using the switching IC here is my overall circuit.The coil voltage is 12V

 

Image rotated.

You've marked @SofLit's post as The Solution - so is the problem now resolved?

If yes, it would be helpful to describe what, exactly, was the problem, how you found it, and how you fixed it - for the benefit of future readers with similar problems who may find this.

If no, then we still need some more details:

  1. You haven't shown how the STM32 & MAX6675 power supplies relate to the relay & heater power supply.
  2. 10A is a significant load to be switching - so have you checked the STM32 & MAX6675 power supplies for glitches and/or brown-out?
  3. Have you used an oscilloscope or logic analyser to see what's actually happening on the SPI wires between STM32 & MAX6675?

If you need to un-mark the solution, see: 

https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256#:~:text=If%20you%20accidentally%20chose%20the%20wrong%20post%20as%20solution%2C%20you%20can%20always%20revert%20this%20action%20by%20clicking%20%22Not%20the%20Solution%22

 

PS:

As shown, your heater is permanently connected to your 12V supply, and your relay shorts-out that supply.

I presume you meant (something like) this:

AndrewNeil_0-1734078389472.png

yes?

I think he mistakenly marked the solution. I've already unmarked it.

And indeed, exactly this:


@Andrew Neil wrote:
  1. You haven't shown how the STM32 & MAX6675 power supplies relate to the relay & heater power supply.
  2. 10A is a significant load to be switching - so have you checked the STM32 & MAX6675 power supplies for glitches and/or brown-out?

I'm pretty sure it's a power supply issue. 10A is a hudge load. If your power supply is not able to source a such current and especially to provide a sufficient  inrush current , your power supply voltage will drop.

This will be confirmed if you disconnect the heater and keep the relay. If the relay switches ON normally, it's an issue of insufficient current and your system is unable to provide sufficient inrush current.

So probe the current on heater at switch ON phase and probe the voltage of the controller MCU/Relay. 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.