Go Down

Topic: MPU Sensor Post Processing (Read 83 times) previous topic - next topic


Jan 13, 2020, 08:52 pm Last Edit: Jan 13, 2020, 09:01 pm by JPAnsArduino
I am new to the world of Arduino and have been working with an MPU 6050 sensor. So far I have managed to access the appropriate registers and output the accelerometer and gyroscope readings to the serial monitor. I now want to add the MPU sensor to an already built DAQ system. This means I have to somehow output the X-, Y-, Z-Accelerometer/Gyroscope readings as voltages or an analog signal. How can I go about doing this?

The following is the only way I have thought of accomplishing the above.
I was thinking of accessing the accelerometer/gyroscope registers and then using the pin write command to output a voltage that linearly varies with the accelerometer/gyroscope reading. This would mean that I would need an output pin for each direction for a total of six pins. I am also not sure this is possible as so far I have only been able to set pins to HIGH or LOW.


Jan 13, 2020, 09:01 pm Last Edit: Jan 13, 2020, 09:07 pm by jremington
This means I have to somehow output the X-, Y-, Z-Accelerometer/Gyroscope readings as voltages.
Please explain why, and state the voltages.

Most Arduinos do not have a Digital to Analog Converter (DAC), which is required for the above.


I need to output the X-, Y-, Z-Accelerometer/Gyroscope readings as some signal from the Arduino pins. The signal can either be digital or analog.

I was hoping to output an analog signal which corresponds to each of X-, Y-, Z-Accelerometer/Gyroscope readings.
For example, if X-Accel has a set range of 0-5gs and it outputs 5gs, I want an analog pin to output 255. If X-Accel outputs 0gs, I want the same pin to output 0. My issue is that this would require 6 independent analog pins and I was hoping for a better solution.

My understanding is that the MPU 6050 outputs a digital signal and that the Arduino Uno does not have a DAC. I was hoping to get around this by simply reading the accelerometer/gyroscope output and then converting that into an analog ouput using a linear function. So say X-Accel has a set range of 0-5gs and it outputs 5gs, I would have the corresponding analog pin output 255 by using the following function:


Jan 13, 2020, 11:02 pm Last Edit: Jan 13, 2020, 11:06 pm by jremington
The analogWrite pins are not at all analog; they output a train of 5V pulses, with variable pulse width.  Why do you want to do that?

To post process the MPU-6050 data on some other machine, the only sensible approach is to send the raw data to that machine using a serial connection.


Jan 13, 2020, 11:09 pm Last Edit: Jan 13, 2020, 11:10 pm by JPAnsArduino
I have a series of sensors in a system, all of which output voltages that I later post-process. I want to add an MPU and consolidate it all into one system. I am essentially trying to output the MPU readings into a DAQ system that interfaces with LabView.

So you are saying I should bypass the Arduino and feed the raw data straight into the DAQ system?


Jan 13, 2020, 11:12 pm Last Edit: Jan 14, 2020, 05:05 am by jremington
It is trivially easy to send the MPU-6050 data directly to LabView via the serial port. There is absolutely no point in routing data through some other device.

If you want useful advice, describe the system in enough detail so that people can make intelligent suggestions.

Go Up