Compass Sensor Connect to BrickPi


#1

Hi, I want to connect a compass sensor to Pi. I have a HMC5883L sensor and it needs I2C port. Can I use the I2C port on the BrickPi and how to read data from that?


#2

As far as I know the BrickPi doesn’t have standard I2C ports just the Lego type ports (although they do use I2C coms). I would assume the easiest way to connect this sensor to your project is connect it directly to the RPi or a GrovePi and run it in parallel to the BrickPi. If you google the sensor you should find Python drivers somewhere to run it.


#3

@panjinb, are you using a BrickPi3? This does have a standard I2C port. If not, which version of the BrickPi are you using?


#4

I am using BrickPi2. Does that have I2C port?


#5

I will let Dexter comment on exactly what the BrickPi is capable of as they know their product.

If the BrickPi isn’t capable of running this sensor u still can use it with the BrickPi by running side by side the BrickPi on the RPi. You can connect it to the striaght through stacking pins ontop. You will need to connect 4 wires (2 power +3.3v,-gnd and 2 data wires SDA, SCL) they r at the top left of the header see attached pic

I did a quick google for a driver for you but the link that I followed no longer exsisted but you can google a bit more and might find 1 just ready to download and use or the second link that I found was to write a very simple driver to use it see http://blog.bitify.co.uk/2013/11/connecting-and-calibrating-hmc5883l.html


#6

Shane is right! You can connect this up, if the board you have is running 3V3 I2C lines. Everyone is right though: the BrickPi+ does not have a direct connection to I2C.


#7