So I have a quick question.
I'm using 3 MPU6050's and as you know they use AD0 being at ground or 3.3v to set being 0x68 or 0x69.
So I was wondering since I'm using three, is it possible to switch AD0 between ground and 3.3v, so for example one mpu6050 is set to high (3.3v) and the others set to ground or vice versa. so that I can select with one I want to read from. I know there is multiplexing with a chip but I wanted to find another method. Can a mosfet or transistor do this(switch between ground and 3.3v)? Also if this is possible does it truly matter whether I use a mosfet or "standard" transistor? I know a mosfet has to be "fully on" to work properly but most operate well from the Arduino 5v line and the transistor I know uses current to switch which the Arduino can do too. Is there really a definitive situation where I need a mosfet over transistor or transistor over mosfet? example would be great.
Yes you can do this technique for switching the address lines.
There is no need to use a transistor you can use the output pins directly. If there is a mismatch between the voltage the pin produces and the voltage the chip is running off then simply use a potential divider.
ok, so I connect AD0 to a digital output pin on the Arduino? or a analog?
the pins I'm using from the mpu6050 is v+, ground, sda, scl and will use ad0 for switching between them.
I didn't think the output pin would be able to "activate" ad0 from it's pulled down state?
ohhhh my mistake, I did not know the Arduino digital outputs were capable of outputting 5v for whatever reason. This simplifies everything a lot.
So just connect digital pin to ad0 and set to high or low to select or deselect it?
The datasheet isn't clear if AD0 is only sampled at reset or is a live input. Many chips only sample
configuration pins at reset (partly so they can perform other roles too). You'd have to test if this is
the case.
Recognize that a MOSFET is a transistor (that is what the "T" is in the name). They just act differently than a bipolar transistor (what I think you are calling just a transistor). A bipolar transistor is a current operated device with the base current determining how much current flows through the device. A MOSFET is a voltage operated device with the voltage on the gate determining what it is doing. Both devices can be used in either the linear mode or switch mode. MOSFETS tend to work very well as switches, but require some minimum gate voltage to turn on completely and that gate voltage may be higher than what you can provide from a 3 or 5 volt circuit for example. If it is not completely on (saturated), then at higher currents, you end up with a significant voltage drop through the device resulting in significant heat generation. These days, there are some really nice low-cost MOSFETS available that work very well (back in my day, it was vacuum tubes !! )