Pages: [1]   Go Down
Author Topic: voltage divider vs logic level converter?  (Read 2672 times)
0 Members and 1 Guest are viewing this topic.
Dallas, Texas
Offline Offline
Sr. Member
****
Karma: 3
Posts: 267
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I purchased an arduino which is based on 5v but I will need to drive some 3v RF modules. I was planning on using a voltage divider, built with some simple resisters. In reading about them, I found several posts which indicated voltage dividers imposed a performance hit. As such, others recommend the use of a logic level converter rather than a voltage divider. I was under the impression no such performance hit would occur since it was built strictly with resisters, having no capacitors.

1 Can someone please clarify if a voltage divider does in fact impose certain performance negatives and if so, why?

2 Can someone please clarify when one should use a voltage divider and when one should use a logic level converter?

For completeness, if I do need a logic level converter, I'm looking at these. And the RF modules I'm looking at these.

Thanks.
Logged


Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I purchased an arduino which is based on 5v but I will need to drive some 3v RF modules. I was planning on using a voltage divider, built with some simple resisters. In reading about them, I found several posts which indicated voltage dividers imposed a performance hit. As such, others recommend the use of a logic level converter rather than a voltage divider. I was under the impression no such performance hit would occur since it was built strictly with resisters, having no capacitors.

1 Can someone please clarify if a voltage divider does in fact impose certain performance negatives and if so, why?

No performance hit if the reduced voltage is for logic signal inputs for external components (like your RF module), if for providing significant current for some purpose then it's not a solution.

2 Can someone please clarify when one should use a voltage divider and when one should use a logic level converter?

Again it's about what current demand is as well as voltage level. If significant current is required then don't use resistors.

For completeness, if I do need a logic level converter, I'm looking at these. And the RF modules I'm looking at these.

Voltage dividers should work fine. Of course you only require voltage dividers for the arduino digital output pins driving the RF module. The 3.3vdc logic signal outputs from the RF module wired to the arduino input pins must be wired directly as a 3.3vdc logic high is high enough to be read as a high logic level in a 5vdc arduino board.
Thanks.

Logged

Dallas, Texas
Offline Offline
Sr. Member
****
Karma: 3
Posts: 267
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for the clarification.

Voltage dividers should work fine. Of course you only require voltage dividers for the arduino digital output pins driving the RF module. The 3.3vdc logic signal outputs from the RF module wired to the arduino input pins must be wired directly as a 3.3vdc logic high is high enough to be read as a high logic level in a 5vdc arduino board.

I'm not sure I entirely understand you so I'll try to paraphrase. The 3v3 out of the RF module should be wired directly to the arduino's 5v input. I read the arduino could be driven with 3v3 inputs. This is what you're saying? Perhaps this is why many recommend the logic level converter as 3.3v doesn't technically meet the 5v TTL high requirements and the converter is sure to the right thing for a small price?

Thanks,
Logged


Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm not sure I entirely understand you so I'll try to paraphrase. The 3v3 out of the RF module should be wired directly to the arduino's 5v input. I read the arduino could be driven with 3v3 inputs. This is what you're saying? Perhaps this is why many recommend the logic level converter as 3.3v doesn't technically meet the 5v TTL high requirements and the converter is sure to the right thing for a small price?

You paraphased correctly. The arduino digital voltage input minimum for a legal HIGH is .6 X Vcc so at 5vdc a high must be 3.0 volts or higher (to Vcc + .5vdc max), so a 3.3 volt signal will be read as a HIGH but with only .3vdc noise margin. So for industrial or commercial use one might want to use voltage level convertors for both inputs and outputs, but most arduino users have had little problems with reading 3.3v logic signals directly as inputs. Output conversion, using either convertors or voltage dividers are required when driving signal to 3.3v systems unless those 3.3v logic input pins are so called 5 volt tolerant (which some are) in those case you can wire directly also.

Lefty
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
1 Can someone please clarify if a voltage divider does in fact impose certain performance negatives and if so, why?

There can be a performance issue with resistors. The reason is that all signals have capacitance on them, mostly contributed by the IC pins the signal is connected to, with a small contribution from the PCB traces themselves. The resistance you are adding combined with this capacitance forms an RC filter which smooths out the sharp edges of the digital signals, and for some receiving devices sharp edges are required for proper operation.  We've seen 1k resistors added in series with digital lines cause an SPI device to cease working, and reducing the resistor to 100 ohms restores proper operation. Some digital edges are just expected to be "fast".

Quote
2 Can someone please clarify when one should use a voltage divider and when one should use a logic level converter?

One should use a voltage divider when cost is an issue and speed of signal rise/fall time doesn't matter (e.g., SPI data lines instead of the SPI clock line).

Quote
Perhaps this is why many recommend the logic level converter as 3.3v doesn't technically meet the 5v TTL high requirements and the converter is sure to the right thing for a small price?

Right. Some 3.3V devices output voltages very close to 3.3V and work just fine when connected to an Arduino input. Other "3.3V devices" output voltages that are "high enough" for other 3.3V devices (e.g., 2.5V) but no longer work with a 5V Arduino.

