How do I run a servo motor using a tmp35 sensor on a KL43z freedom board ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I run a servo motor using a tmp35 sensor on a KL43z freedom board ?

705 Views
mohammedsiddiq
Contributor I

I'm doing a project on the freedom board kl43z but there isn't much material online for help. I'm confused how to code to read the temperature as the input using a tmp35 sensor which causes the servo motor to start moving at a certain temp( room temperature).

0 Kudos
3 Replies

591 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Mohammed,

The KL43Z has on-chip 16 bits ADC and 1.2V voltage reference, the ADC can sample the TMP35 output voltage. What is the temperature range for your application?

I have checked the data sheet of TMP35, at 25 C, it outputs 250mV, the output scale factor is 10mV/C. As you know that the ADC has Voltage reference pin Vrefsh which can be connected to internal 1.2V voltage reference, in the case, you can connect the TMP35 output to ADC analog pin directly with OP AMP you can connect a serial 100 ohm resistor and 2.2nF capacitor(between analog GND and ADC analog pin) as a simple filter, it is okay.

Hope it can help you

BR

xiangjun Rong

0 Kudos

591 Views
mohammedsiddiq
Contributor I

I figured that out but im having trouble how to code not sure how would i go about to code it basically 
I wrote some code and its reading the temperature or at least I think it is but not sure how to move the motor according to room temperature ?

0 Kudos

591 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Mohammed,

You can calculate the TMP35 output voltage at the room temperature, then calculate the ADC sample value at the output voltage as a threshold based on ADC bitwidth. In the application code, use PIT to generate ISR, in the ISR, start ADC sampling, if the sample is greater than the threshold, start the motor.

Hope it can help you

BR

Xiangjun rong

0 Kudos