4

How can I accommodate between the difference in voltage and current levels with a single power source?

3 Answers 3

5

BME280 Adafruit I2C or SPI Temperature Humidity Pressure Sensor

First, I assume that this sensor module is referred to, not the bare sensor itself. There it reads:

So we made it easy for you to get right into your next project. The surface-mount sensor is soldered onto a PCB and comes with a 3.3V regulator and level shifting so you can use it with a 3V or 5V logic microcontroller without worry.

So it is possible to directly run it with the Pi. The sensor itself runs at about 3V and the board comes with a voltage converter to accept 3..5V inputs. If supplied with 3.3V from the Pi the serial data pins (I2C and SPI) have the appropriate voltage levels for the Pi.

Adafruit has this excellent tutorial that explains how to wire and use it. Read it! (I mean it!)

BMA180 Sparkfun Triple Axis Accelerometer Breakout

First, I assume that this sensor module is referred to. There it reads:

The board doesn’t have any on-board regulation, so the provided voltage should be between 1.62 and 3.6V for VDD and 1.2 to 3.6V for VDDIO. The sensor will typically only consume 650uA in standard mode.

If connected to 3.3 from the Pi as power supply you'll be within that specified range and everything should work just fine. Voltage level on the serial data pins (I2C and SPI) will be acceptable for the Pi then.

Common power supply

From your question and comment I take it that a common power supply should be used - but without the Pi. I'd advise against that.

For the BME280 and from the tutorial we learn that:

To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V

So, the Pi's power supply is 5V but its GPIO pins are not 5V tolerant. Thus, while the BME280 could handle 5V the Pi just would not like it. Power the BME280 at a voltage suitable for the Pi's 3.3V GPIO pins.

For the BMA180 the 5V are also not an option, as it requires a voltage below 3.6V. So again, simply use 3.3V and you're on the safe side.

Given the low power consumption (very low current) of both sensor modules simply connect them to the 3.3V pins the Pi provides (Pins 1 and 17 at connector P1).


On a side note: the question could certainly be improved by both linking to datasheet of the respective sensors and listing their requirements in the question itself. Think of it that way: would it not be easier for people to give an appropriate answer if you provide those information in the first place? Would it not show your own effort to solve the issue? This is even more important as there are different devices out there with the same name, i.e. in the case of the BME280 it is possible to purchase the bare sensor or a sensor module (such as the one offered by Adafruit).

6
  • Thank you so much for the response. I have edited my question now. I am now concerned regarding the current magnitude. As the sensor module draws only around 600 micro Amps , is it fine to connect it directly to pi?? Moreover, if I want to give a common power source for both pi and sensor means , how can it be done (without driving the sensor module from pi, but just connecting it with pi for I2C data transfer)
    – Vishnu
    Commented Apr 13, 2016 at 8:39
  • 600 µA is almost nothing. Don't worry about that. Your Pi and most likely your power supply can provide this.
    – Ghanima
    Commented Apr 13, 2016 at 8:44
  • If I give a 5v supply to pi from a Regulated Power Supply and connect sensor module to pi directly , will it be fine??
    – Vishnu
    Commented Apr 13, 2016 at 8:51
  • No, it won't. See my updated answer.
    – Ghanima
    Commented Apr 13, 2016 at 9:00
  • Thank you so much for the response. Just check what I have understood is correct or not. I will connect my pi with Computer's CPU using USB and connect the sensor modules to 3.3v GPIO of raspberry pi.
    – Vishnu
    Commented Apr 13, 2016 at 9:09
1

The BME280 looks like a viable option, and it can connect directly to Pi's GPIO, which gives you lots of opportunity. However I have not found much info on the BMA180 sensor. If your after a 3 axis accelerometer may I suggest the ADXL345 available here. There is also instructions on the same page for setting it up.

I'm not sure what you mean by "How can I accommodate between the difference in voltage and current levels with a single power source". But if your worried about connecting multiple sensors to the GPIO, there are plenty of guides out there easy to find.

3
  • Thank you so much for the response. I am now concerned regarding the current magnitude. As the sensor module draws only around 600 micro Amps , is it fine to connect it directly to pi?? Moreover, if I want to give a common power source for both pi and sensor means , how can it be done (without driving the sensor module from pi, but just connecting it with pi for I2C data transfer)
    – Vishnu
    Commented Apr 13, 2016 at 8:39
  • You are going to need a 5V 1.2A power supply for the Pi minimum. The sensors I suggested can be directly connected to the Pi's GPIO.
    – Darth Vader
    Commented Apr 13, 2016 at 14:56
  • BME280, BMA180 and BMP180 are the sensors that I am going to connect with pi via I2C. Can I use SMPS for powering both pi and sensors (as a common power source). If yes, how can it be done? voltage range of sensors is around 3.3V and current drawn is around 600 micro Amp
    – Vishnu
    Commented Apr 19, 2016 at 4:46
1

yes its possible that you can connect multiple devices with pi as long as you dont exceed the max current. there are few things you need to keep in mind.

  1. Make sure all i2c devices have different- different addresses. (as you are trying to attach more then one i1c device to the pi at same time)

  2. Pi has 3.3V level for all GPIO including the I2C, so if you have any sensor which works at 5 v or some work at 3.3v. you can get a I2C hat which will convert to I2C voltage either 5v or 3.3V. if you use this Raspberry Pi Hat it will convert I2C voltage to 5V. its a better choice because there are lot of sensor who works at 5V only.

Now we have your master working fine lets move to Slave side.

here need to focus on few things.

  1. Make sure you are using the i2c voltage same as your Pi hat.

if you dont have much exprince with voltage sift and level sift you can use a sensor BME280 like this which has on board voltage regulator, level sifter and pull ups. this will make sure your hardware is correct.

for BMP180 you can use same kind of module and it also has on board voltage regulator, level sifter and pull ups.

if you use these you dont have to worry about wiring and power its all in built.

now you have all of your hardware working lets move to the coding. you can find Raspberry Pi sample codes for BME280 and BMP180 over here

before running code run sudo i2cdetect -y 1 and make sure your pi detects both sensors. once you see both address you are good to go. all you need to do is copy paste the code and you are done.

Cheers!!!!!!!!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.