Monday, October 15, 2012

AVR Atmega BMP085/BMP180 pressure sensor library 01

update: checked and working on BMP180 too

BMP085/BMP180 Barometric Pressure Sensor AVR Atmega library.



The BMP085 is a high-precision, low-power barometric pressure sensor.
The BMP085 offers a measuring range of 300 to 1100 hPa with an absolute accuracy of down to 0.03 hPa.

User can setup parameter in file bmp085.h.
User can select the mode of operation, and the offset for the reading, also can enable an avarage filter on measurements. It can measure pressure, altitude, and temperature.

This library was developed on Eclipse, built with avr-gcc on Atmega8 @ 1MHz.





Code


Notes
  • read risk disclaimer
  • excuse my bad english

118 comments:

  1. i compile this code for atmega328p/5V/16Mhz and its does not work. why?

    ReplyDelete
    Replies
    1. Double check your wiring, check your BMP085, even with other library.
      Then debug the bus using a logic analizer, or a simple uart terminal.

      Delete
  2. With arduino adafruit_BMP085 library - all works.
    With your library - nothing.
    I remove all code about BMP085 and testing only UART

    > #define UART_BAUD_RATE 9600
    >
    > int main (void) {
    > //init uart
    > uart_init( UART_BAUD_SELECT(UART_BAUD_RATE,F_CPU) );
    > uart_puts("Hello init!\r\n");
    > //init interrupt
    > sei();
    > }
    But this does not work again and i not see in terminal "Hello init!" :(

    ReplyDelete
    Replies
    1. So, it's not my library which is not working :), is the uart library. Which is the Peter Fleury one.
      Download his last version of the library, check that it works with your compiler / microprocessor. There are some version of his uart library that has problems with ATmega328, it might be the one i've used for this project, but i've not encountered this problem cause I've used an ATmega8.
      You could use arduino or adafruit if it works.

      Delete
  3. Thank you Davide ! It helps !
    RafaƂ, Poland

    ReplyDelete
  4. Hello again!
    I ude your library and I don't understand this part: //path to i2c fleury lib
    #include BMP085_I2CFLEURYPATH. I got an error: bmp085.c:(.text+0x356): undefined reference to `i2c_init'
    make: *** [04_LCD.elf] Error 1.
    What should I change?

    ReplyDelete
    Replies
    1. Hello,
      you have to setup the relative path to the i2c fleury library, i.e. where i2cmaster.h and twimaster.c are.

      Delete
    2. Ok, so I have folder bmp085 and there are bmp085.c and bmp085.h and folder TWI and there are i2cmaster.h and twimaster.c I wrote #include TWI/i2cmaster.h and still have error

      Delete
    3. (Here is the right position :) ), anyway, as i tell you, check the include statament of the avrgcc processor, which is fairly similar than then asci C one.
      Start a simple project, create your own blink led code, and put the blink code in an external library, and eventually folder, then use #include to compile and load the function.
      If you can not do this, if you mantain the directory structure of the code you can download here, you should not have compile errors.

      Delete
  5. Hi Davide,

    Ty for the hard work! I have a question though. I use the Arduino isp to flash my atmega. Can i still use this library and display the data on realterm this way?

    Greetz,

    Jedu

    ReplyDelete
    Replies
    1. Yes, you could flash the hex straight to you micro even using Arduino ISP, but I'm pretty sure you have to do it by command line avrdude. Note that provided here is the code of the project, you have to compile and link it, using avrgcc, then you can upload the hex generated. Data it is diasply throght uart, it doesn't mind how you upload the file to your ATmega.

      Delete
  6. Hi Davide,

    Your Library support the BMP180?, you use a Peter Fleury i2c master library, but this library have a .s (Assembly) file, it´s necessary this file?, in your source code does not have, I ask because I would use this library in a ATtiny2313

    thanks

    ReplyDelete
    Replies
    1. Hello, it depends if you would like to use the TWI hardware interface, in that case you do not need the assembly file but just the twimaster.c file. Take a look at the P.Fleury i2c library manual page here: http://homepage.hispeed.ch/peterfleury/group__pfleury__ic2master.html

      Delete
    2. I've never tryed this on the BMP180, anyway, anyway i take a look at the BMP180 sheet, and it seams to me it has the same pressure calculation alghoritm and i2c registers.. so it should work, but you have to try.

      Delete
  7. Hello, I tried to compile your code, but I got an errors in AVR Studio 4, can you give me a solution? Thank you.

    /avr/bin/ld.exe: region `text' overflowed by 18 bytes
    and
    /avr/bin/ld.exe: main.elf section `.text' will not fit in region `text'

    ReplyDelete
    Replies
    1. Hello,
      you are trying to compile the code on a micro that does not have enought space for the "text" region.
      If you are using ATmega8, check that you have linked also libmath (-lm directive on the linker command)

      Delete
    2. Hello,
      thank for your reply. I am using ATMEGA8. I tried to link libmath, but still no change. If possible, can you send me please you project file with all files? Thank you.

      Delete
    3. The download files here are just my complete project files. I can also attach you compiled hex. Send me your mail, i will reply with compiled hex for Atmega8 @ 1MHz

      Delete
    4. Thank you :) my email is bystricanp () gmail () com

      Delete
  8. Hello,

    After intitialization of bmp085_init(); I can't use my LCD. Although LCD uses totally different ports such as PORTB 0...7 for data port and PORTD 5...7 for control port. I use ATmega32 of which SDA uses PORTC1 and SDC uses PORTC0
    For clock pulse I use 3.6864MHz xtal.

    Could you please tell me what modifications i would need to do in the source files or header files to get a working code?

    http://pastebin.com/hLYjREpF

    ReplyDelete
    Replies
    1. Hello,
      It may be that the bmp05 it's not initialized the right way. Check that the bmp085 alone works, without the LCD. Debug it using the serial port. If you have a logic analizer, check the bmp085 bus. Check you sensor with another hardware. Check that the fuse are properly set up for your crystal, and that the SPI channell is properly setted.

      Delete
  9. It must have been a breadboard circuit thing. I've built it again and It now works fine. :) Congrats!

    ReplyDelete
    Replies
    1. Well, i was happy yesterday so that it seemed to work. I use noise filtering capacitors. I give 2.5V to the BMP180 (not BMP085) with 2x47k resistor voltage divider. If I burn the chip it's operating for about some minutes showing me the actual temperature, altitude, air pressure datas on the LCD. Then it gets freezed. Stops working and even after reset, LCD acts as if it was not initialized. No sign of running code. (No transmitting data on UART too) After a little while measurement datas gets randomly refreshed on the LCD. I surely know my own LCD & UART libraries are ok, because I've used them in my previous works. If I uncomment the initialization line in the main program //bmp085_init(); my avr dont get freezed. This issue happenes with both of my Atmega32. May it be possible that this library is incompatible with BMP180?

      Delete
    2. Hello, I've checked it today on a GY-68 board, which mounts a BMP180 and a voltage regulator for over 1 hour. I confirm you that it works on BMP180 too, no problem at all. Check that your supply voltage is enough for all your equipment. Check for conflict over the SPI ports of your LCD library. Check for long timer routing of your LCD. Check just the BMP180 output over UART. Then mix it to your LCD, just to exclude problems of all sorts.

      Delete
    3. Maybe it was my fault to connect the SDA, SCL pins to +5V instead of +3.3Vwith 4.7k resistors. I am without a working sensor now. I downloaded your zip files & I tested your libraries again with no sensor. Have you tied what happens when you have no sensor connected? Could you try this code please? I get no working UART communication if the sensor is initialized. Without uninitialized sensor ( //bmp085_init(); ), yes UART communication is working. http://pastebin.com/bKCfR5ZB

      Delete
    4. SDA, SCL can be pulled up to 5v through a 4k7 resistor without problem. Without sensor it does not work, cause the SPI get bloked if the Slave does not respond.

      Delete
  10. Thanks for libraries! Good job!
    I have problem with bmp85 library, my code:

    long l;
    double d;
    char printbuff[10];

    //get pressure
    l = bmp085_getpressure();
    ltoa(l, printbuff, 10);

    lcd_clrscr();
    lcd_gotoxy(1, 3); //znak,radek
    lcd_puts(printbuff);

    _delay_ms(8000);

    from debugger:
    l 0x00000000 long{registers}@ R25 R24 R23 R22
    +display show number 0,

    I didnt change anything in libraries bmp85/I2C. I have Atmega32, bmp180.

    Can you help me please?

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. Hello,
      at a first view, "bmp085_init" is missing. Anyway double check your wiring, also check your fuse. Check that the sensor works with other hardware. At a first step, use the sample mail file and output to uart, That way you will be shure if it is the LCD library or the bmp085 one that does not work.

      Delete
    4. Hello david, Can you please put a code for ATMEGA32A. Because I'm working with it.
      Thank you.

      Delete
    5. Hello, this code should work with litte modification on ATmega32A but unluckly you have to mod this. If you do this, please share your code as pastebin or gist page here.

      Delete
  11. the same code will work for bmp180?

    ReplyDelete
    Replies
    1. Hello. Yes. Tested on a BMP180 board and working.

      Delete
    2. what changes to be made in the main.c file

      Delete
    3. No change needs to be made. Just compile it with avrgcc. You can find a lot of tutorial online that teach how to compile with avrgcc.

      Delete
  12. error is "undefined reference to main".
    make.exe:***[main.elf] Error 1

    ReplyDelete
    Replies
    1. It's a compiler error, i suppose you are not linking or compiling the right way.

      Delete
    2. i have added the relevant files in the project
      in the makefile i have added all these files in the SRC type
      and then i compiled

      is there a way you can help me to fix this

      Delete
    3. When you said project, what project do you mean?
      If you use Eclipse IDE with AVR plugin, and avrgcc compliler, just create a new AVR project, add all the src file provided as src files. Select the proper ATmega micro, and F_CPU in the project properties. Select Relese as the default building ouput. Then Build the project.

      Delete
    4. This project it is tested on WinAVR 20100110, and working. A note: please do not flood with comments this blogpost, try to write comments that can be helpfull for other user too, full descriptive comments usually are simpler for user to read.

      Delete
    5. thanks for the help but still the error exists but thanks for all the help

      Delete
    6. If it helps, this is my Eclipse project file (48h expiration link): http://expirebox.com/download/b8169375f5768b3061d95f467327cdb8.html

      Delete
  13. hello david.
    i want to display only the pressure readings on the lcd display and i have ATMega32A
    please help me step by step
    i am totally new to this
    this is my first project

    ReplyDelete
    Replies
    1. Hello, you can start by the sample you find in this project. And of course the sample of an LCD library, my suggestion is the Peter Fleury one. But, if you are really a beginner, the Arduino project may be your friend.

      Delete
  14. Can you please give code for mpu6050 with atmega ..Just want to read data from mpu6050 ...And thanks for this code

    ReplyDelete
    Replies
    1. Hello. You can find the code for the mpu6050 library here: http://davidegironi.blogspot.it/2013/02/avr-atmega-mpu6050-gyroscope-and.html
      Read accelerometer and gyro data from the mpu6050, and pressure data from this sensor. I2C allows multiple sensors (with different address) on the same bus.

      Delete
  15. Hello Davide, did you remove the code? I can't seem to find it!
    Thanks in advance

    ReplyDelete
    Replies
    1. Hello, no it's google code that changed what should be a permalink. Anyway, you can find that code on page 3 of the downloads. Newer project will be submitted on github or sourceforge.

      Delete
  16. Hi Davide,

    I modify your library for the BMP180. I have a reading of 71525 Pa, which is (following the formula in the datasheet) = approx 2400m ... but I live in the city at sea level... Is your reading correct? Are you actually almost 300m above the sea level? Thanks!

    ReplyDelete
    Replies
    1. Hello, I've checked right now the library with a low cost BMP085 and another BMP180 board where i live now. According to my local weather service, I'm actually at 1025.2 hPa. Both the board gives almost the same result of my weather service, almost 100235 one board, 100255 Pa the other.

      Delete
  17. Why did you use value 0.0000225577 in your code? Shouldn't it be 0.0000225580?

    ReplyDelete
    Replies
    1. I've never encouter the 0.0000225580 constant. In troposhpere p = 101325 x (1 - 0.0000225577 x h)^5.25588. Anyway i a nano round will not make substatial difference here.

      Delete
    2. In my reply above here, that's the value I've always encounter, anyway I'm not a atmospheric physics expert, so I may be wrong.

      Delete
  18. Maybe not, but this comes from straight from Bosch data sheet, so I was wondering why your figure is different than that. Your lib works very well, but I'll change this value anyway to 0.0000225580. Thanks!

    ReplyDelete
    Replies
    1. Thank you for your feedback, it may helps someother, and it is usefull to me too!

      Delete
  19. Hi Davide,

    I have problem with wrong values returned from BMP085.
    This is what I get from the sensor:

    T:-92.10 [C], C:1194889728 [hPa]

    I use Atmega16A with exernal clock 16 MHz and send all values by bluetooth module.
    I changed in your code only line 17 in 'twinmaster.c' to:
    #define F_CPU 16000000UL

    Do you have any idea why these values are wrong?

    Cheers,
    Mateusz

    ReplyDelete
    Replies
    1. Hello, have you check the raw register values? Can you check this by wired UART?

      Delete
    2. I have checked this yesterday and the values were 'normal'. Its weird, because I didn't change enything.

      But I have another 'problem' The pressure returning from BMP085 shows something like:
      800hPa (Altitude ~1800 m under sea level), but I live in place where is ~220 m under sea level.

      Do you have any idea?

      Delete
    3. Additionaly the temperature is about 1,2 Celcius degree too low (I compared with temp from dht11 and ds18b20)

      Delete
    4. Hello, about the temperature shift, between (average on datasheet) 0 and 50C DTH11 it's a +-2C and DS18B20 it's +-0.5C, BMP850 it's +-1C, so it could be a valid temperature drift. About the barometric values.. what are values you get from your local weather (online) station?

      Delete
    5. Temperature - ok, it might be problem with accuracy.

      Pressure from local weather station is about 1005 hPa (but this is normalized pressure in terms sea level) My pressure is almost 200 hPa lower.

      Delete
    6. I cheated a little bit, because I have added this 200 hPa in main loop, but... seems like bmp085 returning still wrong values:
      today I have checked pressure in my city:1001 hPa, but my pressure is 1111 hpa (notice: 2 days ago outside was 1112 hpa, so I 'setup' == added in main loop value, to result be the same: 1112 hpa)
      Today differences between local station and BMP085 is 10 hpa... My senson measured the same value 2 days ago and today

      Delete
    7. I do not understaind the pressure part. Do you mean your sensor needs a 200hPA offset in order to be 10hPA far away from your local nearest station?

      Delete
  20. Hi Davide,
    your lib workes almost out of the box. Thanks for your work.
    But with my BMP180 and ATmega644 @16MHz I get ridiculous pressure readings of about 550 hPa. The temperature workes fine for me.

    With the Adafruit BMP085 lib and my Teensy 3.1 the pressure reading is ok (about 1015 hPa).
    Do you have any idea how to fix that?

    My Code:
    #define F_CPU 16000000UL

    #define checkbit(var,bit) (var &(1<
    #include
    #include
    #include
    #include
    #include
    #include
    #include "i2cmaster.h"
    #include "i2clcd.h"
    #include "bmp085.h"


    void display_init(void){

    lcd_init();
    lcd_command(LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKINGOFF);
    lcd_light(true);

    lcd_printlc(1,1,"Projekt Funk");
    lcd_printlc(3,1,"Temp. : ");
    lcd_printlc(4,1,"A Pr. : ");

    _delay_ms(50);
    }


    int main(void) {


    DDRA = 0b00000000;
    DDRB = 0b11111111;
    DDRC = 0b11111111;
    DDRD = 0b11111111;

    PORTA = 0b00000000;
    PORTB = 0b00000000;
    PORTC = 0b00000000;
    PORTD = 0b00000000;

    sei();

    char printbuff[100];
    long l;
    double d;

    i2c_init();
    display_init();
    bmp085_init();


    while (1) {
    d = bmp085_gettemperature();
    dtostrf(d, 6, 2, printbuff);
    lcd_printlc(3, 9, printbuff);
    lcd_print_p(" \337C");
    _delay_ms(10);

    l = bmp085_getpressure();
    ltoa(l, printbuff, 10);
    lcd_printlc(4 ,8," ");
    lcd_printlc(4, 9, printbuff);
    lcd_print_p(" Pa");
    _delay_ms(10);

    d = bmp085_getaltitude();
    dtostrf(d, 8, 2, printbuff);
    lcd_printlc(2, 1, printbuff);
    lcd_print_p(" m");
    _delay_ms(500);
    }
    }

    ReplyDelete
    Replies
    1. Hello, unluckly I do not have a ATmega644 to test it with. Have you checked it at other running frequency (1Mhz, 8Mhz...)? It may be a problem related to F_CPU. Also, check the bus between the Teensy and the Sensor using a logic analyser, and check it with my library the ATmega.

      Delete
    2. Yep, F_CPU in the main.c was causing the problem.
      If I declare F_CPU in the project properties, it workes.
      Thank you.

      Delete
    3. You're welcome. Happy to hear that! :)

      Delete
  21. Hi Davide ,

    Thanks for sharing your great experiment.I could the find the files of the project .Could you help me ?
    Thanks

    ReplyDelete
    Replies
    1. Hello and thank you. You can find files in the download link above in the post, page 3.

      Delete
  22. man, you are my hero! :') thx for your effort, that's helping me alooooot, realy, thanks aloooooot :DD worked perfectly

    ReplyDelete
    Replies
    1. Hello Tarcis, thank you for your feedback, it makes me happy!

      Delete
  23. Ciao, sto per usare il BMP180 e vorrei chiederti delle info.
    Uso un ATMEGA16, quando uso il sensore con la sua libreria, devo attivare i pin di della I2C e poi lui gestisce tutto tramite la libreria?

    ReplyDelete
    Replies
    1. Ciao, il protocollo e canale di comunicazione Ăš I2C.

      Delete
    2. Quindi Ăš necessario attivare il protocollo sull'ATMEGA e poi usare le funzioni della libreria del sensore?

      Delete
    3. Ciao, non proprio "attivare il protocollo" quanto piĂč utilizzare i registri appropriati per comandare le linee SCL SDA secondo il protocollo I2C. Il file che scarichi contiene giĂ  una libreria di gestione I2C, il sample di default (main.c) la utilizza per comandare il sensore.

      Delete
  24. Ok quindi devo soltanto collegare il sensore, caricare le librerie necessarie e prelevare i dati che mi servono dai registri opportuni?

    ReplyDelete
    Replies
    1. Circa come dici tu, in realtĂ  non Ăš solo leggere dagli opportuni registri, ma scrivere anche alcuni registri per comandare il sensore nella emissione dei dati.

      Delete
  25. Ok capito. Che programma hai usato? Io sto usando codevisionavr 2.05 e se provo a compilare mi dice che ho una versione vecchia di AVR-GCC e che la libreria Uart non la puĂČ usare.

    ReplyDelete
    Replies
    1. Compilatore avrgcc su IDE Eclipse + AVR plugin. La libreria uart Ăš possibile che sia da aggiornare, scarica la nuova dal sito di P.Fluery.

      Delete
  26. Ho compilato tutto correttamente perĂČ una volta che vado con realterm ho problemi. Ricevo dati perĂČ non come la tua immagine in questo post. Cosa potrebbe essere? Ho settato il baud rate a 2400 come scritto nel codice ma niente

    ReplyDelete
    Replies
    1. Ciao la F_CPU con cui hai compilato, o la baudrate. Prima di tutto ti consiglio di testare la sola libreria uart, semplicemente inizializzandola ed inviando ogni secondo una stringa di testo.. una volta che funziona passerei a testare la libreria del sensore.

      Delete
    2. Ho provato a testare la uart come ha fatto uno dei primi utenti che ha commentato:
      > #define UART_BAUD_RATE 9600
      >
      > int main (void) {
      > //init uart
      > uart_init( UART_BAUD_SELECT(UART_BAUD_RATE,F_CPU) );
      > uart_puts("Hello init!\r\n");
      > //init interrupt
      > sei();
      > }

      E non va, il terminale mi mostra sempre caratteri strani.

      Delete
    3. Potrebbe perciĂČ dipendere dai set di frequenza impostati al momento della compilazione, inoltre controlla che i fuse e quindi la velocitĂ  impostata del micro sia coerente con il codice compilato (http://www.engbedded.com/fusecalc/)

      Delete
  27. I was just trying this library for Atmega32 with winavr 20100110 and eclipse
    I always have this error (make: *** [HBMP180_Library_Test.elf] Error 1)
    What should I do?

    ReplyDelete
    Replies
    1. Hello, you should at first try to compile it for ATmega8, then, if it works on ATmega8, try to build it for the mega32.

      Delete
  28. This comment has been removed by the author.

    ReplyDelete
  29. Hi David, Thanks for your libraries, your codes works OOB with my BMP180 sensor with ATmega8A @8MHz. I'm using Peter's software i2c library. I'm only monitoring Air Pressure and Altitude currently(using DHT22 for Temp using your dht library).

    Now, I'm getting around 101750Pa which I believe to be right. But I'm getting around -35.58 meter as my altitude which seems to be wrong as I'm at 2nd floor of a building at Kolkata, India.

    Any ideas are welcome...

    ReplyDelete
    Replies
    1. Hello Suprio. Happy to hear that it works. In a few words, you have to set the offset cause pressure changes with weather. Here you can find a pretty simple explanation of what happens: https://learn.adafruit.com/bmp085/using-the-bmp085. In my driver you can find a macro offset BMP085_UNITMOFFSET, but a better solution would be to offset the altitude outside the function, that way you can offset it using a user filled altitude.

      Delete
    2. This comment has been removed by a blog administrator.

      Delete
  30. Thanks David for your prompt response, I'll surely check for that.

    Another question, I'm using 4 libraries in my current project 1 for HD44780U LCD, another 1 is Peter's i2c and rest are your DHT and BMP libraries. They look up more than 80% of the program memory of 8KB of my AVR just to display the Temp and Humidity from DHT and Pressure and Alt from BMP. Is this normal? The LCD lib look around 5% of program mem.

    Please pardon me if my query sounds weird as I'm basically as Assembly Programmer recently switched to C, and I'm still not an expert in it.

    ReplyDelete
    Replies
    1. hi suprio_K_Kundu sir
      please send me the code file zip of bmp 180 as i need it for my project
      thank you..

      Delete
  31. This comment has been removed by the author.

    ReplyDelete
  32. hi sir
    i want code for bmp 180 for atmega 16 please help me sir
    thank you
    do message me on watsapp +91 9441516627
    thank you

    ReplyDelete
    Replies
    1. Dear eswar, I do not have any ATmega16 to test this code against, you have to port this library to ATmega16, it would not be so difficult.

      Delete
    2. Hi davide sir
      Im new here can u help me converting it
      Im using atmega16a as microcontroller..
      Thank you...

      Delete
    3. Dear eswar, it's so simple, just compile it with ATmega16 as the target MCPU, it should work.

      Delete
    4. Hi sir
      Im using avr studio 4
      I copied the main.c file into a new project with atmega 16 as micro controller
      And i coppied all rest headers and c files into the same folder
      But im getting the errors saying
      Undefined refence uart_puts,bmp085_getaltitude ect....
      How can i resolve these...
      Thank uou..

      Delete
    5. Sir please help me resolve it sir please thank you..

      Delete
    6. It's not an MCPU error, it's likely you are not adding files in your project the right way. Take a look here: https://www.avrfreaks.net/forum/undefined-reference-function-error
      Or you can use Eclipse with AVR plugin or VS Studio Code with Platform.IO that are much more simpler and lighter IMHO.

      Delete
    7. Hi sir
      I resolved all the issues
      But im notting the out put
      I tried all baud rates but nothing is printing on serial monitor please help me sir..

      Thank you...

      Delete
    8. This comment has been removed by a blog administrator.

      Delete
    9. Sir please help me resolve the issue sir please thank you....

      Delete
    10. Dear eswar, posting question many times will not guranteee you many answers. You should at first check the UART comunication using the UART P.Fleury library as example. For further info on that you could find many usefull information on the AVRFreaks forum.

      Delete
    11. Sorry for that davide sir
      Sir how can i know whether my bmp180 sensor is working or not?
      Coz what ever code i may use no results
      Is their any way by which i can check wheather the sensor is working or not ??
      Thank you...

      Delete
    12. Hi sir the sensor and code is working fine
      Need a small help
      Wgere can i find sample code for atmega 16 for sensor max 30102 for getting bpm and spo2
      Thank you...

      Delete
    13. Dear eswar, you can check working condition of your bmp180 pressure sensor by changing the sensor pressure, you will find out that it will be very very easy: https://en.wikipedia.org/wiki/Atmospheric_pressure. Never used MAX30102, guess google will help.

      Delete
    14. Hi davide sir...
      Which will be better to use sir
      Need the bpm and spo2...
      Thank you

      Delete
    15. Davide sir please do reply sir..
      which sensor will be best and if possible do send me link of sample code
      Even only beats per min will be enough thank you...

      Delete
    16. Dear eswar, I never need to read oxygen saturation, so I can not suggest you that kind of sensor. Sorry about that.

      Delete
  33. This comment has been removed by a blog administrator.

    ReplyDelete
  34. Hi sir,
    I compile you'r code on with a BMP180 AVR328P with no error.
    But when i connect the datavizualize nothing happen ?
    Can you help me ?
    Thanks

    ReplyDelete
    Replies
    1. Hello, you have to check at first your uart port communication.

      Delete