HOME - - - - - - - - Table of contents, my Arduino "How To" articles
Other material for programmers     

What voltage? 3v3? 5v?
And dealing with having both in one project

The basics for people getting started

filename: aht1intro3v3vs5.htm

For many years, Arduinos (and similar) operated on 5 volts... and you had to have a power supply that gave you something quite close to 5v.

And then, for various good reasons, some new devices came out which run on 3.3 volts (which is often written "3v3", which makes sense to me, hence it will be what you see from now on.)

I am a resister of change with the best of them, but I do have to admit that there are real advantages to the 3v3 devices. (Which I will spare you.)

A detail: It is always the case in my pages, but I should stress, here, that when I say "Arduino", I am using that term in the broad sense, encompassing both devices from the official home of Arduino, and clones.


So what do you need to take care over?

In many respects whether you are using a 5v device or a 3v3 device doesn't matter.

Connecting the Arduino to the computer used to program it

If your Arduino has a built in USB interface, you just plug it in to your big computer the same way as you plugged in 5v devices. (The USB provides 5v. Circuits on the Arduino turn that into some 3v3 for the needs of the board. There is usually a little left over for things connected to the board... but do not expect to be able to connect things that draw much power. (Check the Arduino's specs. Somewhere it will tell you that up to xx mA's worth of things can be driven from the 3v3 coming from the board. This whole question of "how much?" is often difficult for beginners... and it is important to master it. I have a page! It tries to explain how to avoid overloading a power supply.)

You may be using an Arduino which does not have a built in USB interface. In which case you probably connect with a special cable, or an ordinary cable with a "thing" between it and the Arduino. An "FTDI" interface. In that case, you need different interfaces, depending on which voltage your Arduino uses.

Connecting the Arduino to inputs and outputs

If you are connecting switches to give your project inputs, you do it the same way for either voltage.

If you are hooking up simple LEDs, you will probably have to change the size of the resistor you use. (This would also be true if you were sending an output through the LED in an opto-coupler.)

If you have an output driving the base of a transistor, so that the transistor can turn something else on and off, that will probably be okay... especially if the voltage for the "something else" comes from elsewhere.

Two paragraphs on connecting simple potentiometer:

Connecting a potentiometer (or equivalent) is the same... as long as you grasp the "obvious" fact that the pin you would connect to 5v for a 5v Arduino needs to go to 3v3 when you are using a 3v3 Arduino. I presume you would be doing the ordinary thing, sending the "output" of the potentiometer to an analog input on the Arduino.

Beware: There are a few 3v3 Arduinos... or at least a few Arduino clones... out there which should not have more than 1.0v applied to an analog input. At least that's something I've seen in their specs. I'm not sure that damage would arise... it may just be that anything above 1.0v will simply return the same value as 1.0v returns.

Moving on from potentiometers...

Once you go beyond past these basics, you will have to be careful.

Fancier peripherals

Of course, we want to connect everything to our Arduinos.... and we can! (Almost. It's half the fun, after all!)

Be careful. If something is meant to run on 5v, it is likely that its inputs and outputs expect 5v signals.

There are SOME exceptions. (The Teensy is a 3v3 device, but its inputs are "5 volt tolerant". But don't expect 5v tolerance from everyone!)

You might sometimes "get away" with using a 3v3 output to drive an input on a 5v device. But is isn't a good practice. I wouldn't even try it.

The good news is this... there are ways to "level shift".

A very robust way is to use opto-couplers. But that's an elephant gun.

Sparkfun, and no doubt others, offer small, inexpensive ($3 (1/19) for 4 independent channels) level shifting modules. You hook up a source of 3v3. You hook up a source of 5v. And "presto"... you now have one or more pairs of pins. You connect one to an input, and from the other you get an output. The signal is "passing through" the module.

The signal arriving at the input might be 3v3. In that case, the output from the other side of the lever shifter would be a 5v signal.

A channel can also be used in the other direction. It doesn't even need any "configuration".

You can pass signals from 5v to 3v3, or pass them the other way. (Not at the same time! But if your module has multiple channels, you can use any mix of them- some from 5v to 3v3, others from 3v3 to 5.)

Good, good? Just don't get carried away... a given channel, in a given application, must be dedicated to data flowing one way. Treat both sides of a channel as inputs... in other words, try to drive both with outputs of other things, and you may well have a problem.


I hope that has taken some of the "mystery" away?

I avoided 3v3 devices for quite a while, just not wanting to "deal with all that". Actually... there's not a lot to deal with. Enjoy!


   Search this site or the web        powered by FreeFind
 
  Site search Web search
Site Map    What's New    Search

The search engine is not intelligent. It merely seeks the words you specify. It will not do anything sensible with "What does the 'could not compile' error mean?" It will just return references to pages with "what", "does", "could", "not".... etc.
In addition to the tutorials for which this page serves as Table of Contents, I have other sites with material you might find useful.....

Sequenced set of tutorials on Arduino programming and electronics interfacing.
Tutorials about the free database supplied with Open Office/ Libre Office.

Some pages for programmers.
Using the parallel port of a Windows computer.


If you visit 1&1's site from here, it helps me. They host my website, and I wouldn't put this link up for them if I wasn't happy with their service.




Ad from page's editor: Yes.. I do enjoy compiling these things for you... hope they are helpful. However.. this doesn't pay my bills!!! If you find this stuff useful, (and you run an MS-DOS or Windows PC) please visit my freeware and shareware page, download something, and circulate it for me? Links on your page to this page would also be appreciated!

Click here to visit editor's Sheepdog Software (tm) freeware, shareware pages.. Material on this page © TK Boyd 02 Feb 19


And if you liked that, or want different things, here are some more pages from the editor of these tutorials....

Click here to visit the homepage of my biggest site.

Click here to visit the homepage of Sheepdogsoftware.co.uk. Apologies if the "?FrmAht" I added to that link causes your browser problems. Please let me know, if so?

Click here to visit editor's pages about using computers in Sensing and Control, e.g. weather logging.



To email this page's editor, Tom Boyd.... Editor's email address. Suggestions welcomed!


Valid HTML 4.01 Transitional Page tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org


Why does this page cause a script to run? Because of the Google panels, and the code for the search button. Why do I mention the script? Be sure you know all you need to about spyware.

....... P a g e . . . E n d s .....