hi welcome to an Arduino step-by-step course by Robojax
hi in this lecture we are going to learn how we can use this bmp280 barometric pressure and
temperature sensor to display the temperature in Celsius and also in Fahrenheit and then we
are going to display the approximate altitude on this seven segment display based on tm1637
this is the wiring diagram for bmp-280 with tm1637 led display the color legend is here
brown is clock have been connected to pin five
this purple is digital in out or data in out have been connected to six
blue is ground this has been connected to ground here and this pin is vcc I’ve been connected to
five volts legend for this one is such that sda the brown is sda been connected to pin a4 and
this is scl the red wire have been connected to a5 ground is orange we are connecting it to ground
in here and then vcc have been connected to 3.3 volts to avoid using a breadboard because this
module can work with 3.3 volts and here is actual wiring from the left side if you see the top this
actual sensor on the top the yellow wire have been connected from the left
to 3.3 volts the orange is the second wire have been connected to the ground in here
the third wire is red this has been connected to a5 brown the fourth wire have been connected to a4
these two last pins are left empty the clock is connected using brown wire 2.5 the purple pin
is data and out have been connected to pin six blue is ground this has been connected to ground
and then green is the five volts or vcc which have been connected to five volts
let me explain the wiring mat dot h is for rounding purpose we are using it and
this is part of this ide you don't have to download anything the same as wire and spi this is
part of the library you have included when we had the lecture for the module
this portion is all the same and here this is the start of the setting and that's the end all of
these lines are for led display for the tm16387 part of the Arduino you don't have to download
anything this is the library for the tm1637 which I’ve shown you before you have to include it
pin five is defined for clock and six for data and out and we create an instance of the class
uh we call it display and we pass these two values and this is creating blank
digits whenever we need to blank the screen we use this and this is all segment ff for
all four digits and we call it all segment as an array we initialize the serial monitor
and we print the text on the screen and then we set the brightness of the screen to the maximum
of the led display and if there is an issue initializing the bmp-280 we print this text
and we use this while one will keep the program stop at this point
inside the loop we print the temperature in Celsius Fahrenheit and kelvin using the custom
function which I have explained it before we print we turn on all the segments using all segment
which have been defined above and then we wait for three seconds this way we know the loop have been
completed and then we clear the screen using blank and then we get the temperature in Celsius and use
round to round this number of Celsius otherwise it will just cut the decimal point and then we wait
for three second then we use blank again and this time we use Fahrenheit and wait for three seconds
and then blank it again and this time we get approximate altitude we could not display the
barometric pressure barometric pressure will not fit that's why we did not use it here
and then we wait for extra one second in the loop continuously displaying all those values and here
the code is running this is Celsius after that we will see Fahrenheit and then we will see this is
around it and this is approximate altitude and we display all the digits and let me apply some heat
as you can see the number of digits have jumped and the temperature is now let's see
47 degrees Celsius and this loop waits until all of these are displayed and comes back
that's why you don't see the value
and if you're using this small one the wiring is the same these two pins have been swapped ground
have been in this position and vcc is on the other side so to use it I’m just removing this these
two are this is here and ground the two pin are okay but for these two I have to just switch it
bring them on this side
and once you insert it it should just work fine
thanks for watching this was how to use this bmp280 barometric pressure and temperature
sensor with this tm1637 led display please make sure to subscribe by clicking at the subscribe
button in here thank you thank you for watching tutorial from Robojax if you learned something
and found this useful please thumb up as this will help my video in the search algorithm of YouTube
if you have comment or question please post it at the comment section below
I try to answer and reply and don't forget subscribe to get updates on my upcoming videos