Thread Tools
Sep 07, 2016, 04:02 AM
Registered User
Thread OP
Question

Connecting the compass of GPS module to SP Racing F3 flight controller


I am planning to install GPS to my quadcopter and play with various functions such as return to home or flying missions. After quite a lot of reading, I have got a rough idea on how to do it but I am still uncertain about how to connect the flight controller to the compass inside the GPS unit.

For the Beitian 880 module ( http://www.banggood.com/UBLOX-NEO-M8...-p-971082.html ). The connection is quite straight forward according to relevant Cleanflight documentation :

Tx, Rx : to Rx and Tx of an available UART of the FC
SDA , SCL : to the corresponding pins of the I2C sockets of the FC
Vcc, Gnd : to +5V and Gnd of the FC


However, for this “Mini Ublox 7M GPS Module” ( http://www.banggood.com/Mini-Ublox-7...p-1042849.html ) , there are no SDA and SCL pins. Does the FC read the direction information from the Tx and Rx pins ? Will the GPS need be configured differently in order for the information to be sent to the FC in this way ?
Sign up now
to remove ads between posts
Sep 08, 2016, 06:00 PM
I void warranties
If there are no i2C pins coming from the module it doesn't include a compass and you'll need to add an external one.
Sep 08, 2016, 08:35 PM
Registered User
Thread OP
Quote:
Originally Posted by Cereal_Killer
If there are no i2C pins coming from the module it doesn't include a compass and you'll need to add an external one.
That's my understanding also but the marking on the module says "with compass" so I am confused.
Sep 09, 2016, 01:41 PM
sweet dreams & flying machines
stronnag's Avatar
Quote:
Originally Posted by yclui
That's my understanding also but the marking on the module says "with compass" so I am confused.
In which case, it may provide the serial NAZA GPS protocol, which is supported by iNav, but I doubt by Cleanflight.
Sep 29, 2016, 07:33 AM
Registered User
Daniel Ribeiro's Avatar
Hello, can I use this topic to make a relevant question?

I have SP Racing F3 (10-DOF) and i'm trying to figure out how to connect GPS on it since I have use all UART ports.

UART1 - Used by USB and MinimOSD Micro
UART2 - Used by Bluetooth module
UART3 - Used by FS-IA6B Receiver iBUS connection

I do not want to move the RX to the PPM port because on PPM i get only 6 channels from this RX, and using iBus I can get 10 channels.

I use Led Strip and Buzzer too.

So, I have all the IO1 and IO2 ports free... But I'm not sure if it's possible to connect GPS on the pins of these connections (or maybe move the iBus connection to one of the IO pins and free the UART3 for GPS).

Can anyone help?

Edit: To give the answer and not revive this topic.

Ok, I figured out how to solve my problem:
UART1 - USB and Bluetooth module
UART2 - GPS Module
UART3 - Radio Receiver
SOFTSERIAL1 - MinimOSD Micro

I just had to adjust the Baud Rate of OSD to 19200 (because that's the maximum speed of SOFTSERIAL ports) and everything now is working fine.
Last edited by Daniel Ribeiro; Jan 11, 2017 at 02:07 PM. Reason: To give the answer and not revive this topic.
Aug 29, 2017, 03:47 PM
Fan of microElectroRfIT
hello. using SP racing F3 Evo type of board
can anyone help me to locate the i2c pins (or any i2c) on the FC (stm) since on the board i have are not declared.
i want to add an external compass to my board since it has MPU9250 wich is heavily affected by RF/magnetic fields and vibrations.
Also interested in softserial pins.

point me the pin numbers on the STM32F303

Thanks in advance.
Last edited by yo8aiv; Aug 29, 2017 at 05:10 PM.
Aug 29, 2017, 08:09 PM
FA3PR9WM79
Oldgazer's Avatar
Quote:
Originally Posted by yclui
I am planning to install GPS to my quadcopter and play with various functions such as return to home or flying missions. After quite a lot of reading, I have got a rough idea on how to do it but I am still uncertain about how to connect the flight controller to the compass inside the GPS unit.

For the Beitian 880 module ( http://www.banggood.com/UBLOX-NEO-M8...-p-971082.html ). The connection is quite straight forward according to relevant Cleanflight documentation :

Tx, Rx : to Rx and Tx of an available UART of the FC
SDA , SCL : to the corresponding pins of the I2C sockets of the FC
Vcc, Gnd : to +5V and Gnd of the FC


However, for this “Mini Ublox 7M GPS Module” ( http://www.banggood.com/Mini-Ublox-7...p-1042849.html ) , there are no SDA and SCL pins. Does the FC read the direction information from the Tx and Rx pins ? Will the GPS need be configured differently in order for the information to be sent to the FC in this way ?
The 7Ms are crap. Run away as fast as you can and get an M8N. You'll thank me later....
Aug 29, 2017, 08:19 PM
FA3PR9WM79
Oldgazer's Avatar
Quote:
Originally Posted by yclui
That's my understanding also but the marking on the module says "with compass" so I am confused.
The only way to find out is open the case and look at the circuit board.
Aug 29, 2017, 08:31 PM
Registered User
Quote:
Originally Posted by yo8aiv
hello. using SP racing F3 Evo type of board
can anyone help me to locate the i2c pins (or any i2c) on the FC (stm) since on the board i have are not declared.
i want to add an external compass to my board since it has MPU9250 wich is heavily affected by RF/magnetic fields and vibrations.
Also interested in softserial pins.

point me the pin numbers on the STM32F303

Thanks in advance.

What's the full part number on the STM chip? There are several versions, with different pinouts.
Aug 30, 2017, 08:18 AM
Fan of microElectroRfIT
Quote:
Originally Posted by Whirlygig
What's the full part number on the STM chip? There are several versions, with different pinouts.
Hello. Thanks for the fast asnwer.

Its an STM32F303 below
CCT6
GH21K 9U
CHN GH 626
Aug 30, 2017, 11:12 AM
Registered User
That chip has two I2C busses, I2C1 is indicated in blue, I2C2 in red. Not sure if it matters which you wire to, I attached a magnetometer to I2C2 on a STM32-F405 and it was detected fine, so probably whichever is easiest.

Pin 1 is at the bottom row left in your image and the numbers go up counterclockwise, so the bottom pin on the left side is pin 48. So the pin diagram needs to be rotated 90 degrees counterclockwise to match your photo.

Looks like pins 30 and 31 go directly to the top two pins on the right side of that connector on the left side of your board. 38 goes to the second from the bottom on the same side, and although it's hard to tell where 37 is going, my guess would be the one above or below where 38 goes. Could check with a meter pretty easily.

In any case, it looks like you have ample spots to connect... way easier than I had with my F405!
Aug 30, 2017, 02:14 PM
Fan of microElectroRfIT
Quote:
Originally Posted by Whirlygig
That chip has two I2C busses, I2C1 is indicated in blue, I2C2 in red. Not sure if it matters which you wire to, I attached a magnetometer to I2C2 on a STM32-F405 and it was detected fine, so probably whichever is easiest.

Pin 1 is at the bottom row left in your image and the numbers go up counterclockwise, so the bottom pin on the left side is pin 48. So the pin diagram needs to be rotated 90 degrees counterclockwise to match your photo.

Looks like pins 30 and 31 go directly to the top two pins on the right side of that connector on the left side of your board. 38 goes to the second from the bottom on the same side, and although it's hard to tell where 37 is going, my guess would be the one above or below where 38 goes. Could check with a meter pretty easily.

In any case, it looks like you have ample spots to connect... way easier than I had with my F405!
`Thanks alot.
wanted to go with the multimeter from the MPU9250 to trace them back to the FC .. but it would have been a nightmare and also no time.

I will get back with the results as soon as possible.

Do you have any idea about the softserial pins should be like any spfracingf3 right .. just i dont have one ? !
Thanks again for sharing your valuable experience.

Edit:

hmm i think some or most of them are used for uart ports
1 is osd 1 gps 1 RX 1 usb
would this still be possible to add my magnetometer ? or should i connect it to the same scl -sda pins like the onboard mpu9250 ?
Last edited by yo8aiv; Aug 30, 2017 at 02:40 PM.
Aug 30, 2017, 09:13 PM
Registered User
Quote:
Originally Posted by yo8aiv
`Thanks alot.
wanted to go with the multimeter from the MPU9250 to trace them back to the FC .. but it would have been a nightmare and also no time.

I will get back with the results as soon as possible.

Do you have any idea about the softserial pins should be like any spfracingf3 right .. just i dont have one ? !
Thanks again for sharing your valuable experience.

Edit:

hmm i think some or most of them are used for uart ports
1 is osd 1 gps 1 RX 1 usb
would this still be possible to add my magnetometer ? or should i connect it to the same scl -sda pins like the onboard mpu9250 ?
If you can determine which pins are going to your onboard mag, you should be able to attach it to them. I2C supports multiple devices on the same bus, each one has a hard coded address to communicate with individually. But that means if the mag chip in your GPS is the same as the on-board one, you'll have to physically disable the on-board one by removing it or cutting a trace. If there's two identical devices on the same bus, they'll both have the same address and the universe could explode. Best bet would be to just light solder some wires and see if things work. That's how I added a mag to a little nano controller: https://www.rcgroups.com/forums/show...mag-on-nano-FC

Afraid I can't help on the soft serial... I'm not too familiar with Cleanflight/Betaflight and how to configure that.
Aug 31, 2017, 07:11 AM
Fan of microElectroRfIT
Thanks. very good info.
i 'll have a try in a few days and get back with results. Good job on that F4v3 .. i was thinking to buy an Omnibus F3 for a new build also,
Cheers.
Sep 07, 2017, 03:57 PM
Fan of microElectroRfIT

adding HMC5883 compass of GPS module to SP Racing F3 Evo


i got some not so good news .. seems like the MP9.2(MPU9250) is connected via SPI and not I2C .. so i think i'm stuck with the magnetometer problem. (see photos). still looking for a workarround.

also i was trying inav today calibrated the onboard mag (MP9.2) and no go... goes in a toilet spin when i activate navPOS hold.
initially i added some alu foil next to it to protect from motor magnetic fields but forgot to put them back wile i was working on the FC.

so at this point i can accept any ideas or suggestions form you or anyone who has dealt with this kind of problem.
was thinking at the softserial ports but i dont know what good that will be.

Anyway i appreciate the help THX.


Quick Reply
Message:

Thread Tools