Portable Altimeter using Arduino and pressure sensor (MPL3115A2)

Поделиться
HTML-код
  • Опубликовано: 18 сен 2024
  • This video shows you how ta make a poratble altimeter based on the pressure sensor MPL3115A2, using an arduino nano.
    If you have any questions, ask in the comments !
    ////////////////////////////////////////////////////////////////////////////////////////////
    pull down resistor for the push button of 10kohms
    1khm for MPL3115A2
    arduino nano:
    fr.aliexpress....
    7 digits diplay TM1637:
    fr.aliexpress....
    pressure sensor MPL3115A2:
    fr.aliexpress....
    battery:
    fr.aliexpress....
    pcb board:
    fr.aliexpress....
    7 segments display TM1637 library:
    github.com/ree...
    Pressure Sensor MPL3115A2 library:
    github.com/spa...
    Music:
    • Adventures - A Himitsu...
    TM1637 library :
    github.com/ree...
    SparkFunMPL3115A2 library :
    github.com/spa...
    //////////////////////////////////////////////////////////////////////////////////////////
    Arduino code + additional libraries:
    www.dropbox.co...

Комментарии • 65

  • @KusalWijesingha
    @KusalWijesingha 6 лет назад +2

    if you can to add wireless transmitter to transmit the data to ground arduino with a display then it will be very useful and we can see the alti in real time while controlling the quad... (adding nrf24i01wireless transmitter module )

    • @mrpoulay6121
      @mrpoulay6121  6 лет назад

      Hi Kusal !
      Sure it will avoid putting electronics in front of the quad and thus unbalancing the quad. However, do you think this module can transmit on such a big distance?
      In addition, this module is emitting on a 2.4Ghz frequency which is the same frequency that the radio control of the drone so maybe it is not the best idea.

  • @mrjroxas416
    @mrjroxas416 6 лет назад +2

    how do I see the altitude of my model rocket without having to use a camera to see what the rockets max altitude? Many thanks, and by the way, an amazing video. Much more helpful than most others.

    • @mrpoulay6121
      @mrpoulay6121  6 лет назад +2

      Hi JRoxas,
      After your flight, pressing the push button will give you the max altitude reached.
      However if you want to get the altitude in real time, you should add a wireless transmitter in order to get the altitude during the flight. For example you could use a LoRa module, which is an RF transmitter Arduino friendly module:
      www.banggood.com/LoRa-SX1278-Long-Range-RF-Wireless-Power-Mental-Module-For-Arduino-p-1159089.html?gmcCountry=CH¤cy=CHF&gclid=Cj0KCQjwgMnYBRDRARIsANC2dfkHt7C3QBMqbzefDvrYkRAWZaX9cpK06ZGuho8brwXCC3HaL3keOj8aAmoTEALw_wcB&stayold=1&cur_warehouse=CN
      I did not try it myself but it should works fine.

    • @ganeshgoli2426
      @ganeshgoli2426 4 года назад

      @@mrpoulay6121 i was thinking to put the pressure sensor in some vacuum container and apply pressure using some pressure pump will it work? if yes then how much pressure will it sustain

    • @mrpoulay6121
      @mrpoulay6121  4 года назад +2

      @@ganeshgoli2426 As long as your container is airtight, it should be fine.
      The pressure sensor works between 20 to 110kPa. Outside this range, you will have wrong values.

    • @ganeshgoli2426
      @ganeshgoli2426 4 года назад +2

      @@mrpoulay6121 ok thnks bro..

  • @Independentscientist
    @Independentscientist 5 лет назад +1

    Which is maximum altitude attained by the sensor in display

    • @mrpoulay6121
      @mrpoulay6121  5 лет назад

      It was 299m

    • @Independentscientist
      @Independentscientist 5 лет назад

      @@mrpoulay6121 I need to use this divice in near space. So I need 700000 feet measurement. How can I measure

    • @mrpoulay6121
      @mrpoulay6121  5 лет назад +1

      @@Independentscientist The altimeter used cannot measure properly a pressure inferior of 110kPa which is around 11km.
      I would recommend you to use a GPS. GPS satellite circle the earth at around 20000km which is way behond your objective. So check in that direction and be careful with the temperature and range specification (it can be quite hot or cold up there).

  • @MrBobWareham
    @MrBobWareham 4 года назад

    Very nice project well done

  • @Jester75y
    @Jester75y 5 лет назад

    Cool video, but it looks like the I2C pull down resistors are not placed correctly. The resistors should not be between the altimeter and the arduino. The altimeter and the arduino should be directly connected, the pull down resistors should be connected from the I2C data lines to GND to pull down the signal when it's low.

    • @mrpoulay6121
      @mrpoulay6121  5 лет назад +2

      Hey Jester!
      Those resistors are there to adapt the 5V voltage of the arduino lines and the 3.3V I2C linea of the Mpl3115a2. And your are right I2C requires pull resistors but pull up and not pull down. Those pull up resistor are already on the red PCB of the MPL3115A2.
      For more details:
      learn.sparkfun.com/tutorials/mpl3115a2-pressure-sensor-hookup-guide/hooking-it-up

    • @Jester75y
      @Jester75y 5 лет назад +1

      @@mrpoulay6121 I stand corrected. You are right, the resistors are placed correctly. I got my altimeter from adafruit. I like the documentation on sparkfun much better. Thanks for the reply!

  • @sashaktakharel7365
    @sashaktakharel7365 3 года назад

    very helpful thanks a lot can we use BMP180 instead of MPL3115A2 ?

  • @PollawatPhulinlai
    @PollawatPhulinlai 4 года назад

    thank you

  • @Independentscientist
    @Independentscientist 4 года назад +1

    I need data log to sd card module ... 😕

    • @mrpoulay6121
      @mrpoulay6121  4 года назад +1

      You can add a sd card module by using the SPI pin on the arduino which are not used.

    • @Independentscientist
      @Independentscientist 4 года назад

      @@mrpoulay6121 can you prepare me the complete code needed for that

    • @Independentscientist
      @Independentscientist 4 года назад

      Sent me to gokulgates7@gmail.com

    • @mrpoulay6121
      @mrpoulay6121  4 года назад +1

      @@Independentscientist It will depend on the module you will use. You can probably find a library to use with the module you choose. Then the code will be quite straightforward.

    • @Independentscientist
      @Independentscientist 4 года назад

      @@mrpoulay6121 thanks

  • @gemsilog9157
    @gemsilog9157 5 лет назад +2

    There seems to be no display. I followed all the instructions and the code was uploaded just fine. Any solutions?

    • @mrpoulay6121
      @mrpoulay6121  5 лет назад +1

      Did you check that your 7 digits display is working proprely ?

    • @gemsilog9157
      @gemsilog9157 5 лет назад

      @@mrpoulay6121 yes. I am currently trying a sample code. And it seems to be working just fine

    • @mrpoulay6121
      @mrpoulay6121  5 лет назад +1

      @@gemsilog9157 Try to make each components work separatly before combining everything.

    • @gemsilog9157
      @gemsilog9157 5 лет назад

      @@mrpoulay6121 I guess its the mpl3115a2 pressure sensor thats not working.I bought a chinese one. Im buying a different one right now

  • @Independentscientist
    @Independentscientist 5 лет назад +1

    error in status 1( altimeter code )

  • @InterestingFactsHQ
    @InterestingFactsHQ 5 лет назад

    Would you share how to integrate audible alerts at different altitudes?

    • @mrpoulay6121
      @mrpoulay6121  5 лет назад

      Hey, on a drone I would not put an audible alert due to the big sound made by the propellers. However, if you intend to use it in a calmer environment, you could easily add a buzzer to it. Here is the link on how to use a buzzer with Arduino, it is quite easy.
      create.arduino.cc/projecthub/SURYATEJA/use-a-buzzer-module-piezo-speaker-using-arduino-uno-89df45

  • @matty0074
    @matty0074 5 лет назад

    HI there, just used this plan to complete my own model. Added a TP4056 charging board too. Works great, tho can you help me with a code to enable the button to cycle through options? such as max pressure and minimum? I also want to go to a negative value based on our start position (using it for measuring altitude for pumps) any insight would be awesome thanks!

    • @mrpoulay6121
      @mrpoulay6121  5 лет назад +1

      Hi Matthew,
      I am glad you could improve my project! For the negative value, it is easy just delete the lines 42,43 and 44 of my code which force the altitude to be always positive.
      Displaying the minimum pressure will be a little bit more difficult but if you reach this point you should be able to do it. Create a variable called altitude_min and update it each time you reach a new minimum altitude.
      To cycle through options either you add another button, either you use a variable to count the number of time you press the button and each time it increases, you display a different option. When your variable reachs the last option, it could go back to the first one.
      Good luck!

    • @matty0074
      @matty0074 5 лет назад +1

      Mr Poulay thanks very much for your reply I'll see how I go. Great project, thanks for your work

  • @guywatcho1641
    @guywatcho1641 6 лет назад

    Very good job!!!

  • @edwinkania5286
    @edwinkania5286 6 лет назад

    Nice

  • @rocket5415
    @rocket5415 3 года назад

    how could I have the sensor output deploy a parachute after a certain altitude is reached?

    • @mrpoulay6121
      @mrpoulay6121  3 года назад

      Once your altitude reached, you can toggle a GPIO pin of the arduino and plug into that whatever parachute mechanism you have.

  • @saicharan79436
    @saicharan79436 3 года назад

    What is the maximum altitude it can read

  • @jadbecherawy8559
    @jadbecherawy8559 5 лет назад

    Hello
    I am having some issues with my sensor. It is indicating always a 0 altitude. When i checked what the sensor is reading, I got a -999 value for the altitude.
    Can you help ?

    • @mrpoulay6121
      @mrpoulay6121  5 лет назад

      Hello Jad,
      Did you connect the MPL as on the schematic? If not maybe you will have to adapt the code. As for the code did you copy the same lines? Don't forget the initialisation it is important for the arduino nano to be able to "talk" to the MPL.

    • @yarnevansteenwinckel
      @yarnevansteenwinckel 5 лет назад

      @@mrpoulay6121 I have the same problem I use the code from the download an i checked the schematic multible times

    • @mrpoulay6121
      @mrpoulay6121  5 лет назад

      @@yarnevansteenwinckel Weird behavior indeed. Unfortunatly I don't have THE solution. Your best chance to find the problem is to try each piece separately. Just plug the pressure sensor to the arduino and try to get some value of it. Maybe this component arrived broken. Is your arduino fine? Try another component on the I2C pins to be sure it working properly. You could also recheck the value of the resistor to be sure they are 1k ohm. Good luck!

  • @MonsterRC2012
    @MonsterRC2012 6 лет назад

    Hi, I have a problem with your .ino Sketch. It does not want to compile/verify. I hope you can help

    • @mrpoulay6121
      @mrpoulay6121  6 лет назад

      Hey I can probably help, I don’t know which errors you get but it is maybe due to the fact that I added 2 libraries to make it work (TM1637 library and SparkFunMPL3115A2 library). I just added the links in the description and add them on the dropbox link.

    • @Independentscientist
      @Independentscientist 5 лет назад

      i have the same problem . can you help me !

  • @ganeshgoli2426
    @ganeshgoli2426 4 года назад

    can i put the pressure sensor in a vaccum container and apply pressure using pressure pump to the container will it work??

    • @mrpoulay6121
      @mrpoulay6121  4 года назад +1

      There is no reason it should not work, just keep in mind that the pressure sensor is rated for 20 to 110kPa. Outside this range, you will have wrong values.

    • @ganeshgoli2426
      @ganeshgoli2426 4 года назад +1

      got it thanks bro..

    • @ganeshgoli2426
      @ganeshgoli2426 4 года назад

      @@mrpoulay6121 bro the code is not getting complied its showing
      "1:20 fatal error :TM1637.h no such file or directory"

    • @mrpoulay6121
      @mrpoulay6121  4 года назад +1

      @@ganeshgoli2426 You probably did not install the TM1637.h library

    • @ganeshgoli2426
      @ganeshgoli2426 4 года назад

      @@mrpoulay6121 should i decrease the pressure to get the value or to increase the pressure if i put the sensor in an airtight container

  • @x7falcon689
    @x7falcon689 4 года назад

    I want to use a bmp 180 .
    How can I use it ?

    • @mrpoulay6121
      @mrpoulay6121  4 года назад

      Yes you can use it, the schematic will be the same but the library you have to use will be different and the function will probably have different names.

    • @mrpoulay6121
      @mrpoulay6121  3 года назад +1

      @@chandanvudala6778 If you add an sd card module and some code to work with, it can definitely work.

  • @LuisCastillo-xc1qc
    @LuisCastillo-xc1qc 5 лет назад

    Heyyy can you use Arduino Uno instead if using Arduino Nano?

    • @mrpoulay6121
      @mrpoulay6121  5 лет назад

      Hello, yes you can use an Arduino Uno instead of the Arduino Nano, it takes just a little more space but pins will be the same.

  • @yarnevansteenwinckel
    @yarnevansteenwinckel 5 лет назад

    is the arduino an 5v or 3v