HackSpace_-_April_2020

(Frankie) #1
FORGE

While there are quite a few different options out
there, our favourite is a MOSFET-based bidirectional
shifter. These, as the name suggests, can convert
in both directions, so you can send data backwards
and forwards between devices of different voltages.
They typically come in modules which convert
four or eight separate IO lines, and only cost a few
pounds. They can also handle I^2 C communication
which can be tricky for some level converters.
Let’s take a look at how to use these – there are
more or less identical modules from a wide range of
different suppliers.
The modules have a low voltage side and a high
voltage side. Low voltage inputs are usually labelled
LV1 ... LV4, while high voltage ones are HV1 ...
HV4. Each side also needs a power supply labelled
LV/GND and HV/GND. As these are bidirectional, it
doesn’t matter which is input and which is output (or,
indeed, if they’re both, as in the case of I^2 C). All you


DRIVING MORE CURRENT


We’ve talked quite a bit in this article about changing
between higher and lower voltage devices, but some
components need more current than a particular IO
can supply. There are a few ways of dealing with this.
Motor driver modules are designed to drive high-
current motors, and can be repurposed for other
high-current devices such as bright LEDs – just make
sure that the voltages are correct, and the driver can
handle the current load of the device.
While motor drivers work and come in a huge
range of configurations, they can be a little overkill.
The simplest way of driving extra current is with a
transistor. You’ll also need a couple of resistors to get
the correct current draw, so it’s not quite as simple as
plugging in a module.
If you need a bit more current than a transistor can
supply, but still don’t need to go all the way to a motor
driver, Darlington pairs are an arrangement of two
transistors to give you more power. For example, the
ULN2803 chip gives eight channels of output, each of
which can have up to 500 mA of current.

RATHER THAN VOLTAGE


have to do is connect up the power, and then put
your communication channel through a level shifter.
See Figure 1 for how to connect up a NeoPixel.
There’s no extra software to install as these
should be invisible to the rest of your hardware


  • as far as your microcontroller is concerned, it’s
    communicating with a device at the same voltage
    level as it.


There’s no extra software
to install as these

should be invisible to the
rest of your hardware



Figure 1
The blue wire
supplies a 5 V signal
to the NeoPixels
despite taking a
3.3 V signal from the
Raspberry Pi board
Below
You can get dedicated
level shifting chips.
Free download pdf