Maker Pro
Maker Pro

Changing Resistor Value by MPU 6050 Sensor

mohammadrofan

Jul 23, 2014
9
Joined
Jul 23, 2014
Messages
9
Hi. ive been wondering if there is any way that i could change some resistors value by changing the position of MPU 6050 IMU. i mean for example if the x angle changed IMU change a resistor value by increasing it or of it changed the other way around it decrease the value.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Are you talking about this device?

If so, what are you trying to do? change a resistance based on it's orientation? I guess that's possible, but changing a voltage based on its orientation would be far easier.

There are digitally controlled potentiometers that could do what you ask, and there may be other solutions based on what it is that this variable resistance is being used to control.
 

mohammadrofan

Jul 23, 2014
9
Joined
Jul 23, 2014
Messages
9
Are you talking about this device?

If so, what are you trying to do? change a resistance based on it's orientation? I guess that's possible, but changing a voltage based on its orientation would be far easier.

There are digitally controlled potentiometers that could do what you ask, and there may be other solutions based on what it is that this variable resistance is being used to control.
i want it to change the resistance based on its orientation but not one resistor. every angle should change one resistor resistance. for example if you move the Invensence IMUs simultaneously up and forward it change the resistance of two resistors and (for example) when the IMU is not moving the led should have no light but when it move fast its gona have more light than the time it goes slowly. sorry iam not a native English Speaker and it is a little complicated for me to write about it.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Presumably you 'd need a microcontroller reading the orientation from the chip and controlling three digital pots (X, Y, and Z movement).

If we had a better idea of what this was to be used for we might be able to suggest something else.
 

mohammadrofan

Jul 23, 2014
9
Joined
Jul 23, 2014
Messages
9
Im going to use it on body parts such as hands.when it moves based on the derection and speed it should change the resistance of 3 digital resistor. for example it changed 3 led lights based on its 3 angles.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
OK, in that case, changing a resistance is not really required. Simply use a microcontroller to keep track of the position and then use PWM or something similar to control the LED brightness.

Also note that a sensor like this doesn't calculate angle, it is sensitive to acceleration. Because of this it can be hard (or impossible) to tell the difference between the device being held at an angle (and thus you measure the direction of the gravitational field) or being moved an accelerated through space in such a way as to generate the same forces that would have resulted from it being held statically in a certain position.

There are other detectors that can determine their orientation in space independently from the acceleration they undergo. One of these sensor (often labelled as being "6 axis" or similar) if you wish to determine both orientation and acceleration -- and therefore be able to estimate position. Here is a "9 axis" device which incorporates gyroscope (orientation), accelerometer, and magnetic field (roughly direction and dip) measurements. Note that it also appears to have a barometric sensor as well.

From your very limited explanation, the gyroscope sensor would seem be best suited to determine orientation than would an accelerometer.
 

mohammadrofan

Jul 23, 2014
9
Joined
Jul 23, 2014
Messages
9
but i think MPU 6050 is 6 axis. i know that i need both gyro and accelerometer to cover gyros and accels problems. but cant it (both gyro and accelerometer) track object movement?
its not for led i just made an example. i still working on that part.
thanks for your help.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Ah, yes it is 6 axis.

I guess the point is that the device itself can't do what you want, you'll need a microcontroller or something similar to perform the math.

In general the device will allow you to keep a relative position up to date, but the accuracy will degrade the longer it is running.
 

mohammadrofan

Jul 23, 2014
9
Joined
Jul 23, 2014
Messages
9
so do i need digital potentiometers for that?
can all this tasks being carried out by one Atmega8 ?
so you are saying that its possible to make this device by using MPU 6050 but its need to do some math by micro right?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510

Well, given that you probably don't need a variable resistance, I'd say no.

can all this tasks being carried out by one Atmega8 ?

I can't answer that because I don't know what "all these tasks" are.

so you are saying that its possible to make this device by using MPU 6050 but its need to do some math by micro right?

I believe so. You certainly need a microcontroller as you're not going to interface using SPI with just discrete electronics (or not at a sensible complexity level).

I have no idea how complex the 3D mathematics may be, nor whether you can code it into 8k of program space on an ATmega8.

If I was targeting an ATMega8, I might start using an ATMega328 as the code will be easier to fit it, it's often cheaper in small quantities, and the extra code space gives you the opportunity to include diagnostics. You can then optimise the code and decide the minimum spec device you can fit the program in.
 
Top