What does "LOW" and "HIGH" really mean?

For 5v “HIGH” is 5v and “LOW” is 0v, right?

Well, not quite - having inadvetently created a voltage divider on an input to an IC I found it isn’t quite the case!

So a bit of research starting with the datasheet for the IC revealed nowt.

More general research (my friend google) came up with the following definitions for a 5v supply

LOW = 0 - 1.5 v

HIGH = 3.5 - 5v

But I couldn’t find a formula for calculating different values for different voltages, or even whether this is an industry standard for IC’s.

Does anyone know of such a formula,or can provide a link to one?

Thanks - Richard

There are some standards like CMOS and TTL. The Arduino is CMOS but generally the easiest way is to look at the datasheet.

For the ATmega328p (page 308) it states:
LOW is between -0,5V and 0,3 x Vcc
HIGH is between 0,7 x Vcc and Vcc + 0,5V

So if the supply (Vcc) is exactly 5V would be
LOW is between -0,5V and 1,5V
HIGH is between 3,5V and 5,5V

So note, its different on for example 4V!

LOW and HIGH are just #defined as 0 and 1, ie, digitalRead() returns a 0 or 1, and we often test against the HIGH/LOW defines instead of 0 or 1 to make intent clear to readers. Its very common to directly take advantage of this in more advanced sketches.

As for what voltages are treated as a high or low, those are Vil and Vih (input voltage low and high). This is specified in the electrical charachteristics section of the datasheet, typicaly as a max Vil (the maximum voltage at which its guaranteed to read low) and]etween these, it could read as either high or low. Often these depend on opperating voltage

You

septillion:
For the ATmega328p (page 308) it states:
LOW is between -0,5V and 0,3 x Vcc
HIGH is between 0,7 x Vcc and Vcc + 0,5V

That's the table for the serial interface.

Page 313 states 0.3VCC and 0.6VCC, 1.5volt and 3volt on a 5volt supply.
so a 5volt Arduino can still reliably detect the 3.3volt output from a 3.3volt sensor as 'high'.
Leo..

DrAzzy:
LOW and HIGH are just #defined as 0 and 1, ie, digitalRead() returns a 0 or 1, and we often test against the HIGH/LOW defines instead of 0 or 1 to make intent clear to readers. Its very common to directly take advantage of this in more advanced sketches.

As for what voltages are treated as a high or low, those are Vil and Vih (input voltage low and high). This is specified in the electrical charachteristics section of the datasheet, typicaly as a max Vil (the maximum voltage at which its guaranteed to read low) and]etween these, it could read as either high or low. Often these depend on opperating voltage

You

Gotit - it was indeed in the datasheet, now I know what I'm looking for. I was looking for data associated with the specific input pin, but now realise its a general specification for all of them. Doh!

The datasheet in this instance (Texas Instruments for the 74HC595) shows the Vil and Vih for a Vcc of 2, 4.5 and 6 volts so I guess unless I'm going to control Vcc to those specific values, simply ensuring that my High and Low are well within the specified ranges will do the job.

Wawa:
That's the table for the serial interface.

Crap, looked to quick! :confused:

Wawa:
so a 5volt Arduino can still reliably detect the 3.3volt output from a 3.3volt sensor as 'high'.
Leo..

Hmm, I doubt that. The 3.3volt sensor might have it's own idea of an HIGH output which might just be identically defined as 0.6Vcc leading to an output voltage of 0.6*3.3 = 2V.
At least "reliably" is not an adequate term

You would have a pretty pretty terrible sensor if that's the case. You would even run into trouble quickly with a normal 3V3 device... If looking at the ATmega as an example if gives 0,85 x Vcc in a pretty unfortunate situation. On signal lines the currents are low so there just isn't much to pulling it from Vcc.

So with 0,6 x Vcc there's not a terrible amount of headroom but works fine. It's even done quite a lot. For example, quite a lot of USB-Serial adapters use 3V3 on the signal lines even when they have a switch for 5V-3V3... Or communication between a NRF24L01+ and an Arduino...

olf2012:
Hmm, I doubt that. The 3.3volt sensor might have it's own idea of an HIGH output which might just be identically defined as 0.6Vcc leading to an output voltage of 0.6*3.3 = 2V.
At least "reliably" is not an adequate term

You can rely on most CMOS logic devices to output right to the rails (if drawing negligible current) as
a CMOS output stage is a pair of FETs, an nFET pulling to GND, a pFET pulling to Vcc. The important
exception is a device with an open-drain output, which requires a pull-up resistor.

If interfacing to old TTL logic, you have to be more careful about voltage levels as those do not output
to the rails (most need 5.0V supply and output HIGH only to 2.4V and require a pullup resistor)