If you're dropping money at Sparkfun anyways I don't think it would hurt to spend $1.95 to buy a little insurance. But get the resistors as well and try them -- it sounds like there's a learning opportunity here smiley

--
The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected

Logged

Dallas, Texas
Offline Offline
Sr. Member
****
Karma: 3
Posts: 267
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks so much for your patience and time. This place is a wonderful resource.
« Last Edit: June 12, 2011, 10:54:57 am by gerg » Logged


Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So so much for your patience and time. This place is a wonderful resource.


Yes it is, for all of us. My only direct experiance with interfacing an arduino to a 3.3vdc module was for a bluetooth modem module. I used a small 10k trimmer pot for the data to the module adjusted for 3.3vdc and wired the recieve data line directly to the arduino input pin. It works fine at 57600 baud.

Lefty
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 625
Posts: 34107
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can also get a performance hit on things like SD card readers. Some SD cards are more fussy than others when it comes to signal edges. Lady Ada does a wave shield that incorporates an SD card. On the first release of the electronics she used voltage dividers, but some customers were reporting troubles so now she uses logic level converters.
Logged

Dallas, Texas
Offline Offline
Sr. Member
****
Karma: 3
Posts: 267
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can also get a performance hit on things like SD card readers. Some SD cards are more fussy than others when it comes to signal edges. Lady Ada does a wave shield that incorporates an SD card. On the first release of the electronics she used voltage dividers, but some customers were reporting troubles so now she uses logic level converters.

But which was the root cause? Was it a problem because a voltage divider was used or because the provided voltage was right at the trigger threshold, or perhaps because the SD reader's threshold specifications were pushed at its limits and didn't provide for consistency? That would appear to be rather anecdotal. Isn't the divider only changing the voltage and not the speed of the signal? If so, doesn't that imply the root problem lay elsewhere and that replacement of the voltage divider was just the cheapest, fastest route to a solution?

EDIT: To be clear, I'm not trying to be a smart arse here. I'm asking because clarification would be nice. Based on the above comments, my assumptions (to me) appear to be legitimate.
« Last Edit: June 12, 2011, 02:15:04 pm by gerg » Logged


Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 625
Posts: 34107
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Was it a problem because a voltage divider was used
Yes it slowed down the edges like I said.

Quote
perhaps because the SD reader's threshold specifications were pushed at its limits and didn't provide for consistency?
No they left that bit alone, the logic converters only replaced the voltage dividers.
Logged

Dallas, Texas
Offline Offline
Sr. Member
****
Karma: 3
Posts: 267
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Was it a problem because a voltage divider was used
Yes it slowed down the edges like I said.

Please keep in mind my background is not hardware. Sorry if this is a dumb question. How does a resister "slow down the edge"?
Logged


Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 625
Posts: 34107
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
How does a resister "slow down the edge"?
Not at all a dumb question but given that RuggedCircuits described how it does it in reply #4, well ....

Anyway it does it because of the combination of resistance and the capacitance in the tracks an on the input to the device. This is known as stray capacitance and is always present in every practical circuit. The combination of a series resistor and capacitor to ground forms a low pass filter. A perfect edge, that is a change from one logic level to another, consists of an infinite number of harmonics or frequencies. If those harmonics don't go all the way up to infinity but stop short (as all practical circuits will) then the edge can't be perfect and therefore the edge has a finite rise time. The resistor and stray capacitance form a filter that limits the number of harmonics in the edge more than it normally would be, and so the rise time is longer than it normally would be. The bigger the resistance or large the capacitance the slower the edge rises.
All digital components need the rise time on the edges to be a minimum value, this varies considerably so see the data sheet on the component you have in mind.
An SD card with it's socket is a particularly rich source of stray capacitance and cheap memory in SD cards sometimes do not have the specification you would hope for.
Logged

Dallas, Texas
Offline Offline
Sr. Member
****
Karma: 3
Posts: 267
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay. That makes sense.

I think you said it, but I want to clarify. In this case, the capacitance comes from circuits in the IC on both sides of the divider? Whereby the divider only adds to the harmonic? Correct me as need.

So it seems there was a some truth in what I had originally read.

Thanks.

Logged


Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 625
Posts: 34107
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Whereby the divider only adds to the harmonic?
Not quite, there is capacitance all round but the resistor works with the capacitor to make a filter. For a discussion of simple RC filters see this page:-
http://www.thebox.myzen.co.uk/Tutorial/PWM.html
It is the reduction of the number of harmonics not the addition that makes the rise time slower.
Logged

Dallas, Texas
Offline Offline
Sr. Member
****
Karma: 3
Posts: 267
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Whereby the divider only adds to the harmonic?
Not quite, there is capacitance all round but the resistor works with the capacitor to make a filter. For a discussion of simple RC filters see this page:-
http://www.thebox.myzen.co.uk/Tutorial/PWM.html
It is the reduction of the number of harmonics not the addition that makes the rise time slower.

Ohhh....

Thanks for the link. I'll check that out.

Again, thanks for everyone's patience and contributions.
Logged


Pages: [1]   Go Up
Jump to: