So I got a MT3329 GPS chip and I'm trying to wire it up to my arduino Duemilenove. I'm relatively new to this aspect of electronics so I thought that this would be a relatively easy but informative project. So far, though, I've got nothing from the module. The MT3329's TX pin goes to the arduino RX pin, and the Arduino's TX pin goes to the MT3329's TX pin. However, when I test the voltage level of the arduinos TX, I've notices that its 5 volts.With the Module, its ~3.3 volts (around 3.4 volts)
My question is this:
Can the arduino read 3.3 volt TTL logic levels, hence why I don't seem to be getting data from it? If it can't, what do I need to scale the module's 3.3 volt logic to the arduino's logic level? Is it a simple transistor, or more complex?
Little background: I've tried reading the chips serial data by: Using the software Serial library, Also writing to eeprom from the default TX/RX when the arduino is unplugged, all to no avail?
Please help ASAP as I have an entire weekend at which I can do whatever I like, which can't be said for the week afterwards
Bad news, you may have damaged your gps chip. Good news, if not, all you need is a level translator that will translate 3.3v logic and 5v logic (or use a 3.3v arduino)
Ahhhh okay, thanks! the MT3329 has a USB option so i'll try that. If thats bad, I'll know I've damaged the chip. If its good I'll get a translator, Thanks! I don't suppose you'd know the part number/ chip number of the kind of translator I'd need to get?
Lady Ada, Sparkfun, and others offer breakout boards with the converters. If you just want a chip, there are a number of options, but I use a 74HC4050E
The Arduino/ATmega should be (and often is) happy with 3V3 data coming in (at RX), you shouldn't need to "scale up".
The GPS might not like taking 5V data in, but you could scale that down with a voltage divider.
- If you had a couple of transistors and a few resistors, it'd be easy to make a couple of inverting switches, a double inverter, to bring this up to 5V instead of buying ICs and so on. * * * *
The Arduino/ATmega should be (and often is) happy with 3V3 data coming in
Really? Let’s look at the datasheet. The ATmega328 datasheets says:
VIH (voltage for an input high) min 0.7VCC
and a footnote says:
“Min” means the lowest value where the pin is guaranteed to be read as high
VCC on the Arduino is 5V. 0.7 * 5V = 3.5V.
So, according to the datasheet, you can NOT count on a standard 5V arduino to read a 3.3V signal as high.
You didn't quite read the chart in Section 29 correctly kg4wsv:
Input High Voltage, except XTAL1 and RESET pins
VCC = 2.4V - 5.5V
VinHi Min = 0.6VCC
“Min.” means the lowest value where the pin is guaranteed to be read as high
0.6 * 5V = 3V.
You didn’t quite read the chart in Section 29 correctly
eh? “29. Instruction Set Summary”. What’s that got to do with it?
Turns out I’m looking at the “ATmega48P/88P/168P/328P” full datasheet, dated 02/09. crossroads is right, I obviously read the wrong line.
BUT: what is the minimum VOH for the other device? Looking at the MT3329 GPS datasheet,
TXA TTL H Level VCC=3.3V 2.1V - 2.8V
So, maximum VOH is 2.8V, but minimum VIH for a 5V ATmega328P is 0.6*VCC = 3.0V.
This will probably work, but it will not be reliable. This is how you get circuits that seem to work, but act squirrelly when the battery gets low, or when you move it out to the car and it’s cold outside, or …
I was reading Section 29, Electrical Characteristics, from '328 Spec Rev 8271D-AVR-05/11.
Time to upgrade your copy?
Complete doc is up to 558 pages plus 8 pages of Table of Contents at the end of the document.
5/11 seems to be the latest Rev:
(file size: 21150715, 567 pages, revision D, updated: 05/2011)
(file size: 501131, 35 pages, revision D, updated: 05/2011)
2.8V feeding in could be a problem.
Maybe run from 4.5V instead of 5:
4.5 * .6 = 2.7
The other option would be to run the GPS at a slightly higher voltage.
From its datasheet:
Operation supply Voltage Min=3.2v Typ=3.3v Max=5v
So if you were to go for something like 4v for the GPS, that would push up its TX voltage to ~3.5V
From the discussion, it sounds like 0.6*5V = 3V input to the Arduino should be
ok, but if you chose to do level-shifting, then rather than wiring up a complete
chip, you could use
a series-diode [1N914] and pullup resistor [4.7K to 5V] on the TX out of the
GPS module, to give 3.3+0.7V = 4V input to the Arduino.
a simple voltage divider[as others suggested], 2.4K series w/4.7K to ground
on the RX input pin to the GPS module.