Let’s first get acquainted with MOSFET transistor,
which will be the first agent between Arduino and some powerful load.
It has three headers, which are named accordingly: gate, source
and drain.
We can see from the diagram what they are necessary for.
It’s written in English here: this is the gate,
that’s the source, and this is the drain.
Consequently we can check which one is which with the help of this diagram.
When we apply voltage to the gate,
the path for the current opens between the source and the drain.
Thus, our load, i.e. the pump, can be
connected between the transistor and
the ground to the plus pole of the power source.
So when we apply voltage from Arduino to the gate,
the path for the current will be open, and the pump will start working.
However, we are not going to use a transistor alone, but the whole
module into which the transistor is fitted, aka the “Power key” module.
Let’s have a closer look at it.
We have the transistor itself here, an LED, which tells us that
a signal is being transmitted to it, and a terminal block which has the
load connected to it.
You see, the plus and the minus are marked here,
which means that the polarity of connection is important.
As usual, we connect it to the Troyka shield with a triple cable.
Why is this LED blinking now?
Because I have already uploaded a test sketch to Iskra,
which will allow us to see how this agent works, as well as one more agent
which we will examine later.
In this case, voltage is applied to one pin,
and then it is turned off with a 2-second interval.
There is nothing tricky in that – this is simple digital signal control.
Thus, we can see that the LED on the module turns on an off all the time.
In order to make sure that the current flows through the terminal block,
I am going to set the tester to the continuity check mode and will
connect it to the terminal
block’s outputs.
[SIGNAL] We can see and hear
that the signal is on when the LED is on,
This is exactly when we apply high voltage to pin 7, to which the
module is connected.
As a result, it is clear now how to start the pump working.
Such module can have voltage up to 30 V applied to it.
And if we take a separate transistor,
like the one I’ve just shown you, it can have the voltage up to
100 V.
However, don’t get carried away by thinking that you can have
a 220 V alternating current from an electrical outlet running through it.
This is a delusion.
One more advantage of working with the MOSFET transistor is that you
can apply impulse ratio modulation
and regulate the load by changing duty cycle.
For example, if you want to connect an LED strip,
you should take the MOSFET transistor or the “Power key” module, and you will be able to
regulate the brightness of the LED strip in the same way as you did with one single
LED.
By the way, if you remember, our bright LEDs,
which we, for instance, used in the projector,
have a small transistor fitted into their bodies, like this one.
This is because these LEDs draw powerful currents, which are more than Arduino can
normally allow.
What shall we do if we are still planning to work with devices
which draw their power from the 220 V line supply?
We won’t be covering this aspect in our course, but you might as well
have this zeal sometime in the future.
In that case, a relay will help us.
I am going to take a relay of the Troyka module. It is a dual relay
with 3 pins.
I am now going to connect it to our testing unit,
And then we shall see and hear how it works.
What is a relay per se?
It mechanically opens or shuts the pass for the signal.
Furthermore, it has three inputs in its terminal block,
one of which is called “normally closed” and the other one “normally opened”.
Thus, one of them carries the current,
when the signal is transmitted to the relay,
and the other one is off when the signal is not transmitted.
Depending on the situation, you can use this or that input.
Let’s look how the pump is connected via the “Power key” module.
Every device has its own wire coloring, which always means something.
For example, the “ground” is usually black, brown or blue.
In our case, both wires of the pump are brown and blue.
In reality, its minus pole is blue, and its plus pole is brown.
Its plus is connected directly to the plus of the power supply unit.
I have connected them via the breadboard, but you can do it, for instance, by
twisting the wires together.
The minus pole (blue) is connected to the power block of the “Power key”
module,
and the wire is inserted in the input marked as “plus”.
This is because this section of the circuit is closer to the plus pole.
This blue wire goes from the part of the terminal block marked with
“minus”
to the minus pole of the power supply unit.
We have the same test sketch uploaded in Arduino,
which turns pin 7 on and off for 2 seconds.
Pin 7 has the Power key connected to it, Which, in its turn, is connected to the
pump.
We can see the water flow for 2 seconds,
and then stop flowing for 2 seconds.
[NOISE]