Connecting Sensors help needed

Hi everybody,

I have a question. I will use some sensors which are Barometric,Gyro,Accelerometer, and some analog sensors.

My question is about connecting spi sensors. I know that some sensors has enable and disable pin but my sensors don't have it. So that, can I enable and disable them with connecting to a digital pin and writing HIGH and LOW to that pin?

I mean will supply the sensors from an digital pin and when I wanted to read sensor data, I will write HIGH to its supply pin than read the sensor data and re-write LOW to that pin.

(All the SDA and SCL pins of sensors will be connected in parallel to mega's pin)

Thanks for your help :slight_smile:

Impossible to answer without knowing what sensors you're talking about. Please post links.

sensors are;

MPU-6050 gyro and accelerometer

BMP085 Barometric sensor
http://www.ebay.com/itm/New-High-BMP085-Barometric-Digital-Pressure-Sensor-Module-Board-For-Arduino-/320874325635?pt=AU_B_I_Electrical_Test_Equipment&hash=item4ab599a683

HMC5883L Magnetometer
http://www.ebay.com/itm/HMC5883L-Magnetometer-Module-Compass-Arduino-Raspberry-HMC5883-/281207394738?pt=Hobby_creativi&hash=item41794451b2

and other sensors are analog which are MQ-7,MQ-4 gas sensors, GY-61 analog accelerometer and Neo6MV2 GPS

Thanks for your reply

OK, you're making a drone - that's a very complicated project, but it's been done many times in many different ways so there's lots of examples out there. As for hooking up the MPU, there is information to get you started on this site...

http://playground.arduino.cc/Main/MPU-6050

For the compass and barometer, you can refer to the ArduPilot project - the board is open design, so you can easily look at how the barometer and compass are hooked up.

http://dev.ardupilot.com/wiki/where-to-get-the-code/

That should be a good place to start. Click around on that site and you should be able to find the info you need.

Actually these link gives direct information about sensors and system. I couldnt find any information about controlling sensors to read data with enable and disable.

Thanks

I couldnt find any information about controlling sensors to read data with enable and disable.

Which sensors are you referring to when you say that? As you say, an SPI device is accessed with SS low, so you know about them.

Are you talking about plain analog sensors when you talk about enable / disable? If so- taking a simple LM35 as an example, you just give them power to red and black, and read the other wire on an analog pin. You don't need to enable the sensor to read it, unless by enable you simply mean turn it on by giving it power. Just leave it on (=enabled) all the time, and read it when you need to.

If that's not what you mean, you'll need to explain....

I have an Uno with Ethernet as a server here, with an LM35 measuring the the temperature nearly all of the time.

htekin:
Actually these link gives direct information about sensors and system. I couldnt find any information about controlling sensors to read data with enable and disable.

Thanks

It isn't just about that. There's a way to run those sensors, and the project I sent you to does it the right way. The MPU has to be initialized a certain way, you can't just turn it on and off.