cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in reading data from a pressure sensor

PReba.1
Associate

Hi!

I'm new to embedded programming and I'm trying to write a minimal program using I2C to read data from a pressure sensor.

I'm using the STM32F429 board and the Sen-16476 Sparkfun pressure sensor.

I'm unsure about which pins I need to connect between the sensor and the board, and how I should read the data in my cpp program. I've tried all combinations of connections and read addresses and nothing seems to work.

I'd appreciate any help/code snippets to just get the basic reading of the sensor. Thank you!

2 REPLIES 2

What STM32F429 board? The DISCO?

Wire 3V3, GND, SCL, SDA

Find available I2C interface pins on the STM32, check the manual/schematic

Address in STM32 space likely (0x18 << 1)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Foued_KH
ST Employee

Hello @PReba.1​,

First of all you need to set the configuration of the I2C for the communication based on STM32CubeMX :

  • You can choose the Standard mode 100 KHz or the Fast mode 400 KHz.

0693W00000WLAxcQAH.png

  • Set the GPIO at the PULL-UP :

0693W00000WLAyGQAX.pngThen generate The code.

The I2C address of the sensor : 0x18

Supply voltage : 1.6V - 3V6

Connect the  3V3, GND, SCL, SDA.

Foued.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.