Problem Interfacing SMD500 SENSOR UNING I2C

I'm trying to measure pressure and temperature using SMD500 sensor. I used I2C to communicate method, 2 pins interface. The Connection was set as follows:

  • VCC of the SMD500 sensor to 3.3V
  • Connect GND to Ground
    -Connect SCL to i2c clock - on Arduino Uno Analog 5
    -Connect SDA to i2c data - on Arduino Uno Analog 4

The used code for similar sensor is shown below:

#include <Adafruit_BMP085.h>

/*************************************************** 
  This is an example for the BMP085 Barometric Pressure & Temp Sensor

  Designed specifically to work with the Adafruit BMP085 Breakout 
  ----> https://www.adafruit.com/products/391

  These pressure and temperature sensors use I2C to communicate, 2 pins
  are required to interface
  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution
 ****************************************************/

// Connect VCC of the BMP085 sensor to 3.3V (NOT 5.0V!)
// Connect GND to Ground
// Connect SCL to i2c clock - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 5
// Connect SDA to i2c data - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 4
// EOC is not used, it signifies an end of conversion
// XCLR is a reset pin, also not used here

Adafruit_BMP085 bmp;
  
void setup() {
  Serial.begin(9600);
  if (!bmp.begin(0x77)) {
	Serial.println("Could not find a valid BMP085 sensor, check wiring!");
	while (1) {}
  }
}
  
void loop() {
    Serial.print("Temperature = ");
    Serial.print(bmp.readTemperature());
    Serial.println(" *C");
    
    Serial.print("Pressure = ");
    Serial.print(bmp.readPressure());
    Serial.println(" Pa");
    
    // Calculate altitude assuming 'standard' barometric
    // pressure of 1013.25 millibar = 101325 Pascal
    Serial.print("Altitude = ");
    Serial.print(bmp.readAltitude());
    Serial.println(" meters");

    Serial.print("Pressure at sealevel (calculated) = ");
    Serial.print(bmp.readSealevelPressure());
    Serial.println(" Pa");

  // you can get a more precise measurement of altitude
  // if you know the current sea level pressure which will
  // vary with weather and such. If it is 1015 millibars
  // that is equal to 101500 Pascals.
    Serial.print("Real altitude = ");
    Serial.print(bmp.readAltitude(101500));
    Serial.println(" meters");
    
    Serial.println();
    delay(500);
}

However, the result at the console is illogic:

Temperature = 0.00 *C
Pressure = 235 Pa
Altitude = 30355.89 meters

I looked for solving this problem, I found that the sensor needs master clock input 32768 Hz. However, I don't know how to generate this clock.

Please, help me to solve this problem as soon as possible.

Kindly, find the datasheet for SMD500 sensor.

smd500 datasheet

Youll need a clock oscillator. Hopefully with a crystal but the timing spec is loose 3%.
A 555 timer and a few analog parts should be able to run @ 32kHz.
555 calculator

Simple xtal osc:
Crystal-Oscillator

Have you considered a BME280 instead? No external clock needed.

Are you sure the I2C pins on the sensor are 5V tolerant?
You could pull them up to 3V3 instead, usually the UNO will still read it correctly, but it's a bit out of the normal operating range.

The 555 is a better option; looks to me the clock pin on that sensor is not a crystal oscillator input, but a lower impedance clock input.
Or just make a clock with the Arduino and a timer.

A software timer has too much jitter and millis isn’t fast enough to gen 32kHz, much less 1MHz.

One of the hardware timers would do nicely, though.

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