Teensy 3.2 and BMP

I am new to this forum and Arduino's/Teensy. This is my first post. Please be kind if this is stupid.

Have Teensy 3.2 hooked up to BMP 280. I have the following connections:

BMP VIN to Teensy 3.3
BMP GND to Teensy AGND
BMP SDI to Teensy A4
BMP SCO to Teensy A5

I am using the following sketch:

/* Arduino Tutorial - Testing the Adafruits BMP280 Presure & Temperature Sensor
I2C Connection: Vin: 5V/3V, GND: GND, SCK: A5 (SCL), SDI: A4 (SDA)
Dev: Michalis Vasilakis // Date: 8/3/206 // Info: www.ardumotive.com */

#include <Wire.h>
#include "SPI.h" //Why? Because library supports SPI and I2C connection
#include <Adafruit_Sensor.h>
#include "Adafruit_BMP280.h"

//Setup connection of the sensor
Adafruit_BMP280 bmp; // I2C
/*//For SPI connection!
#define BMP_SCK 13
#define BMP_MISO 12
#define BMP_MOSI 11
#define BMP_CS 10
//Adafruit_BMP280 bme(BMP_CS); // hardware SPI
//Adafruit_BMP280 bme(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);
*/

//Variables
float pressure; //To store the barometric pressure (Pa)
float temperature; //To store the temperature (oC)
int altimeter; //To store the altimeter (m) (you can also use it as a float variable)

void setup() {
bmp.begin(); //Begin the sensor
Serial.begin(9600); //Begin serial communication at 9600bps
Serial.println("Adafruit BMP280 test:");
}

void loop() {
//Read values from the sensor:
pressure = bmp.readPressure();
temperature = bmp.readTemperature();
altimeter = bmp.readAltitude (1050.35); //Change the "1050.35" to your city current barrometric pressure (https://www.wunderground.com)

//Print values to serial monitor:
Serial.print(F("Pressure: "));
Serial.print(pressure);
Serial.print(" Pa");
Serial.print("\t");
Serial.print(("Temp: "));
Serial.print(temperature);
Serial.print(" oC");
Serial.print("\t");
Serial.print("Altimeter: ");
Serial.print(altimeter); // this should be adjusted to your local forcase
Serial.println(" m");
delay(1000);
}

The temperature and barometric pressure on the serial monitor read "0" and the altimeter reads "44330".

I am using Windows 10 & Arduino IDE Version 1.8.13

Thanks in advance

Neal Aguillard

Have Teensy 3.2 hooked up to BMP 280. I have the following connections:

BMP VIN to Teensy 3.3
BMP GND to Teensy AGND
BMP SDI to Teensy A4
BMP SCO to Teensy A5

The BMP 280 has no SCO pin so I guess you meant SCL.

What you forgot is the interface selection. To enable the I2C interface you must connect CSB to VddIO (pull high).

As you name the BMP 280 pin VIN I must assume you don't use the BMP 280 directly but some breakout board. As we don't know what breakout board you're using and what circuitry that board carries any additional help is not possible.

Shannon:

I have SDI on the BMP280 connected to the Teensy A4 and SCK to the Teensy A5. I assumed that the Teensy A4 pin would the SDA pin and the A5 pin would be the SCL pin on the Teensy- as it is on the Arduino.

How do I connect CSB to VDDIO on the BMP280?

BTW. I'm not using a breakout board- only the BMP280 and a Teensy 3.2

TIA

Neal Aguillard

BTW. I'm not using a breakout board- only the BMP280 and a Teensy 3.2

I have some doubts. The BMP280 is a SMB only chip which cannot be soldered using a soldering iron. So I'm almost sure you're using a breakout board of some kind (the BMP280 is the little metal chip on it). We must know what board you using to know what additional circuitry it has. A link to the page you bought it might help for the moment.

How do I connect CSB to VDDIO on the BMP280?

By a direct contact. As I wrote you probably have a breakout board and I don't know how that board calls the corresponding pin.

Shannon:

Sorry. I have an Adafruit BMP280 I2C or SPI Barometric Pressure & Altitude sensor breakout board.

Neal

That board has an internal pullup of the CSB pin, so I2C should be active if the CS pin is not externally connected. The SDO pin is also pulled high, so the I2C address should be 0x77.

You should connect the BMP GND to the GND (not AGND) on the Teensy. AGND is used only as the ground potential for the analog pins of the Teensy.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.