Connect with us

Changing Resistor Value by MPU 6050 Sensor

Discussion in 'Sensors and Actuators' started by mohammadrofan, Sep 9, 2014.

Scroll to continue with content
  1. mohammadrofan

    mohammadrofan

    9
    2
    Jul 23, 2014
    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.
     
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,505
    2,852
    Jan 21, 2010
    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 likes this.
  3. mohammadrofan

    mohammadrofan

    9
    2
    Jul 23, 2014
    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.
     
  4. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,505
    2,852
    Jan 21, 2010
    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 likes this.
  5. mohammadrofan

    mohammadrofan

    9
    2
    Jul 23, 2014
    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.
     
  6. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,505
    2,852
    Jan 21, 2010
    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.
     
  7. mohammadrofan

    mohammadrofan

    9
    2
    Jul 23, 2014
    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.
     
  8. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,505
    2,852
    Jan 21, 2010
    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.
     
  9. mohammadrofan

    mohammadrofan

    9
    2
    Jul 23, 2014
    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?
     
  10. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,505
    2,852
    Jan 21, 2010
    Well, given that you probably don't need a variable resistance, I'd say no.

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

    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.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-