Advertisement
microrobotics

30205 Arduino

Mar 30th, 2023
763
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*The 30205 body temperature sensor is a non-contact infrared temperature sensor that measures the temperature of an object by sensing the infrared radiation emitted from it. Here's an example code in Arduino that reads the temperature from a 30205 sensor connected to an Arduino board:
  2. Note: This code assumes that the 30205 sensor is connected to the I2C bus of the Arduino board. If you're using a different I2C bus or pins, you'll need to modify the mlx initialization accordingly.
  3. */
  4. #include <Adafruit_MLX90614.h>
  5.  
  6. Adafruit_MLX90614 mlx = Adafruit_MLX90614();
  7.  
  8. void setup() {
  9.   Serial.begin(9600);
  10.  
  11.   mlx.begin();
  12. }
  13.  
  14. void loop() {
  15.   // read the temperature from the sensor
  16.   float temp = mlx.readObjectTempC();
  17.  
  18.   // print the temperature
  19.   Serial.print("Temperature: ");
  20.   Serial.print(temp);
  21.   Serial.println(" °C");
  22.  
  23.   // delay before reading from the sensor again
  24.   delay(1000);
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement