GY-521 from uno to mega

Hi there,
After the immense help that I got on my first tread, I'm here because I had a problem recently.
I bought a kit off amazon for a robot car, which has basically an arduino uno, two motors, ultrasonic, linetracking and camera with WiFi.
It uses gy-521 to orientate itself and go on a straight line.
I really want to add a speaker, and an sd card reader to play personalised voices.
My problem is that the board uses a customised shield and, since the board doesn't have enough memory, I'm using communication between two boards.
I bought an arduino mega so that I could have more pins and connect everything, I asked for some advice to the producer and it said that the gy-521 won't work as it uses different pins... does anyone know how to solve this?

@loddem, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with your project :wink: See About the Installation & Troubleshooting category.

You basically have 3 options to communicate. Serial, I2C and SPI; you can use those to data from the Uno to the Mega.

Do you have a link to the robot car that you bought or preferably the schematic of the shield.

Can I send the amazon link?
ConquerorCar-Shield-V1.0.pdf (189.6 KB)
This is the pdf that they sent me for the shield pinout :slight_smile:
It would connect to the uno

By the looks of it, pins 3 and A3 are free and can be used for a SoftwareSerial implementation at the Uno side; you can connect that to e.g. Serial1 of the Mega. And you can use I2C (A4/A5) where the Uno is the master and the Mega is the slave.

SPI is not possible.

I think there is a bit of a stupidity by the designers. If you look at your Uno, you will see that there are a few additional pins next to pin 13; they also carry the I2C bus. If the shield would have used those, I2C would have worked on the Mega as well; you can probably make a hack for it.

Yeah... if I did that I couldn't use the x-y axis module, I decided to return the product and get a better robot that actually allows me to implement things... the seller has been very impatient and not helpful at all..

Did what? Use I2C?

I2C is a bus and you can connect multiple devices to it.

Can i connect two devices to the the bus?
When I emailed them they said that it wouldn't be possible to use gy-521 due to the fact that the board doesn't have enough pins to have both the gy and the sd card reader and the uarp.
I decided to return the product and get a better robot.
They said that using the gy wouldn't be possible on the mega board as the a4 and a5 aren't the same on the mega...and they said the iic library can't be changed so it wouldn't work...

A card reader uses SPI and those pins are already used for different functions.

You can connect multiple devices to the I2C bus so your Uno can communicate with both the MPU6050 and a Mega.

I have no idea what a uarp is.

That's correct; see my comment in previous post about 'stupidity'.

Maybe there was a misunderstanding from my side; I thought that you wanted to communicate between an Uno and a Mega.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.