Software release: Added MPU6050 support to gpspc program

Released some PC test code for the EM-411 GPS module, the SPC01 compass and altitude sensor module, and the MPU6050 acceration senser and gyro module, all combined in one program. This code is in C, and for the Linux OS, and released under the GPL.

formatting link

There are now 2 temperature sensors.

Looking on the web there is a lot of Ferry KompliKate_tet code to be found for the MPU6050, and indeed it has a build in micro with some propriaty code it seems. Anyways this is a simple PC based test drive[r], and I get good values for acceleration, rotation, and temperature for this module. As the code is in C it is eeeh, not so retarded as the C++ stuff around. It can help you understand this chip, you really need to read the dataheets too. I tried some 'features' of this chip, like the iic pass through, and it did not work error free (probably did not do it right). The program uses a separate thread for the SPC01 sensor together with this MPU6050 sensor. I took the simple way out and used 2 iic busses. All this because the SPC01 modules does not have its iic implementation right, if you communicate with an other device while waiting for SPC01 data, then it gets confused. So using 2 iic busses solves these problems. Both busses, and also the power for these 2 modules, come from the PC par port in this [test???] setup.

The EM-411 GPS module is connected to the PC serial port, and needs external power. The MPU6050 and SPC01 modules are connected to the PC par port, and also get their power from there. There are 2 iic busses on the serial port, both are isolated with diodes for scl and sda pulldown, see iiclib.c All this assumes a serial port with 3.3 V signals.

Some program output:

# gpspc -a -b /root/waypoints.test -x -d /dev/ttyUSB1 Panteltje (c) gpspc-0.6 for EM-411 GPS receiver board

control C exits.

latitude aa degrees bb.bbbb minutes N (cc.cccc degrees N) longitude 5 degrees dd.dddd minutes E (ee.eee degrees E) altitude above sea level 16.2000 M geoid_separation 46.6000 M gps speed 3.52 knots (nautical miles/h) gps speed 6.52 km/h gps heading 36.15 degrees date and time 2012 8 20 14:59-59 UTC

next waypoint 1 named amsterdam is 52 degrees 22.7749 minutes N 4 degrees

53.8671 minutes E altitude 10.00 m

heading to next waypoint 1 yyy.yyy degrees distance to next waypoint 1 xxxxx.x km altitude next waypoint 1 10 meter

WARNING GPS AIR SPEED LOW ***STALL***, GPS air speed 6.52 km/h, this is lower than 180 WARNING GPS heading differs from magnetic heading by 53.85 degrees, this is more than 5 WARNING GPS altitude differs from pressure altitude by 56 meters, this is more than 10

*** WARNING AUTO PILOT DISABLED ***

Mode 3D GPS SPS Mode, fix valid pdop 3.5 hdop 2.2 vdop 2.8 satellites used 5 ( 16 30 29 18 21 ) satellites in view 12 id 30 * elevation 69 azimuth 206 snr 0 id 21 * elevation 67 azimuth 99 snr 16 id 16 * elevation 60 azimuth 289 snr 28 id 6 elevation 44 azimuth 272 snr 0 id 3 elevation 26 azimuth 275 snr 0 id 18 * elevation 21 azimuth 135 snr 25 id 29 * elevation 19 azimuth 85 snr 0 id 31 elevation 9 azimuth 201 snr 0 id 5 elevation 8 azimuth 25 snr 0 id 7 elevation 6 azimuth 338 snr 0 id 13 elevation 2 azimuth 310 snr 0 id 19 elevation 0 azimuth 265 snr 0

acceleration_x 10 mg acceleration_y -7 mg acceleration_z 948 mg

rotation_x -2 degrees per second rotation_y -1 degrees per second rotation_z -1 degrees per second

mpu6050_temperature=27.44

air pressure 1023.19 hPa (millibar) pressure altitude -82 m magnetic heading 90 degrees WARNING magnetic compass was not calibrated on program start, displayed value may not be be correct spc01_temperature 27.50 °C

----------------------------------------- Not bad, 27.44 and 27.5 is close enough :-)

Note the gravity anomaly :-)

Fun

Reply to
Jan Panteltje
Loading thread data ...

Released some PC test code for the EM-411 GPS module, the SPC01 compass and altitude sensor module, and the MPU6050 acceration senser and gyro module, all combined in one program. This code is in C, and for the Linux OS, and released under the GPL.

formatting link

Added open GL display with fancy airplane. :-)

The airplane responds to the acceleration and rotation sensors. Was more fun than the cube you always see on youtube for this, but you can change the defines to see a cube in 'cube.c' if you want to.

Reply to
Jan Panteltje

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.