!DOCTYPE HTML> Augusto Mantilla Molina - Fab Academy

Output devices

For this Week 9 of the Fab Academy which is About Output Devices I’m going to have to add an output device to a microcontroller that you’ve designed and program it to do something.

While for group assignment you have to measure the power consumption of an output device and document your work on the group work page and reflect on your individual page what you have learned.

how to determine the power of consumption of an output device?

To calculate the power consumption of an output device using the law of Ohm, we can utilize the formula:

P = V × I

Where:

  • P is the power consumption in watts (W).
  • V is the voltage in volts (V).
  • I is the current in amperes (A).

This formula is derived from Ohm's law, which states that the voltage across a conductor is directly proportional to the current flowing through it, with the proportionality constant being the resistance of the conductor.

New Board

As I did during week 8, I will use KiCad to design my new board, which will serve to control a servo motor and this new board will be connected to the first plate that I soldered in the last week, in that week I used a ATtiny45V.

What is a Servomotor?

A servomotor is a rotary or linear actuator that allows for precise control of angular or linear position, velocity, and acceleration. It is a closed-loop feedback control system, meaning it continually adjusts its position based on feedback from an internal sensor or encoder.

Servomotors are commonly used in various applications that require precise motion control, such as robotics, CNC machines, automated manufacturing, and remote-controlled vehicles.

Knowing this, these are the components that I will use to design my new board. These components are presented in the following table.

Qty Component Schematic image
1 Pins where the servo motor will be connected
1 Voltage and ground pins
1 Transistor
USB Plain
1 Signal pins
1 Diode
Diode
1 Resistor
Resistor

Knowing already the components that I was going to use to build the PCB, I had to make sure that the University had them, in case of not having them I would have to buy them in an electronic components store. Fortunately, they had all the components that I was going to use, so I started making the circuit. This is the circuit I created:

Schematic Final

Following exactly the same steps I followed in the previous week of electronic design, this is how the wiring of my PCB was, to this same I customized putting my name to the board.

This is the milling machine cutting

After the cut, the components have to be soldered to the board that we have just cut, the components are exactly the same as those in the schematic diagram, only this time they are in physical form.

This is the final board.

Board week09

Programming

The following code is the one I used to program the servo motor (second slide).

This code utilizes the Arduino platform and the Servo library to control a servo motor connected to pin 9. In the setup function, the servo object is initialized to control the servo motor attached to pin 9. In the loop function, the servo motor is commanded to rotate to the 180-degree position initially. Then, a loop gradually decreases the servo position from 180 to 140 degrees with a delay of 100 milliseconds between each step. After a delay of 1 second, another loop gradually increases the servo position from 140 to 180 degrees with the same delay. This pattern repeats indefinitely, causing the servo motor to oscillate back and forth between the 140 and 180-degree positions.

This is the board working

For this week’s assignment I had only one problem and this was the width of the PCB strokes, this error I solved by raising the width from 0.5mm to 0.7mm, this helped me to be able to solder in a better way and prevent the copper from rising while the board was being cut.

Group assignment

Files

KiCad

Arduino code