Example Code for Arduino-IR Temperature Measurement

Last revision 2025/12/29

Hardware Preparation

  • Arduino UNO Main Board(or analogous main board) ×1
  • TS01 Infrared Temperature Sensor 4-20mA ×1
  • Current-to-Voltage Module ×1
  • Object Detected ×1

Software Preparation

  • Arduino IDE(1.0× or 1.8×), click to download Arduino IDE.

Wiring Diagram

  • TS01 outputs 4~20mA standard industrial current signal, a current to voltage converter is highly recommended when you want to use MCU to read the value.
  • The power supply of TS01 is 7.5-36V.

Connection Diagram

Sample Code

void setup() {
  Serial.begin(115200);
}

void loop() {
  unsigned int ADC_Value = analogRead(A3);
  float i=(double)ADC_Value/(204.8*0.12);
  float j=(i-4)/16*340-70;
  Serial.print(i);
  Serial.print("mA, ");//printed current value
  Serial.print(j);
  Serial.println("\u2103");//printed temperature value
  delay(100); 
}

Result

Result

Was this article helpful?

TOP