Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. How connect si7021 and bh1750 to arduino mini pro

How connect si7021 and bh1750 to arduino mini pro

Scheduled Pinned Locked Moved Hardware
3 Posts 3 Posters 1.4k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tommas
    wrote on last edited by Tommas
    #1

    Dear All!

    I would like to connect my si7021 and bh1750 to the same arduino mini pro 5v. These use the I2C interaface, but i dont know how should wire it.
    After the wiring, how can I read the values both of them with mysensors sketch?

    Thank you for your help in advance!

    T.

    mfalkviddM M 2 Replies Last reply
    0
    • T Tommas

      Dear All!

      I would like to connect my si7021 and bh1750 to the same arduino mini pro 5v. These use the I2C interaface, but i dont know how should wire it.
      After the wiring, how can I read the values both of them with mysensors sketch?

      Thank you for your help in advance!

      T.

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      @Tommas wire both sensors to A4 and A5. Then use the respective libraries to communicate with the sensors. I2c is a bus that supports multiple devices.

      1 Reply Last reply
      0
      • T Tommas

        Dear All!

        I would like to connect my si7021 and bh1750 to the same arduino mini pro 5v. These use the I2C interaface, but i dont know how should wire it.
        After the wiring, how can I read the values both of them with mysensors sketch?

        Thank you for your help in advance!

        T.

        M Offline
        M Offline
        manutremo
        wrote on last edited by
        #3

        @Tommas Hardware-wise, apart from the Vcc and GND pins, both I2C pins marked SDA and SCL should be connected to the I2C pins in the arduino (A4 and A5).

        Software-wise, each library should provide a "constructor" function which returns an object with which you can then read the measurements through the appropriate function. The I2C devices have an internal address which the libraries use to access the correct device through the bus.

        Most of the devices have their I2C adress hardcoded; some allow you to modify it e.g. to avoid conflicts with other devices or to allow connecting two equal devices to the same board. In this case, the constructor will need you to pass the adress as a parameter.

        I have no experience with those two sensors but I have a node with a light sensor similar to the bh1750 (tsl2591), and a temp/hum/baro sensor similar to the si7021 (bme280). Just to give you an idea, the constructor for the bme280 (using the Adafruit library) looks like:

        Adafruit_BME280 bme;
        

        and then the lines to read the measurements look like (in "forced measure" mode):

        bme.takeForcedMeasurement(); 
        temp=float(long(bme.readTemperature()*10))/10.0;  //round to 1 decimal place
        hum=(int) bme.readHumidity();                     //Humidity in domoticz is an integer
        baro=round(bme.readPressure()/100);               //Convert from Pa to hPa (mb) and round to 1 decimal place
        

        While for the TSL2591 the constructor and readings (in IR + visible mode) are like this:

        Adafruit_TSL2591 tsl = Adafruit_TSL2591(2591); // pass in a number for the sensor identifier (for your use later)
        << more code >>
          uint32_t lum = tsl.getFullLuminosity();               //getFullLuminosity in the library already enables and disables the device
          uint16_t ir, full;
          ir = lum >> 16;
          full = lum & 0xFFFF;
          visible=tsl.calculateLux(full, ir);
        

        In addition to this, you may need to initialize the sensor, set some configuration... each library is different and therefore should provide documentation explaining how it works.

        1 Reply Last reply
        1
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        27

        Online

        11.7k

        Users

        11.2k

        Topics

        113.1k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular