Commit 6df38fea authored by anithghalley's avatar anithghalley
Browse files

input update

parent b429fc3c
Pipeline #313944 passed with stage
in 49 seconds
......@@ -4,11 +4,27 @@ This week is all about designing and fabrication of a controller board. Similar
![](../images/input/input_week.png)
## Task: Input Devices
- Group assignment:
Probe an input device(s)'s analog and digital signals
Document your work to the group work page and reflect on your individual page what you learned
- Individual assignment:
Measure something: add a sensor to a microcontroller board that you have designed and read it.
## Group Assignment.
The group assignment can be found [here](http://fabacademy.org/2022/labs/bhutan/students/sonam-dorji/assg12Group.html)
## Input devices.
To the humans, decisions are made based on the inputs from our sense organs and the brain acts as a controller to take the required decision.
The input device I used is the ultrasonic sensor.
The input device I used is the ultrasonic sensor. And I want to control the a LED, where when it reads less distance then it will turn on and turn of vice versa.
![](../images/input/ultrasonic_sensor.png)
......@@ -16,11 +32,17 @@ The ultrasonic sensor has four pinout. The pin at the edges are the Vcc(+5V) and
![](../images/input/USwork.png)
So based on the image above, the working of the ultrasonic is based on the reflection of the sound wave produced by the trigger pin. So by measuring the time for the wave to reflect back we can measure the distance covered by the sound wave.
## Schematic And PCB Design.
## Schematic Design.
To design this input design board. I used the eagle CAD software, because for this assignment I am using my old hello world board and improvised the schematic by adding 02x02 header pin to connect my ultrasonic sensor
To design this input design board. I used the eagle CAD software.
So this is my hello world board, which I had designed during the Pre-Fab Academy.
![](../images/input/hello_world_board.png)
And the schematic shown below is my improvised hello world board for the input week.
![](../images/input/schematic_design.png)
......@@ -34,4 +56,115 @@ The components used in this design are:
- Red and green LEDs.
- 2x02 header pin.
It was much easier to route this board since compared to my hello world board I just had to and 02x02 header pin to connect the ultrasonic sensor.
![](../images/input/board.png)
## Milling the board.
Now to mill the board, its easier in eagle since we can easily export the PCB file in png format to generate rml files.
![](../images/input/export.png)
First select only the required layers, where Top layer for the traces and Dimension layer for the edge cut file.
![](../images/input/layers_setting.png)
The png files are:
1. Traces.
![](../images/input/input_traces.png)
2. Edge cut.
![](../images/input/input_edge_cut.png)
Noew to mill the PCB we have:
1. Add the png file.
2. Select 1/64 to print traces and 1/32 to cut the edges.
3. Set the origin to X=0, Y=0, Z=0.
4. And then Add the save file module.
5. Finally click calculate.
![](../images/input/mit_mods.png)
Next we will use the Vpanel to cut the traces and edges of the PCB.
First we will use the 1/64 endmill and set the origin of the machine to the surface of the plate by zeroing. To cut out the traces we will add the traces rml file as output.
<video width="600" controls>
<source src="../../images/input/videos/milling.mp4" type="video/mp4">
</video>
But there was some problem with the alignment of the sacrificial layer and hence all the copper plate were not traced.
![](../images/input/first_mill.png)
There for I gave another shot and kept the origin as same but adjusted the zeroing on the other side when traces were incomplete.
![](../images/input/second_mill.png)
This method was good enough to complete the work. And now to cut the edges we will now use the 1/32 enmill, maintain the zeroing and add the edge cut rml file as output to the machine.
![](../images/input/finally_ready.png)
Finally the board is ready.
![](../images/input/board_ready.png)
And now to complete the PCB all the components are assembled and the board is all set to be assembled.
![](../images/input/components.png)
All the components assembled and the input board is ready to be programed.
![](../images/input/assembled.png)
## Programming
So, now the ultrasonic sensor is connected to the 02x02 header pin and the pins are connected to followings GPIO pins.
```
Vcc - 5V
Gnd - Gnd
Trig -
Echo -
```
But before programming the board with the attiny45, I tested the sensor with arduino.
![](../images/input/Ultrasonic%20_test.png)
And the Sensor is working fine.
<video width="600" controls>
<source src="../../images/intput/videos/ultrasonic_1.mp4" type="video/mp4">
</video>
Next is to connect the Ultrasonic sensor with my board.
The program code used to interface can be found under files. I am able to get the distance out put.
Then I programed the LED to blink based on the input from the ultrasonic sensor.
And Its working.
## Problem during the week.
I printed my first board and assembled all the components but I was only able to control the LED but the blink was not clear. This is my first board.
I took a multimeter and checked the connection and if there is any short circuit, There I found there was some unknow problem from the botton.
Took the soldering rod and tried to maintain a good soldered joints. But it was still the same. Then I desoldered the button and tested, It was working now.
The problem was from the botton.
## Files.
- [Eagle file.](../files/input/Input_week.zip)
- Test code
- Ultrasonic and LED code
- [Trace png](../images/input/input_traces.png)
- [Edge cut png](../images/input/input_edge_cut.png)
\ No newline at end of file
docs/images/input/components.png

96.5 KB | W: | H:

docs/images/input/components.png

210 KB | W: | H:

docs/images/input/components.png
docs/images/input/components.png
docs/images/input/components.png
docs/images/input/components.png
  • 2-up
  • Swipe
  • Onion skin
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment