0

i am doing a Ultimate GPS module like this:enter image description here

it works when i use arduino UNO board, but when I use arduino micro board it doesn't work, so could anyone tell me how to fix it?.By the way I use the example code in GPS library.

UNO: the data looks like messy code enter image description here

Micro: didn't give me any time, date or fix enter image description here

1

Your photo shows the GPS connected to pins 0 and 1 (RX and TX) on the UNO. But you don't show the sketch you are running. Do you have it set that way in the sketch?

It turns out the micro and UNO are different in the way those pins work. From http://arduino.cc/en/Main/arduinoBoardMicro

Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data using the ATmega32U4 hardware serial capability. Note that on the Micro, the Serial class refers to USB (CDC) communication; for TTL serial on pins 0 and 1, use the Serial1 class.

This suggests to me that you'd need to change the code to read pins 0 and 1.

Easier is probably to wire it up to pins 2 and 3 and use the defaults in the sketch

// If using software serial, keep this line enabled
// (you can change the pin numbers to match your wiring):
SoftwareSerial mySerial(3, 2);
  • learn.adafruit.com/downloads/pdf/adafruit-ultimate-gps.pdf actually, the first photo is from Page 7. And the second photo is the result that showed on serial Monitor after i wired it like Page 11, the last one is the result after I change the board to micro. and I use example code in ultimate GPS library – weiyu lu Apr 3 '15 at 0:14
  • The important parts of your question should be: how is it wired up and what is the sketch doing? The only source for the first is the photo, so if it doesn't reflect your wiring, please tell us how it's wired The current example library uses pins 2 and 3, so I don't know if you've modified yours. Pasting the sketch (or at least the relevant bits from the top where the pins are set) would be recommended. – BowlOfRed Apr 3 '15 at 4:51
0

The Arduino Uno and Micro, in practice, work almost exactly the same. Just make sure that your wiring is correct (In this photo, the wires go from TX to TX and RX to RX, they should go between TX on one board and RX on the other, and vice versa.

Your code should work on a micro exactly as it does on an Uno. That is one of the best features of Arduino; the ability to port code to another board without much (if any) modification.

  • I am sure my wiring is correct. Actually, it should show me something on the serial Monitor after uploading the code, but it doesn't if I use Micro board. – weiyu lu Apr 2 '15 at 20:41
  • @weiyulu That is strange. Can you get another sketch on the micro to send something on the serial monitor, to see if it is an issue with the micro or not? – harry_p_6 Apr 2 '15 at 20:45
  • learn.adafruit.com/downloads/pdf/adafruit-ultimate-gps.pdf this is the ulitmate GPS guide, i just do what the guide ask me to do, and the serial monitor should show something like page 13, but in my serial monitor it doesn't show the correct data, like this: Time: 0:0:0.0 Date: 0/0/200 Fix: 0 quality: 0 – weiyu lu Apr 2 '15 at 21:13
  • Right. I think what you are doing wrong is your wiring. For the sketch to work as on page 13, you need to connect TX on the GPS up to pin 3 of the Arduino and RX of the GPS up to pin 2 on the arduino. Then, make sure you have downloaded the library and uploaded the sample code. Then open your serial monitor and it should display as in page 13. Could you do this with both arduinos, making sure you wire up the pins not as in the photo above, but as I just said, and then tell me the results on both arduinos? The wiring as in page 11 By the way. @weiyulu – harry_p_6 Apr 2 '15 at 21:58
  • @ harry_p_6 this time i wired exact the same like page 11, but it still didn't work. I put the result photo in the question. – weiyu lu Apr 2 '15 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.