This is my make-through for the week's assignment. Grab a cup of coffee!
This week we've learned concepts of how op-amp works and other practical videos on mosfet, shift register and multiplexer and how to expand the microcontroller I/O Pins.
At the end of the week we were asked to design and fabricate an input and output board and program our attiny board using those 2 boards we have designed to do a specific task.
Step 1: after following the provided pcb components i have designed the schematic after checking the provided one
switched to board mode then set the DRC rules after that i have started routing all the air wires using 21mil track width then exported the gerber files.
opened GIMP imported the .pdf after exporting them from gerbv then exported files from gimp as .png files .
last step was to import the files to fab modules to check if there is any missing tracks or pads.
For the model i have opened terminal then typed cd fab then sudo npm start, typed the admin's password, opened fab modules from browser then i selected the process and the needed diameters for traces, Drills, Profile and set the Z distance then sent to the machine and let the fun begin!
then for the soldering was pretty easy for me because the board was a through hole soldering.
According to the multiplexer datasheet i have selected the 4-Dip switch selectors so each digital write function write to the mux selector pins from the 4 dip switch and saves it as a variable in the mux through digital read function the condition of the mux is stated whether high or low depending on the dip state so if the first switch got turned on it got stated as a high then by default mux get stated as high then it shifts to 2 in the shift register and the red led gets turned on and when we turn off the first dip switch the mux states at low and shift register shifts to 0 then if the second dip switch got turned on all of the previous process occur except that the shift register shifts to 8 in the shift register then it turns into binary and get the green led gets turned on.
for the rest of 2 other dip switches it does the same process except that the shift register shifts to 4 in the shift register and so on....
next step was the wiring so referring to my board design the following pins were connected to the attiny 44 board. (input board)
VCC to Attiny 5V
GND to Attiny GND
Sel0 to pin0
sel1 to pin1
sel2 to pin2
Mux Output to pin3
(Output Board)
VCC to Attiny 5V
GND to Attiny GND
Serial to pin4
shift in to pin5
shift out to pin6
LED V to pin 9
Also you can check the attiny core Pins from here
Then for programming i hooked up my USBasp Header in the Attiny's ISP header then opened Arduino IDE and from boards manager i have selected my attiny model which is ATTINY44 then for clock speed i selected the Attiny's internal clock 8Mhz then from tools option i selected upload using programmer.
After uploading the code viola! the dip switches are working with the RGB LEDs perfectly n smoothly! (Check the video below for more details)
Unsuccessful trials
the first PCB i have designed the machine's Z distance was not so accurate so the PCB's traces were too thin and hard to solder on the Pins !
After soldering all the components on this broken pcb i wanted to give it a try to check if it is working or not i hooked up the wires on the arduino then connected my 12V 2A adapter to arduino then here the magic smoke happened! the board started to heat up and unfortunately after checking it, it was totally burned and i guess the problem was in the old board maybe some short circuit or something so i decided to re-fabricate the pcb with right Z distance and it came out pretty great!
Second issue i have faced was powering up the LED
i have checked the LED and it is working, Wiring is good, code working but the led is not turning on so i will work more on this issue late and upload the video if it worked!
Step 1: Design The PCB, Fabricate it.
Step 2: Discover the problem with the pcb and the arduino.
Step 3:Re Fabricate the PCB and test it out using multimeter.
Step 4: Solder the PCB, Program it using USBasp, Test it.
The link below includes Schematic, Board Design, PNG Ready to fabricate, Arduino Code.
What I learned this week is...
More Skills on PCB Design.
Deep Dive into how OP-Amp Works.
Deep Dive into how Shift Register, Multiplexer Works.
More Fabrication, Soldering, Programming Skills.
How to Expand the Microcontroller input and Output pins.
Drive high power components Using Mosfets.