FAB ACADEMY 2022
IEST "TUPAC AMARU" CUSCO
 
MADE IN FABLAB OF 
UNIVERSIDAD CONTINENTAL PERÚ

OUTPUT DEVICE

Before connecting any load to our board, we must know the amount of voltage and current that they need in order not to damage the electronics, more specifically the Atmega 328P microcontroller.

In this assignment we are asked to know the power consumption of an output device and also to connect this output device to the microcontroller board we designed earlier and program it to do something.

I will review the most common motors and I will be controlling their movements from my electronic card.

DC motor (direct current)

In general, electrical power can be supplied by direct current (DC) sources and by alternating current (AC) sources.

An electric motor is a device that converts electrical energy into mechanical energy of rotation, being able to work with AC or DC (DC).

The most notable difference between a DC motor and an Alternating Current (AC) motor is that the DC motor requires a commutator device in order to function.

Both AC and DC motor are used for certain tasks, so there is no one that is better or worse. Each one has its advantages and disadvantages, depending on what it is used for.

The use of the two types of electric motors is innumerable, from the toy car, through the appliances in our home, to industry or means of transportation, among others.

The DC motor moves by creating a magnetic field that is powered by direct current. Power usually comes from batteries or some other external source.

  Many of them already have a power transmission system such as a gearbox which allows them to increase their output torque (“force”). One of its advantages is that its speed can be precisely controlled. Since they can be reversed, stopped and started immediately. 

Functioning.

Regularly this type of motor is equipped with 2 magnets, (used in small motors) also known as stators. Which produce a magnetic field around the axis, inside we will have an axis with the commutator and the connection with the direct current source (it can rotate freely).

Likewise, using a carbon system or a pressure plate. This is a conductive material and thanks to a spring it is always in contact with the axis.

Once the commutator system is ready, the cables through which electric current will pass are added, thus generating a magnetic field. Which will align with the magnetic field of the stator.

When current passes through the wire or coil that is placed between the south and north poles of the magnet. Likewise, the generated field interacts with the field of the magnet applying a torque.

When a current-carrying conductor is placed in a magnetic field, this is when mechanical force is created. The direction of this force is determined by Fleming's rule, also known as the left-hand rule.

This rule tells us that when there is a charge in motion, which moves in the direction of the thumb, a magnetic field is generated in the direction of the rest of the fingers.

This rule is used mainly in electromagnetism, to determine the movement of a conductor.

Types of DC motors

With brushes:

This type of motor is one of the oldest that exists, since it is powered by direct current and internally commutated. It is built by an axis, brushes (hence its name) and a rotor. And it is the polarity and the charge of the brushes themselves who are in charge of controlling the speed and direction of the motor.

Brushless:

Also known as a synchronous DC motor, one of the characteristics is that they do not have a commutator, unlike a brushed motor, for example. These are the most used thanks to their efficiency. To control their direction and speed, they include specialized circuits.

In addition, they are built in the same way as brush motors, only that, to improve their efficiency, magnets are mounted around the rotor. That is to say, that the magnet is in the windings of the stator and the rotor.

DC motors have a relatively short life time, because the brushes have sliding contact between the brush and the commutator, they produce sparks, they cannot be operated in conditions where there is gas, for example, and therefore cause mechanical wear.

The armature is damaged and the shaft vibrates, as its speed increases, its maintenance is expensive many times.

Depending on the size of these types of motors and the force they require to move some weight (load) will be the current consumption they need to work, so first we will measure this current.

We measure the consumption current of our motor.

The pins of our Atmega only provide us with a maximum of 40 mA according to its datasheet, so we will require a current amplifier such as a medium power output transistor that allows us to control its speed by means of PWM for example or also with a relay if we just want to start and stop the engine in an instant of time.

These two circuits only allow me to move the motor in one direction, if I wanted to change the direction of rotation and have good current we must have an H bridge, which already comes many times in integrated circuits or also in cards like the L293D with two bridges h inside.

H-Bridge Operation:

Applying a positive signal to the input marked FORWARD turns transistor Q1 on. Current from Q1 flows through the bases of transistors Q2 and Q5, causing motor terminal a to receive a positive and terminal b to receive a negative (ground).

If instead a signal is applied to the REVERSE input, transistor Q6 is made to conduct, which closes its current through the bases of transistors Q4 and Q3. In this case, the positive is applied to the motor terminal b and the negative (ground) is applied to the motor terminal a.

One of the very important things to keep in mind when controlling this circuit is that the FORWARD and REVERSE signals must never coincide. If this happens, the transistors Q2, Q3, Q4 and Q5 will close the circuit directly between the positive of the power supply and ground, without going through the motor, so it is certain that the Emitter-Collector current capacity and the transistors will be exceeded. they will be damaged forever. And if the power supply is not protected, it can also suffer significant damage.

For our assignment we will use the L298N which has higher power.

H Bridge Module L298N for the control of 02 DC Motors or 01 Stepper motor (PaP).

Technical characteristics:

   • Integrated: L298N.

  • Channels: 2 (supports 2 DC motors or 1 PAP motor).

  • Logic Voltage: 5V.

  • Operating Voltage: 5V-30V.

  • Current consumption (Digital): 0 to 36mA.

  • Current capacity: 2A (peaks up to 3A).

  • Maximum power: 25W.

  • Weight: 30g.

  • Dimensions: 43mm (Length) x 43mm (Width) x 27mm (Height).

We will develop a program that allows to control the direction of rotation and the speed of a DC motor with the help of buttons.

Program.

The speed change according to the PWM cutting angle is represented very well.

We set it up with our card and it works very well.