Technical notes on mixed voltage issues in electronic projects.
For electronics people only – if you are not interested in electronics tech stuff stop reading now or you will regret it (and you might regret it even if you are into electronics). What follows is more of a general discussion about mixed voltages in electronics projects and some of the issues to be aware of with examples from the tracker electronics, skip this if you don’t care about electronics stuff but I thought it might be helpful because it is something that you have to be very careful about or you can destroy devices and there is a lot of confusion out there on this subject by many people.
It’s a 5v and 3.3v world. The vast majority of hobbyist micro-controllers and various boards you can connect to them will run at either 5v or 3.3v. In some cases you can directly connect 5v and 3.3v devices and they will work fine by just wiring them together and in other cases just wiring a 5v device to a 3.3v device will destroy the 3.3v device at worst or it just won’t work correctly at best. So what can you do and not do in 5v/3.3v mixed systems? Down the rabbit hole we go.
GOTCHA NOTE: of the boards I mention below, there are often different versions of these boards – so the exact board you have may be different and have different rules from the boards I have – YMMV – be careful. Example: MPU-9250 – the SparkFun IMU Breakout board for this chip has no on-board regulator and is a 3.3v only part but the 9250 board (not a sparkfun board) I am using does have a 5v regulator on it.
1) On-board regulators. Many of these little boards and micro-controllers say they are 5V but what is really happening is the device on the board is a 3.3v part and there is a voltage regulator on the board that takes the 5v power input and converts it to 3.3v to run the device. Sometimes these boards have a set of pads you can short that will bypass the regulator so you can run the board with a 3.3v power input (or you can just mod the board to short out the regulator if there is no provision on the board to do this). The device then communicates on a bus (I2C or SPI or whatever) or has an output that will never go above 3.3v, regardless of the input supply voltage to the board.
On-board regulator example: RCWL-0516 Radar – this device has a wide input voltage range (4v to 28v) and there is an on-board 3.3v regulator. There is a single output wire that goes up to max 3.3v. NOTE: this board will not run with a 3.3v supply and it needs 4+v power input to function correctly. If you wanted to run this board with a 3.3v power input you would need to modify the board to short out the 3.3v regulator.
2) No regulator. The device only runs at 5v or only runs at 3.3v or runs at any input voltage between two different voltages – for example 2v to 6v. If the board has no regulator and is a 3.3v only part – then you need to supply it with 3.3v, if it is a 5v only part then you need to supply it with 5v. If it is a variable voltage part then you would supply it with whatever voltage was within the range that it operates at and is compatible with the rest of your electronics.
No regulator example: MCP4725 DAC – there is no on-board regulator and this device will function correctly with a supply voltage between 2.7v and 5.5v so you could run it at either 5v or 3.3v.
So what happens when you mix 3.3v and 5v stuff? It depends and what “direction” they are connected and if the 3.3v device is 5v tolerant or not and what signaling method is used. “5V Tolerant” - means the device does not run at 5v (it might be powered by 5v and have a 3.3v regulator), but it will tolerate 5v INPUT signals and not be damaged. If you have a mixed 5v/3.3v system and ALL the 3.3v stuff is 5v tolerant then you are fine and nothing really bad will happen, you will not destroy any of the 3.3v parts by doing this.
For ONE WAY communications between 3.3v and 5v devices:
ONE WAY communications Scenario A) – device has 3.3v output and you directly connect it to a 5V input – this generally works fine and you will not damage anything by doing this. Note that 5v tolerance does not apply or mean anything in this case because 5v tolerance is about 3.3v INPUTS, not outputs and our output is 3.3v. The reason it works is because for a digital input a 5v device is not looking for a 5v signal to indicate a logic high – it is looking for the voltage on the line to be above a certain threshold to be logic high and 3.3v almost always works ok. For a dive into the basement of the rabbit hole – see this explanation:
Logic Levels - learn.sparkfun.com An analog 3.3v output to a 5v ADC input – will not damage anything and will work correctly – but your ADC range will be limited because the upper 1.7v of the ADC range will always be missing and you just need to be aware of this.
ONE WAY communications Scenario B) device has 5v output and you directly connect it to a 3.3V input that is NOT 5v tolerant – DESTRUCTION of the 3.3v part or if you are lucky it just won’t work but not destroy the 3.3v part. Fix: use a voltage divider on the 5v output of 1.2K ohms and 1.8k ohms – this will limit the maximum voltage of this signal to 3v and our 3.3v part will not be damaged and generally it will work fine because we don’t need 3.3v to get a logic high on a 3.3v input - 3v is enough. 1.2k and 1.8k are standard values and the resistors will have a tolerance to them and the .3v lower than 3.3v volts is there to give us a margin of safety.
TWO WAY communications - one of our devices is 3.3v and the other is 5v and they both talk and listen on the same wire and the 3.3v device is not 5v tolerant – DESTRUCTION of the 3.3v part or if you are lucky it just wont work but not destroy the 3.3v part. Fix: use a bidirectional level shifter – except that you can get away with not using a level shifter for I2C and other buses that that are “open collector” or “open drain” - see this:
I2C - learn.sparkfun.com
NOTE: there are oddball parts and boards out there that don’t quite match the above – YMMV.
My tracker is a mix of 5v and 3.3v and lipo stuff and voltages are something I have to consider carefully when designing and making any changes to the design. You certainly can mix 5v and 3.3v stuff successfully and I regularly do but if you are not careful and get it wrong bad things can happen. I know this was a lot of stuff but if you read this far then I assume this info applies to you and I hope this was helpful to someone who was unclear about how to do mixed voltage systems and some of the issues you will run into. This ended up being WAY longer than I thought – I started out thinking, hey there are a few issues and I will note those things but it just grew and grew as I started filling in all the little details and exceptions.