I2C GPS

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
JohnyGab
Posts: 144
Joined: Sat Oct 29, 2011 4:41 am

I2C GPS

Post by JohnyGab »

I started a new thread because its a complete another subject than GPS integration.

I have all the needed stuff home here to make a I2C GPS module, as far as i'm plannin to produce a PCB that will give out the GPS data via serial PIN AND I2C pin. As far as I want to do it the correct way, I would like to know if there is already a Arduino source code ( that run on a atmega328p ) that is a I2C slave device for a Gps integration.

I will make a board 50x50mm with 45mm mounting 3m hole. That will have 2 connectors : Gnd,5V, Tx, Rx. and Gnd, 5V, Sda, Scl

The GPs will be a MediaTek ( FGPMMOPA6 device ) that will give at 115200 baud the most important NMEA strings at 10hz.
There will be a Atmega328P with FTDI port that will have the FGPMMOPA6 connected to his serial port. the Atmega328P is planned to be a slave I2C device.

So this Gps board will have all important data available via serial link, in a really nice package ideal for our utilisation. the End user will be able to plug it into a free serial port ( in the case of a serial utilsation ) or on the I2c Bus with all your other sensors.

Price will be something around 55$US

Any interested?

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: I2C GPS

Post by nhadrian »

Good idea.
But I think first we should have a software solution that really works. With an arduino mini or nano and a GPS receiver software can be tested.

JohnyGab
Posts: 144
Joined: Sat Oct 29, 2011 4:41 am

Re: I2C GPS

Post by JohnyGab »

I agree, but thats my question, its there already a software for that?

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: I2C GPS

Post by nhadrian »

I saw only one but was completelly useless, just some copy-paste from MW-code... I posted also my try-out but I'm not a programmer so it didn't work at all. :(

Here is our idea about the software solution and basic working procedure:
viewtopic.php?f=8&t=649&start=110#p7638

EOSBandi (he presented the first in-flight working GPS RTH with MEGA and serial GPS receiver!!!!!!!) will help doing the programming job.

LenzGr
Posts: 166
Joined: Wed Nov 23, 2011 10:50 am
Location: Hamburg, Germany
Contact:

Re: I2C GPS

Post by LenzGr »

Here's is an Arduino I2C GPS shield - it would probably make sense to look at their protocol specs instead of coming up with something completely different. The product page also contains a sample sketch. This way one could either use this existing shield, or create his own one using a serial GPS module and a second Arduino Pro mini.

LenzGr
Posts: 166
Joined: Wed Nov 23, 2011 10:50 am
Location: Hamburg, Germany
Contact:

Re: I2C GPS

Post by LenzGr »

And here's another GPS to I2C project on DIYdrones, including code: I2c GPS frees up Serial Port

marbalon
Posts: 107
Joined: Thu Aug 18, 2011 10:59 am

Re: I2C GPS

Post by marbalon »

I think we should create small as possible board with Atmega168 + GPS and MAG powered using 3v3 to easly connect to i2c ports on many boards. This two devices should be separated with other electronics,ESC etc, int the similar way like in DJI Wookong.

Waldmensch
Posts: 31
Joined: Sat Dec 31, 2011 12:10 am

Re: I2C GPS

Post by Waldmensch »

What about switching the serial port on demand via AUX or by Jumper from GUI communication to GPS communication? Is it really important to see GPS working within GUI?

marbalon
Posts: 107
Joined: Thu Aug 18, 2011 10:59 am

Re: I2C GPS

Post by marbalon »

I think it should works on debug port, but I've made some tests with GPS on pro mini:

- dissable serialComm() function
- read GPS from serial 0
- blink led after every correct NMEA frame

It works fine but only for about 30s, then stop blinking... I have limited time yesterday so will try to run more tests today. I hope it is not memory problem etc.

Regards,
Marcin.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: I2C GPS

Post by timecop »

Of course the proper way to avoid having all this silly stuff is to have some logic in serial receive function, to autodetect GUI connection vs NMEA/MTK binary/UBLOX binary incoming data, then you don't need another serial port.. Even better would be dumping 8bit atmega but i can only dream. You can do same with spektrum receiver too...

LenzGr
Posts: 166
Joined: Wed Nov 23, 2011 10:50 am
Location: Hamburg, Germany
Contact:

Re: I2C GPS

Post by LenzGr »

marbalon wrote:I think we should create small as possible board with Atmega168 + GPS and MAG powered using 3v3 to easly connect to i2c ports on many boards. This two devices should be separated with other electronics,ESC etc, int the similar way like in DJI Wookong.

A similar device actually already exists - take a look at the ArduIMU from DIYdrones. I actually used just this board to control my quadrocopter before I moved to a Seeeduino Mega plus "allinone" and MultiWii...

mon_lolo_fr
Posts: 40
Joined: Tue Nov 15, 2011 9:50 am

Re: I2C GPS

Post by mon_lolo_fr »

Hi all,

nice project in scope ;-)

