8 years, 10 months ago.

NUCLEO-F072RB Temperature

Hi, i use NUCLEO-F072RB. I tried using the example Nucleo_i2c_master the link: https://developer.mbed.org/teams/ST/code/Nucleo_i2c_master/?platform=ST-Nucleo-F072RB Loaded the program starts to blink the LED sign in error. Can someone please help me?

1 Answer

8 years, 10 months ago.

Hello, blinking LED is because i2c.write failed (NACK), thus entering next line in endless loop will blink the LED.
check the hardware configuration :
- are the pull up resistors (10K) on SDA SCL lines present ?
- using 0x90 adress in program ask for A0 A1 A0 pins to be tied at GND ( from datasheet hardware adress is 1 0 0 1 A2 A1 A0 r/w). so make sure A0, A1, A2 are connected at GND (not floating -as stated in same datasheet)
- check all other connections.
- good luck.



edit:
the question was about reading an external LM75 using I2C master and the program you refered is wrote to suit that IC sensor (adress,protocol).For using with any other sensor you must adapt it.
I looked also at STM32F072RB key features and NUCLEO-F072RB board resources and I don't see any temperature sensor listed. I am wrong?
saluti.

Accepted Answer

Hello, the micro has an internal temperature sensor. the program does not use this?

posted by Andrea Valeriani 06 Jun 2015

The device temperature sensor is not sitting on the I2C bus, it is internal and the value is read using the ADC on CH16. Unfortunately this is not supported by MBED API, which only allows to connect the ADC to a pin, not to an internal sources.

posted by Maxime TEISSIER 08 Jun 2015

Ok, then execute the test with the LM35. what are the pin to be connected?

posted by Andrea Valeriani 09 Jun 2015

LM 35 is an analog sensor, very easy to use, just supply with more than 4V (so 5V from your board is OK) on Vs pin, GND common and Vout pin go to any analog in pin (A0-A5 in arduino header is OK). (use an resistor, say 10k in MCU input) Read the input, do some math, LM35 output is (temp*10mV)°C saluti

posted by Tiberiu Stoleru 09 Jun 2015

Great! Thanks

posted by Andrea Valeriani 10 Jun 2015