Cant get SPL06_007 to work with uno

hey community , im having a problem with the SPL06-007 Barometric Pressure Sensor from jaycar AUS , basically i cant get the SPL06 to work properly even with v701's library , i have looked in to the problem over a couple of days and from what i can see its caused by it being coded for an esp32 and not for an Arduino ,now i did find a post by an other member on here that had basically the same issue and got it to work on the Uno they had, here's the post link: Lilygo T-Beam with SPL06-007 Barometric Pressure Sensor problem.._gaMjA4ODYyMDg1Mi4xNzM4NjQyNjUz*_ga_NEXN8H46L5*MTczODY0MjY1Mi4xLjAuMTczODY0MjY1Mi4wLjAuNjE4NDAzMQ..

unfortunately i don't have an actual uno hand just a r3 clone with the CH340G driver and SMD Atmega328P i will provide a clear pic in the comments for reference , but i got it from TEMU in Australia ( please for give me Arduino gods ) work fine just had to update the ch340G drivers for it to work , im trying to get the SPL06-007 to work internal but it wont even read the temp and altitude or pressure like i was saying from what rv701 said in his GitHub post with the attached library its made for esp32 but will "Need to convert to a standard Arduino library format. Code was developed and tested on an ESP32 microcontroller." , how do i even get theSPL06-007 to run on Arduino ? i have plans to implement the SPL in the some projects but i cant even get it to return correct data let alone implement in personally , i tried to "fix" the coeffects by replaces the whole .cpp and . h files with the ones found in the aforementioned linked post but it returns this in the serial monitor

ID: 255

PRS_CFG: 11111111

TMP_CFG: 11111111

MEAS_CFG: 11111111

CFG_REG: 11111111

INT_STS: 11111111

FIFO_STS: 11111111

c0: -1

c1: -1

c00: -16

c10: -1

c01: -1

c11: -1

c20: -1

c21: -1

c30: -1

traw: -1

traw_sc: -0.000

Temperature: -0.50 C

Temperature: 31.10 F

praw: -1

praw_sc: -0.000

pcomp: -16.00

Measured Air Pressure: -0.16 mb

Local Airport Sea Level Pressure: 1011.30 mb

altitude: nan m

altitude: nan ft

if some one is able help me it would be appreciated as the only thing i have find is its coded wrong for Arduino

the code that im using is rv701's:


```cpp
#include <SPL06-007.h>
#include <Wire.h>


void setup() {
  Wire.begin();          // begin Wire(I2C)
  Serial.begin(115200);  // begin Serial

  Serial.println("\nGoertek-SPL06-007 Demo\n");

  SPL_init();  // Setup initial SPL chip registers
}

void loop() {

  // ---- Register Values ----------------
  Serial.print("ID: ");
  Serial.println(get_spl_id());

  Serial.print("PRS_CFG: ");
  Serial.println(get_spl_prs_cfg(), BIN);

  Serial.print("TMP_CFG: ");
  Serial.println(get_spl_tmp_cfg(), BIN);

  Serial.print("MEAS_CFG: ");
  Serial.println(get_spl_meas_cfg(), BIN);

  Serial.print("CFG_REG: ");
  Serial.println(get_spl_cfg_reg(), BIN);

  Serial.print("INT_STS: ");
  Serial.println(get_spl_int_sts(), BIN);

  Serial.print("FIFO_STS: ");
  Serial.println(get_spl_fifo_sts(), BIN);


  // ---- Coefficients ----------------
  Serial.print("c0: ");
  Serial.println(get_c0());

  Serial.print("c1: ");
  Serial.println(get_c1());

  Serial.print("c00: ");
  Serial.println(get_c00());

  Serial.print("c10: ");
  Serial.println(get_c10());

  Serial.print("c01: ");
  Serial.println(get_c01());

  Serial.print("c11: ");
  Serial.println(get_c11());

  Serial.print("c20: ");
  Serial.println(get_c20());

  Serial.print("c21: ");
  Serial.println(get_c21());

  Serial.print("c30: ");
  Serial.println(get_c30());


  // ---- Temperature Values ----------------
  Serial.print("traw: ");
  Serial.println(get_traw());

  Serial.print("traw_sc: ");
  Serial.println(get_traw_sc(), 3);

  Serial.print("Temperature: ");
  Serial.print(get_temp_c());
  Serial.println(" C");

  Serial.print("Temperature: ");
  Serial.print(get_temp_f());
  Serial.println(" F");


  // ---- Pressure Values ----------------
  Serial.print("praw: ");
  Serial.println(get_praw());

  Serial.print("praw_sc: ");
  Serial.println(get_praw_sc(), 3);

  Serial.print("pcomp: ");
  Serial.println(get_pcomp(), 2);

  Serial.print("Measured Air Pressure: ");
  Serial.print(get_pressure(), 2);
  Serial.println(" mb");


  // ---- Altitude Values ----------------
  double local_pressure = 1011.3;  // Look up local sea level pressure on google // Local pressure from airport website 8/22
  Serial.print("Local Airport Sea Level Pressure: ");
  Serial.print(local_pressure, 2);
  Serial.println(" mb");

  Serial.print("altitude: ");
  Serial.print(get_altitude(get_pressure(), local_pressure), 1);
  Serial.println(" m");

  Serial.print("altitude: ");
  Serial.print(get_altitude_f(get_pressure(), local_pressure), 1);  // convert from meters to feet
  Serial.println(" ft");



  Serial.println("\n");
  delay(2000);
}

R3 clone I'm using

Run the I2C scanner sketch to check if the sensor can be found.
In the Arduino IDE click on File->Examples->Wire and select i2C_scanner

i checked and it is returning with a 0x76 address so it can be found

That good, so at least you know the connections and the module are good.
So there must be something wrong with your code.
In the IDE, click on Edit then Copy for Forum, that will copy your code. Then came back here and just do a simple paste.

i did provide the code in the post but i am new to the forums and completely self taught so forgive me if the post contained rookie errors but heres rv701"s code i was using , i believe from what i have found , the main issue is the code is not meant for the Uno as its for an esp32 but needs to be converted for Arduino ,


```cpp
#include <SPL06-007.h>
#include <Wire.h>


