9. Ouput Devices

WHAT IS AN OUPUT?

Output devices are any peripherals that receive data from a computer and print, project, or replicate it. The output might be audio, video, hard copy - printed paper, etc. Output devices translate computer data into human-readable form



Pulse Width Modulation

Pulse width modulation (PWM) provides a way of controlling certain analog quantities, by varying the pulse width of a fixed frequency rectangular waveform.

PWM generates square-wave pulses of varying widths. The pulse width offset, which is proportional to the amplitude of the input signal, can be controlled using PWM. PWM is commonly used to control motors, power LEDs, regulate voltage, and modulate communications. Its main advantage is that it allows for precise control of the average power delivered to a load or output.

PWM Signal Waveforms by CircuitBread


Pulse and time period of a PWM signal by CircuitBread


Different duty cycles and their average voltage by CircuitBread



Types of output devices

Device Description Image
Battery A battery is a device that stores chemical energy and transforms it into electricity. This is referred to as electrochemistry, and the system that supports a battery is termed an electrochemical cell. A battery can consist of one or many electrochemical cells (as in Volta's original pile). Each electrochemical cell has two electrodes separated by an electrolyte.
Servo Servo motors are components of a closed-loop system that include a control circuit, servo motor, shaft, potentiometer, driving gears, amplifier, and an encoder or resolver.
  • A servo motor is a self-contained electrical device that rotates machine parts very efficiently and precisely.
  • This motor's output shaft can be adjusted to a certain angle, location, and velocity, something a standard motor cannot accomplish.
Buzzer An audio signaling device, such a beeper or buzzer, can be electromechanical, piezoelectric, or mechanical. Its primary job is to transform audio signals to sound. It is commonly powered by DC voltage and found in timers, alarm devices, printers, computers, and other equipment. It may emit a variety of sounds, including alerts, music, bells, and sirens.
Speaker Speakers are transducers that convert electromagnetic waves to sound waves. They are used to output audio from computer systems. Users can input audio in either analog or digital format to generate analog electromagnetic waves (analog speakers) and sound waves.
OLED OLEDs are organic LEDs. Organic compounds derived from carbon serve as their primary building components. Unlike LEDs, OLEDs are diffuse-area light sources manufactured in sheets, rather than small-point light sources.




Group Assignment

Visit our group task by clicking on the button below.






What did I do this week?

Note:This week, I struggled to understand the topic, leading to days of regret, frustration, stress, and improvisation. I did a lot of tests, I tried a lot of things, I failed a lot, and up until this moment, I have not been able to get my OLED screen to turn on. Overall, this has been my most challenging week yet, and I am dissatisfied with both my process and final delivery.

I decided to utilize a display to showcase the symbols that had inspired my prior PCB design. I'd want to show the association between colors and shape.

To do this, I've done five distinct things:



1. PCB Design

I created a new PCB because I didn’t have the necessary pins on the previous one.

  1. So, I opened KiCad to design the new PCB.
  2. I added all the components that I needed.
  3. I added the power symbols and connected them with the respective components.
  4. Then I made the connections between the components.
  5. .
  6. I passed it on to the PCB editor to complete the design.
  7. I updated the PCB from the schematic.
  8. I organized the components to make the traces and connections.
  9. I made the framework.
  10. Next, I saved the strokes first, and then the outline.


2. PCB Production


Recap

The machine used for the creation of the PCB is...

ROLAND SRM-20

This machine can cut a broad range of materials, including chemical wood, acrylic, and ABS. It also supports a wide variety of accuracy settings, from prototype to product design. Furthermore, its tiny size and fully enclosed design allow you to cut with greater safety and confidence.


What tools will we use?

V-Cutter, allows for better engraving for its fine tip.

Flute end Mill, for drilling and plate cutting.


To prepare the control software, I used...

Mods

A program that allows me to extract G-codes or machine codes from images, vectors or 3d models.





So, when I have my PCB design, I have to save it…

but how did you save it?

  1. I went back to the KiCad PCB Editor and went to the ‘File’ menu, subsequently to 'Export', and selected the ‘SVG’ option.
  2. The ‘Export’ menu was displayed, and I selected the layer I wanted to save. In this case, I first saved the strokes that were inside the ‘Copper layers’, which have the name ‘F.Cu’.
    • In the options, I selected the ‘Black and white’ print mode and the ‘Board area only’ SVG Page Size. Then I pressed ‘Export’.
  3. After, I did the same, but I changed the strokes layer to the cut later; in my case, it was the ‘User.Drawings’ layer.
  4. And I have the two files to cut!


Mods Time

  1. I opened the MODS web server.
  2. I right clicked on ‘Programs’
  3. Next in ‘Open program’
  4. I searched the program of the SRM-20 mill machine and selected the ‘mill 2D PCB’.
  5. All the blocks to be worked on are displayed to obtain the corresponding files.
  6. The first block that I modified is the 'read SVG’ block for selecting a SVG file.
  7. I saw that the image was uploaded to the server.
  8. I moved to the ‘set PCB defaults’ block and pressed ‘mill traces’.
  9. I moved to the ‘mill raster 2D’ block. And I changed the ‘offset number’ to two.
  10. Then, I went to the ‘Roland SRM-2D milling machine’ block, and I modified the origin of the machine. For this, I changed the numbers on the axes x, y, and z.
  11. I moved to the right and turned on the ‘outputs’.
  12. I moved to the ‘mill raster SD’ and changed the tool diameter to 0.4 mm.
  13. And then I pressed ‘calculate’.
  14. And I saw a preview. In addition, in my downloads, I found an archive ‘.png.rtl’; this is the file that I opened on the machine.
  15. Next, I did the same steps with the SVG of the cut. Starting by selecting the cut SVG of my files.
  16. I moved to the ‘set PCB defaults’ block and pressed ‘mill outline’.
  17. Then, I went to the ‘mill raster 2D’ block and changed the ‘offset number’ to one.
  18. I moved to the ‘mill raster SD’ to change the tool diameter to 1 mm.
  19. And I pressed calculate to see the preview of the cut and downloaded the file for the machine.

Cut Time

  1. I placed the tool, a 15 degree V-bit, to make the engraving.
    • To do this, I used a wrench to tighten the tool.
    • Note:Make sure that only the conical part of the tool protrudes.
  2. I connected the machine to my computer.
  3. I open the ‘VPanel for SRM-20’
  4. First, I moved the X/Y axis to the lower left of the material.
  5. And I pressed the ‘X/Y’ bottom to change the origin of this axis’s.
  6. Then, I moved the Z axis. To do this, I used a piece of paper to make sure I put the axis at the correct height.
    • For this special axis, I used a paper to define the distance between the tool and the material. I did this by placing the paper on the material and lowering the tool a little at a time until the point where friction is generated and the paper gets stuck.
    • Note: In this axis, before we did the paper check, we had to turn on the spindle and lower the z-axis, giving only one click to selecting ‘x10’ in the cursor step.
  7. I save the origin of the axis by pressing ‘Z’.
  8. Note:To move the axis fist, I used the ‘Continue’ cursor step, after the ‘x100’ (1 mm), then the ‘x10’ (0.1mm), and finally the ‘x1’ (0.01mm) until the paper generated friction and didn’t come off.

  9. When I defined the axis of origin, I closed the door of the machine.
  10. Then, I pressed the 'Cut' button at the bottom of the panel.
  11. I added the file to be engraved.
  12. I pressed ‘Outpt’ to send the file to be engraved.
  13. And the machine started to engrave.
  14. When the engraving was finished, the spindle went to the origin point.
  15. I opened the door of the machine.
  16. I used a hand vacuum cleaner to remove the dust produced by the engraving.
  17. I removed the tool that the machine had because it wasn’t the right one.So, I changed the previous tool to do the cut.
    • For this, I used a wrench to tighten the tool.
    • Note:Make sure that the conic part protrudes.
  18. I maintained the ‘X/Y’ origin and only changed the ‘Z axis’ because the tool was different and it was necessary to reconfigure that axis due to the height of the tool.
  19. I save the new origin of the axis by pressing ‘Z’.
  20. When I closed the door of the machine, I pressed the ‘Cut’ button to delete the previous file that I added.
  21. I added the new file of cut. And I pressed ‘Output’ for the machine to execute the cut.
  22. The machine started the cut.
  23. I used a hand vacuum cleaner to remove the dust produced by the cut.
  24. I removed the screws fixing the material with the help of a screwdriver.
  25. Finally, I had my newPCB!


3. Soldering... here we go again


Notes:

  • The Easter vacation in Mexico began on Saturday, so being a foreigner, I decided to go home and work from here. So, what you see below may not be the best practice, but everything went as well as it could have gone.
  • Because of time constraints and other issues that caused me to work outside of Fab's schedule, I decided to purchase a pencil soldering iron, a soldering iron base, and other necessary materials. While it may not be possible to have an optimal workspace, my family and I are doing our best to make it work.
  • Last week, my experience was complicated, and I won't lie, I was nervous about soldering a microcontroller like the Attiny again.

    However, I had to do it... So I started soldering.




Soldering time

  1. I started to put a bit of soldering in the spaces destined to place the pins of the attiny.
  2. I placed the attiny on top and welded one leg first before moving on to the next pins to make the process easier.
  3. Then, I soldered the pins to which each pin of the microcontroller will be connected.
  4. The pins were solder!
  5. Then I soldered two resistance one to a button and the other to a LED.
  6. And finally, I soldered the button and the LED.


3.1. Multimeter Test

What is a multimeter?

A digital multimeter (DMM) is a flexible electronic instrument that can test a variety of electrical characteristics such as voltage, current and resistance. The measurements are shown on a digital screen, making them easier to read and comprehend precisely.

So, I used this tool to check that all the connections were good.



4 & 5. Programming and Trying

In this part, chaos started.

So, what happened?

First Try

At this point I don’t know why I made another PCB… but I made it.

So, first, I tried to program the OLED with my new PCB. To do this, I have to burn the bootloader.

These were the steps:

  1. I opened Arduino.
  2. I selected the ‘File’ menu and clicked on ‘Preferences’.
  3. Then I paste the next link to the section of ‘Additional boards manager URLs’.
  4. http://drazzy.com/package_drazzy.com_index.jso
  5. I pressed 'OK', and then I went to the ‘Tools’ menu to select ‘Board’, after ‘Arduino AVR Boards’ and finally ‘Arduino Uno’.
  6. Next, I went to the ‘File’ menu to open the example of ‘ArduinoISP’.
  7. The example was open.
  8. I selected the ‘Tools’ menu to select the ‘Programmer’ option and pressed the ‘Arduino as ISP’.
  9. I uploaded the ArduinoISP example code.
  10. Then, in the same menu, I selected the ‘Board: “Arduino Uno”’ and chose the ‘ATTinyCore’ to specify the ‘ATtiny25/45.85 (No bootloader)'.
  11. I selected the ‘Clock Source’ option to select the ‘1 MHz (internal)’ option.
    • Note: You will change to ‘8MHz(internal)’.
  12. I selected the ‘Arduino as ISP’ programmer in the ‘Tools’ menu.
  13. I connected the Arduino to my PCB.
  14. Then I opened the ‘Preferences’ menu to select the two options in the ‘Show verbose output during’.
  15. In the ‘Tools’ menu, I checked that the options were good.
  16. I selected the ‘Burn Bootloader’.
  17. The burning bootloader was done.
  18. I uploaded the file with the ‘Upload Using Programmer’ option in the ‘Sketch’ menu.
  19. But then, I had a problem uploading the code of the OLED because it appeared to be an error of ‘Compilation error: exit status 1’.
  20. So, I verified:
    • The programmer in the Tools section.
    • That the connections were fine.
  21. And everything was all right, but the code wasn't uploaded.

Second Try

  1. I searched for the reason for the above error and found that the library that I used wasn’t compatible with Attiny. So, I found another one to try.
  2. I tried for three libraries:
    • U8g2_for_Adafruit_GFX:It was heavy; the error said, ‘Compilation error: text section exceeds available space exceeds space on board’.
    • TinyOzOled:It was the error of 'A programmer is required to upload’'.
    • Tiny4kOLED.h:It was again heavy.

Third Try

  1. I used the TinyOzOled library again.
  2. So, I burned the bootloader again of the Attiny 44.
  3. And I used this code:


  4. Then, I decided to only connect the attiny to udloap the code.
  5. When the code was uploaded, I connected the OLED to the Attiny.
  6. But it didn't work.

Fourth Try

  1. I used the same library and code, but now I used a protoboard to see what the problem was.
  2. Again, it failed.

After making different tests and trying different things, the result was always the same. Therefore, I would like to further evaluate the following:

  • The compatibility of the libraries.
  • The connection modes.
  • The use of a breadboard.
  • Making other boards.

Final Try?

Meanwhile, I decided to give up and use only Arduino Uno for programming.

  1. So, I used the basic libraries:
    • Adafruit GFX Library
    • Adafruit SSD1306
  2. I connected the OLED to the Arduino.
  3. I used this code:


  4. I uploaded the code.
  5. And it worked!

Last Try?

Finally, I used a board that I made, the Quentorres that we made in week 4.

I followed the same steps for the Arduino. I only changed the board to the Xiao and the 'Additional board manager URL'.

And thank God... it worked!



Results

First

I created a code that increases the size of a circle until it reaches the maximum size allowed by the screen. Then, a text appears indicating the color of the circle.





And this is the result:


Second

My second code aimed to display the symbols that inspired my previous PCB design. I wanted to demonstrate the association between colors and shapes. First, I showed the colors represented by the three basic shapes. Then I displayed the color combinations in relation to them.

>

And this is the result:





Conclusion

Last week, I thought it was difficult. However, this week has proven to be even more difficult because I didn't know what was going to happen.

... but I did it!





Files