Arduino Nano - LM75BIMM Temperature Sensor Tutorial
by Dcube Tech Ventures in Circuits > Electronics
46 Views, 0 Favorites, 0 Comments
Arduino Nano - LM75BIMM Temperature Sensor Tutorial
LM75BIMM is a digital temperature sensor incorporated with thermal watchdog and has two wire interface which supports its operation upto 400 kHz. It has an over temperature output with programmable limit and hystersis. Here is the demonstration with Arduino Nano.
What You Need..!!
Connections:
Take an I2C shield for Arduino Nano and gently push it over the pins of Nano.
Then connect the one end of I2C cable to LM75BIMM sensor and the other end to the I2C shield.
Connections are shown in the picture above.
Code:
The arduino code for LM75BIMM can be downloaded from our github repository- DCUBE Store.
Here is the link for the same :
https://github.com/DcubeTechVentures/LM75BIMM/blob/master/Arduino/LM75BIMM.ino
We include library Wire.h to facilitate the I2c communication of the sensor with the Arduino board.
You can also copy the code from here, it is given as follows:
// Distributed with a free-will license.
// Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
// LM75BIMM
// This code is designed to work with the LM75BIMM_I2CS I2C Mini Module
#include
// LM75BIMM I2C address is 0x49(73)
#define Addr 0x49
void setup()
{
// Initialise I2C communication as MASTER
Wire.begin();
// Initialise Serial communication, set baud rate = 9600
Serial.begin(9600);
// Start I2C Transmission
Wire.beginTransmission(Addr);
// Select configuration register
Wire.write(0x01);
// Continuous operation, normal operation
Wire.write(0x00);
// Stop I2C Transmission
Wire.endTransmission();
delay(300);
}
void loop()
{
unsigned int data[2];
// Start I2C Transmission
Wire.beginTransmission(Addr);
// Select temperature data register
Wire.write(0x00);
// Stop I2C Transmission
Wire.endTransmission();
// Request 2 bytes of data
Wire.requestFrom(Addr,2);
// Read 2 bytes of data
// temp msb, temp lsb
if(Wire.available()==2)
{
data[0] = Wire.read();
data[1] = Wire.read();
}
// Convert the data to 9-bits
int temp = (data[0] * 256 + (data[1] & 0x80)) / 128;
if (temp > 255)
{
temp -= 512;
}
float cTemp = temp * 0.5;
float fTemp = cTemp * 1.8 + 32;
// Output data to serial monitor
Serial.print("Temperature in Celsius: ");
Serial.print(cTemp);
Serial.println(" C");
Serial.print("Temperature in Fahrenheit: ");
Serial.print(fTemp);
Serial.println(" F");
delay(1000);
}
Applications:
LM75BIMM is ideal for a number of applications including base stations, electronic test equipment, office electronics, personal computers or any other system where temperature monitoring is critical to performance. Therefore, this sensor has a pivotal role in many of the highly temperature sensitive systems.