This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Starting out

Hi, I've being using an arduino to collect pressure measurements from the BOSCH BMP280 pressure sensor over I2C. I want to do the same using the nRF52840 and miniturize my device. I want to send the data over bluetooth to my PC. Where are the tutorials and sample code that would help me? Is there a sample project similar to this?

Parents Reply
  • Hi Vidar and awneil,
    The example
    examples\peripheral\temperature\pca10056\blank\ses\temperature_pca 10056
     works for me. It outputs temperature.
    For the TWI example twi_sensor
     I need the mbed board which I have ordered.
    In the meantime, I have connected my Bosch BMP280 pressure sensor board to the Nordic nRF5 DK board.
    VCC 5V
    GND GND
    SCL P027
    SDA P026
    When I run examples\peripheral\twi_scanner\pca10056\blank\ses
    twi_scanner_pca10056
    I get TWI device detected at address 0x76
    However, when I run twi_sensor (no mbed board but with the BMP280 pressure sensor connected), I don't see any readings although I get the output "TWI sensor example started."
    I can see two possible reasons why I'm not seeing any output.
    That example is trying to get output from an accelerometer?
    Or that example is configured with different pins for the SCL and SDA?
    Have you any ideas how I might get reading from the pressure sensor by modifying this example?
    Best regards,
    John A.
Children
  • Hi John,

    ARDUINO_SCL_PIN and ARDUINO_SDA_PIN are by default mapped to 27 and 26, respectively. So the connections are correct. The test you did with the scanner example also confirms this. The sensor would not have been detected otherwise. That said, VCC must be the same as the nRF IO voltage +-0.3V to not exceed the maximum voltage ratings of the chip (Absolute maximum ratings). 5 volt can actually cause damage to the HW. You can use the output labeled with "VDD" on the DK as supply to the sensor. This will ensure the same voltage level on both sides. VDD ranges from ~1.8v - 3v depending on your power configuration.  

    The bosch sensor has its own register addresses and commands that the example needs to be adapted to. The datasheet should include more information about how you can interact with the sensor. 

    Do you have access to a logic analyzer or scope? It's very helpful to be able to inspect the TWI transfers on the bus lines to verify that data is transmitted and received according to the datasheet.  

    Best regards,

    Vidar

Related