I'll be interested in helping to realize that thing.

My thoughts are the following:

- the I2C slave (328p + serial GPS on RX0) would simply "publish" (meaning making GPS data available) like a buffer to the I2C master (main 328p that control the copter)
- if data from the GPS unit is valid, make it the lastest version available to the readable I2C address of the slave MCU

What are anyone thoughts ?

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: I2C GPS

Post by nhadrian »

Hi,

first that was the idea. But once we have a secondary processor, why don't use its resources? It can do the complete calculations, later for waypoint flying can communicate with a memory card, etc... and provide the distance, direction values for the primary unit only.

BR
Adrian

User avatar
Gaijin
Posts: 82
Joined: Sat Jan 14, 2012 8:00 am

Re: I2C GPS

Post by Gaijin »

JohnyGab wrote:I started a new thread because its a complete another subject than GPS integration.

I have all the needed stuff home here to make a I2C GPS module, as far as i'm plannin to produce a PCB that will give out the GPS data via serial PIN AND I2C pin. As far as I want to do it the correct way, I would like to know if there is already a Arduino source code ( that run on a atmega328p ) that is a I2C slave device for a Gps integration.

I will make a board 50x50mm with 45mm mounting 3m hole. That will have 2 connectors : Gnd,5V, Tx, Rx. and Gnd, 5V, Sda, Scl

The GPs will be a MediaTek ( FGPMMOPA6 device ) that will give at 115200 baud the most important NMEA strings at 10hz.
There will be a Atmega328P with FTDI port that will have the FGPMMOPA6 connected to his serial port. the Atmega328P is planned to be a slave I2C device.

So this Gps board will have all important data available via serial link, in a really nice package ideal for our utilisation. the End user will be able to plug it into a free serial port ( in the case of a serial utilsation ) or on the I2c Bus with all your other sensors.

Price will be something around 55$US

Any interested?


Count me in although I 'd suggest you keep it a small as practicable for simple remote mounting, you can always package a blank gfk "shield" with it for standard 45mm mounting.

Micros SD card would be great for datalogging but probably too much to begin with, I would think a variant of the I2C shield linked to earlier would be the simplest way to start although I'm not much more than a tinkerer.

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: I2C GPS

Post by EOSBandi »

Code is in the GPS topic. viewtopic.php?f=8&t=649&start=130#p7783 feel free to test it :)
Btwm SD card is too slow for any usable inflight data logging, there must be someting faster (a dataflash chip for example).. ;)

mon_lolo_fr
Posts: 40
Joined: Tue Nov 15, 2011 9:50 am

Re: I2C GPS

Post by mon_lolo_fr »

@EOSBandi: this is impressive, as I just read your code, I'm impressed, really.

I'm wondering if you're working as a developper or in an IT team. Unfortunately I'm not skilly enough to well understand your code (OK, more or less, but not in deep !).

Nice work indeed ! Who test ? ;-)

Post Reply