Sign in to follow this  
Followers 0
eelcor

LM75A temperature sensor on Energia

9 posts in this topic

Hi everybody,

 

I have ordered some lm75a sensors from eBay and after careful SMD soldering on a SOIC to DIP converter, I am trying to get these sensors to work with the Launchpad and Energia. Somehow this is more difficult than expected (especially after connecting a RTC chip and a light sensor with ease).

 

Has anyone tried to get these sensors to work with the Launchpad? What kind of pullups are needed? Does anyone have example code?

 

And finally I tried this on the new release of Energia, has anything changed with the I2C code?

 

Kind regards,

 

Eelco Rouw 

Share this post


Link to post
Share on other sites

Thank you!

 

I tried it with 2K2 and will try it with 10K, see if it's working. Do you have any code by any chance that is verified to work? 

 

Is the Wire library bug free at this moment (I know that there were some issues with the older Energia release).

 

Kind regards, 

 

Eelco

Share this post


Link to post
Share on other sites

Yes I did, but somehow I couldn't get the sensor to work. I've tried three different pieces of code. I thought there would be much more on this sensor and Arduino, but information seems to be pretty scarce. I am going to look into the resistor issue, it might help to swap the resistors of 2k2 to 10K. See if that helps!

 

Thanks!

 

Kind regards,

 

Eelco

Share this post


Link to post
Share on other sites

Okay,

 

Swapped the resistors and chose a sketch.

// Using the LM75A for watching temp in serial monitor// This code uses the Wire library which comes along with Arduino language// by GHoSt// started at 2008/01/12// finished at 2008/01/13#include <Wire.h>void setup(){Wire.begin(); // join i2c bus as master (no address)Serial.begin(9600); // start serial for output in serial monitor (or somewhere else...)}void loop(){int c[2]; // array for two temp bytesint x=1; // counter for array (msb is send first)int check; // var for looking if temp is + or - (Bit 11)long temp; // var contains tempdata for easy reading by human beings Wire.requestFrom(72, 2); // request 2 bytes from slave device #72while (Wire.available()) { // get the two bytesc[x] = Wire.read();x--;}c[0]=c[0]&224; // "forget" all bits except the 3 left bitsc[0]=c[0]>>5; // shift these 5 bits for the right valuecheck=c[1]&256; // logical and for checking bit 8 if its 1 or 0if (check==0) {temp=(c[1]*8 + c[0]) * 0.125; // c[1] * 8, 'cause first bit isn't 1, but 8, second 16 and so on, a value of 1 is 0.125

Share this post


Link to post
Share on other sites

Maaaaaaan, I feel stupid!

 

I really really didn't want to blame my soldering skills. I've received an Aoyue reworking station yesterday and thought that the SOIC to DIP conversion was impeccable ;-)

 

However, when I used the Raspberry Pi to scan the I2C bus, no response from the temp sensors at all...but one...

 

Fired up my reworking station and applied some additional soldering paste and voila! It now works!

 

Feel downright stupid now, but I am happy that it works ;-)

 

KInd regards, Eelco

Share this post


Link to post
Share on other sites

I have an OLS and was on the verge of using it as I suspected no dialog between the launchpad and the lm75 was going on. I was afraid of Chinese fake chips, but thankfully it was fixed.

 

Thank you for your support!

 

Kind regards,

 

Eelco

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0