void setup() {
  Wire.begin();          // begin Wire(I2C)
  Serial.begin(115200);  // begin Serial

  Serial.println("\nGoertek-SPL06-007 Demo\n");

  SPL_init();  // Setup initial SPL chip registers
}

void loop() {

  // ---- Register Values ----------------
  Serial.print("ID: ");
  Serial.println(get_spl_id());

  Serial.print("PRS_CFG: ");
  Serial.println(get_spl_prs_cfg(), BIN);

  Serial.print("TMP_CFG: ");
  Serial.println(get_spl_tmp_cfg(), BIN);

  Serial.print("MEAS_CFG: ");
  Serial.println(get_spl_meas_cfg(), BIN);

  Serial.print("CFG_REG: ");
  Serial.println(get_spl_cfg_reg(), BIN);

  Serial.print("INT_STS: ");
  Serial.println(get_spl_int_sts(), BIN);

  Serial.print("FIFO_STS: ");
  Serial.println(get_spl_fifo_sts(), BIN);


  // ---- Coefficients ----------------
  Serial.print("c0: ");
  Serial.println(get_c0());

  Serial.print("c1: ");
  Serial.println(get_c1());

  Serial.print("c00: ");
  Serial.println(get_c00());

  Serial.print("c10: ");
  Serial.println(get_c10());

  Serial.print("c01: ");
  Serial.println(get_c01());

  Serial.print("c11: ");
  Serial.println(get_c11());

  Serial.print("c20: ");
  Serial.println(get_c20());

  Serial.print("c21: ");
  Serial.println(get_c21());

  Serial.print("c30: ");
  Serial.println(get_c30());


  // ---- Temperature Values ----------------
  Serial.print("traw: ");
  Serial.println(get_traw());

  Serial.print("traw_sc: ");
  Serial.println(get_traw_sc(), 3);

  Serial.print("Temperature: ");
  Serial.print(get_temp_c());
  Serial.println(" C");

  Serial.print("Temperature: ");
  Serial.print(get_temp_f());
  Serial.println(" F");


  // ---- Pressure Values ----------------
  Serial.print("praw: ");
  Serial.println(get_praw());

  Serial.print("praw_sc: ");
  Serial.println(get_praw_sc(), 3);

  Serial.print("pcomp: ");
  Serial.println(get_pcomp(), 2);

  Serial.print("Measured Air Pressure: ");
  Serial.print(get_pressure(), 2);
  Serial.println(" mb");


  // ---- Altitude Values ----------------
  double local_pressure = 1011.3;  // Look up local sea level pressure on google // Local pressure from airport website 8/22
  Serial.print("Local Airport Sea Level Pressure: ");
  Serial.print(local_pressure, 2);
  Serial.println(" mb");

  Serial.print("altitude: ");
  Serial.print(get_altitude(get_pressure(), local_pressure), 1);
  Serial.println(" m");

  Serial.print("altitude: ");
  Serial.print(get_altitude_f(get_pressure(), local_pressure), 1);  // convert from meters to feet
  Serial.println(" ft");



  Serial.println("\n");
  delay(2000);
}

I would delete any files you have modified and re-install the library.
Then use the example code as is

after a delete and reinstall i get this in the serial monitor

ID: 16

PRS_CFG: 11

TMP_CFG: 10000011

MEAS_CFG: 11110111

CFG_REG: 0

INT_STS: 0

FIFO_STS: 0

c0: 201

c1: -257

c00: 77440

c10: 998476

c01: -3212

c11: 1176

c20: -9148

c21: 15

c30: -1213

traw: 2301102

traw_sc: 0.293

Temperature: 25.30 C

Temperature: 77.54 F

praw: -4095758

praw_sc: -0.521

pcomp: -445996.65

Measured Air Pressure: -4459.97 mb

Local Airport Sea Level Pressure: 1011.30 mb

altitude: nan m

altitude: nan ft

this output was my main reason behind changing the .cpp and .h files to the ones in the post i mentioned

Either you did it wrong or the post was wrong.
I don't experience with that paticular pressure sensor, so I'm not exactly sure how you calibrate it.
The ID is correct and the temperature seem reasonable, so it seem like the hardware is OK and the library is commumicating with the sensor.

In the GitHub description for the library it does say it needs to be converted in what ever regards for it work with Arduino, unfortunately rv701s library is the only library that works remotely close with the SPL06-007 , I know the sensor works and talks to the clone and Configs do some what work

I didn't see that anywhere.
Are you using this library

Can't see if it's the same library.
Please give the web address

seem to have the same spelling error ... (for what it is worth)

yeah, i confirm jim-p you and i are reading the same docs, in the last 10 mins of checking the docs i did find a "pull request " with notes saying its a number problem in the handing of the coeffects and the fact that its for esp's 32 bit system and the duo being 16 bit i have linked the exact docs i was reading , i am heavily open to correction on this so feel free to correct me if I'm wrong . its late for me at the moment but i will do an update in the original post on some more info i have found about the SPL06-007 its self in the morning but is still have not tested the attached finds .

OK, well the library is 5 years old and the last update was 4 years ago with no effort to make it compatible.

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