3,3V Output with "open collector level shifter"?

Hello,

I was looking for a way to have the output of my arduino uno put out 3,3V instead of 5V to power a little vibration motor.
So I stumbled upon this page where it says:

  1. Use an open-collector configuration. If you're REALLY trying to minimise circuitry, you can actually achieve a 3.3V output from an UNO using a SINGLE resistor. This is somewhat of a hacky solution, but can be made to work quite well. It involves using an external pull-up resistor from the output pin to a 3.3V supply rail, and in code using output low to get 0V or setting the pin to an input (high-impedance state) to get 3.3V.

You should pick this option if you want to use the minimum components necessary to get the job done, and only if you know exactly what's going on electrically when you do this, as well as the consequences of the non-instantaneous switchover from active drive-low to 3.3V pull-up (read: slew rates), as well as the consequences of what happens if you drive-high to 5V accidentally.

Now I won't use this, but still I wonder how this would work.
How exactly is the resistor placed in the schematics and why does it work?

How exactly is the resistor placed in the schematics

Exactly where it says in that quote.

using an external pull-up resistor from the output pin to a 3.3V supply rail,

why does it work

Because you don't use normal digital write for a HIGH. To make the output low you write a zero, to make it high you set the pin mode to input, so the pull up resistor makes the output 3V3. If you accidentally write a HIGH to that pin you fry what is connected to.

If the motor current is less than about 700mA, you could drop the 5v with 3 series 1 Amp diodes like 1N4003.
NOTE: If the motor draws more than 25mA, don't try to power it from an output pin, use a transistor for driver.
out1.pngout2.png

You shouldn't be powering a motor from either the Arduino 5V or 3.3V rail, motors should
be separately powered.

If you are using a transistor to switch the motor the motor power voltage is not relevant so long
as the transistor can cope.

If you imagine you can power a motor direct from an Arduino pin, you don't understand
the limits of an Arduino pin (absolute maximum 40mA, no inductive loads without protection)