Arduino Digital Output Pin Voltage

Hi sorry if this is posted in the wrong place.

I have two questions.

I'm using an Arduino for a project and thought I'd measure the actual voltage of a Digitial Output pin when it's set to high.

I was expecting to see 5V but I measured 4.88V.

Is there a certain tolerance that devices assume something is high or low.

i.e. would the 4.88V be read as high by a transistor or relay etc.

If so what are the 'general' tolerances.

Secondly I gather that TTL stands for Transistor Transistor Logic - what does this mean is an Arduino a TTL device?

Thanks in advance,

Have a fantastic day!

:)

Did you measure Vcc? If you are using USB power it can be 4.75V to 5.25V.

The ATmega running at Vcc=5V will treat anything over 3.0V (5V*0.6) as a logic HIGH so there is plenty of margin.

The ATmega328P is a low-power CMOS (Complementary Symmetry Metal Oxide Semiconductor) chip. It can run on a wide range of voltages. When it runs at 5V it is compatible with TTL logic levels.

From the datasheet (Electrical Characteristics), for a supply voltage of 5 volts, a LOW is from -0.5 to 1.5 volts, and a HIGH is from 3 volts to 5.5volts.

Specifically, a LOW is -0.5 to 0.3Vcc, and a HIGH is 0.6Vcc to Vcc+0.5, for values of Vcc between 2.4 and 5.5 volts.

Oops, sorry, input voltages.

Outputs are a maximum LOW of 0.9V, and a minimum HIGH of 4.2volts at 20mA.

Every transistor has some voltage drop across its Collector/Emitter (Vce) for an NPN/PNP transistors, and across its Drain/Source (Vds) for a MOSFET transistor. ATMega uses MOSFET type transistors. When the output is high, there is some small voltage drop across the transistor that connects the output pin to Vcc. This drop increases as current flow increases, so the output is always a little below Vcc. When the output is low, there is some small voltage drop across the transistor that connects the output pin to Gnd. This drop increases as current flow increases, so the output is always a little above Gnd.

The output transistors on Arduino pins have about 40 ohms resistance if I remember right - however they have an absolute max rating of 40mA current too, so any safe use of the output pin will produce 1.6V or less for LOW and 3.4V or more for HIGH. Without a load on the pin you are measuring the +5V rail (unless your multimeter has a very low resistance).

TTL is an entirely separate (and obsolete) bipolar logic family - basically TTL and Arduino will inter-work, but you can’t strictly speaking guarantee that a TTL output can drive an Arduino input high since TTL outputs are only guaranteed to generate 2.5V when high (most will in fact give a lot higher, and the problem is easily cured with a pull-up resistor).

