12. Input device

What is an input?

Have you ever wondered what all the small devices are for? They're called input devices, and they're quite awesome! They act as an intermediary between the outside world and your computer. They convert all of the data you submit into machine-readable and intelligible format. That way, your computer can digest information and perform a variety of great tasks with it. So, the next time you use your computer, consider all of the input devices you use to make it work for you.






Group Assignment

Visit our group task by clicking on the button below.






What did I do this week?

I decided to use an infrared sensor to detect the movement.

But what is an infrared sensor?

An infrared sensor (IR sensor) is a radiation-sensitive optoelectronic component with a spectral sensitivity in the infrared wavelength range of 780 nm–50 µm. IR sensors are now widely used in motion detectors, which are used in building services to switch on lamps or in alarm systems to detect unwelcome guests. In a defined angle range, the sensor elements detect the heat radiation (infrared radiation) that changes over time and space due to the movement of people.



Sensor Design

I designed the board that would function as my sensor based on the following schematic:

Steps:

  1. So, I opened KiCad to design the sensor.
  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.


Sensor 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.





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!


Soldering

Soldering time

  1. I soldered the phototransistor and the LED.
  2. I soldered two resistance, one to the phototransistor and the other to the LED.
  3. I putted a bit of soldering in the spaces destined to place the pins.
  4. Then, I soldered the pins.
  5. All the components were solder!


Programming

I started by performing a test of the sensor that I made with an Arduino one, then performing it with my board.

With the Arduino UNO:

  1. So, I connected the sensor to the Arduino.
  2. I opened Arduino to start writing the programming.
  3. First, I declared the infrared and the value.
  4. Then, in the ‘void setup’ section, I determined the ‘Serial.begin’ to 9600.
  5. I declared the infrared as an output.
  6. Next, in the ‘void loop’ section, I declared the value equal to the ‘digitalRead’ of the infrared.
  7. After that, I wrote a condition. If the value was low, "obstacle detected" should be printed.
  8. I gave the action a duration of half a second.
  9. I checked if there was an error in the programming.
  10. The programming was correct.
  11. I connected the Arduino to my computer.
  12. I loaded the programming on an Arduino.
  13. The programming was loaded.
  14. And this was the result:

Note: I used the arduino to check that the sensor made would work.


CODE:





With the Xiao:

  1. First, I searched for how to use the Xiao as a programmer.
  2. I found the steps in the information about the Quentorres, and I followed the steps.
  3. So, I started to download the uf2 file.
  4. Then, I connected my board to my computer via a USB cable.
  5. I pressed the button labeled "B", then held it pressed while pressing the button labeled "R".
  6. I could then release both buttons, and the RP2040 would enter its reset mode. In that mode, it exposes its flash memory as a hard drive.
  7. Then, I added the uf2 file to reset, and the board looked like this:
  8. I went to the ‘Arduino’ program and opened the 'Preferences' menu.
  9. I added the URLs that I needed.
  10. The libraries were downloaded.
  11. I deployed the tools menu and selected Attiny 25/45/85 in the ATTinyCore section of the Board option.
  12. I selected the specific chip that I used.
  13. I chose the clock source for the burn bootloader.
  14. I put the Arduino as ISP as programmer.
  15. I burned the bootloader.
  16. And I failed!

So...

I made a few adjustments here and there, but my botloader still didn't burn. I'll keep looking into what's going on to make the necessary corrections.





Conclusion

This is more difficult than one might think ...

... but I really hope I can make it!





Files