Any logic family is characterised by 4 voltages, VIL, VIH, VOL, VOH (being the guaranteed input voltages and guaranteed output voltages assuming fully loaded according to the family specifications. The key properly is that 0V < VOL < VIL < VIH < VOH < Vdd

BTW these voltages apply to fast changing signals not just DC voltages, TTL outputs rise to a lot higher than 2.5V in a millisecond, its how high they rise in the specified signal rise-time (~ 15ns) that matters for true compatibility.

[ BTW the use of Vcc and Vdd for logic positive rails is a bit random (for TTL the positive rail connects to the transistor collectors, hence Vcc. For early MOS logic families the positive rail connected to the drains (hence Vdd), but with CMOS both supply rails actually connect to MOS source’s, but we still call the positive supply Vdd and the ground Vss sometimes. Where is the logic! ]

Hi everyone.

First of all thank you for all your replies - apologies I haven't got back sooner.

I'm still a little confused and still have some questions. According to http://www.jameco.com/Jameco/Products/ProdDS/2121105.pdf

'The ATmega328 provides UART TTL (5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega8U2 on the board channels this serial communication over USB and appears as a virtual com port to software on the computer.'

What does this actually mean. That board uses TTL to talk to the computer and then when it received a TTL signal it converts it to something else that the Arduinio is can understand?

Also what does Vcc mean? :blush:

AWOL: 'Outputs are a maximum LOW of 0.9V, and a minimum HIGH of 4.2volts at 20mA.' Does mean that the Voltage signalling levels change with current? - Since this is a report is there any documentation that states these facts?

Thanks in advance once again!

:)

First question - the ATMega chip talks to the Serial adapter using TTL levels; Low down towards 0V, High up towards whatever the supply voltage is (3.3V or 5V). The Serial adapter then does its thing to talk to the PC via USB (whole 'nother processor there). Other Serial adapters can also be used: RS232, with signals swinging from +5 to -5 (up to +12 to -12 as well), RS485/RS422 (with the Rx and Tx signal each going over a pair of wires), etc.

Second question - Vcc is the supply voltage, 3.3V or 5V.

Third question - yes voltage can vary with current - creeping up away from 0, and down from 5V. ATMega datasheet clearly spells this out. Above 40mA, output pins are prone to damage and/or failure. Para. 30.2.8 Pin Driver Strength has a graph showing the same.

Thanks you very much for your quick reply and explanation.

I need to go and read the data sheet in more detail.

Thanks once again.

'The ATmega328 provides UART TTL (5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX).

In the beginning, before there was USB and I2C and SPI, the term 'serial communication' generally referred to RS-232 (recommended standard #232). Among other things such as timing, connector polarity, etc this standard said that logic level '1' was to be represented by a negative voltage and logic level '0' was to be represented by a positive voltage.

In the middle ages, after there was RTL and before there was CMOS, there was TTL where logic '1' was represented by +5 volts (nominally) and logic '0' was represented by zero volts.

When you see the term 'TTL (5V) serial communication' this generally means serial communications using the timing specified by RS-232 along with logic levels specified by TTL.

An ATmega8U2 on the board channels this serial communication over USB and appears as a virtual com port to software on the computer.

In the beginning most desktop computers had one or more serial (RS-232) ports but current computers are supplied almost exclusively with USB ports. Most current microprocessors, on the other hand, have UART chips that generate the aforementioned TTL serial signals. The ATmega8U2 on the other hand is a microprocessor that does have USB capability. In this case such a chip has been programmed to convert from USB serial signals to TTL serial signals and vice versa.

Don

Thanks Don!

I didn't realise there was so much to it.

So to sum up USB serial signals are sent through the computer's USB port to the ATMega8U2 where it converts those signals to TTL.

When sending data back to the computer the ATMega8U2 converts these TTL signals back to USB?

Am I getting closer?

I found this graph and assume we're referring to the 3rd bar in? - http://www.interfacebus.com/voltage_threshold.html

Thanks once again - I'm new to electronics.

For the TTL compatible part, the ATMega and 8U2 USB chip, its more the first bar, but compatible with parts meeting the 2nd & 3rd bar.

Thanks for your patience CrossRoads.

Things are never as simple as they seem!

XD

Am I getting closer?

That’s close enough!

I found this graph … Logic Voltage Thresholds for TTL, CMOS, LVCMOS, and GTLP IC families

That’s an interesting graph. To interpret it correctly you have to understand the difference between such terms as VOH and VIH.

VOH is the minimum output voltage that should be provided by a device that is generating a logic ‘1’.

VIH is the minimum input voltage that should be interpreted as a logic ‘1’ at the receiving end.

The difference between these allows for the voltage drop in the interconnecting wires.

Don

[Edit]: I’m not sure why the chart seems to emphasize (or even mention) the threshold voltage. The whole Violet and Blue region is never-never land.

My definitions above don’t seem to agree with those of the author of the chart. Comments anyone??

More of my definitions:
VIL is the maximum input voltage that should be interpreted as a logic ‘0’ at the receiving end.

VOL (Green/Yellow border) is the maximum output voltage that should be provided by a device that is generating a logic ‘0’.