FABACADEMY 2019

This page covers my process through the fabacademy, illustrating my progress, discoveries, failures, reflexions and inspirations.

Week 11

Input Devices

Link to the class content

Group assignment

Limit switch Input device:



Design

Final project

Sketch Plan

We made a sketch plan with the help of our instructor about the in-put and out-put devices that our final projects will need. We discus about what is the most important characteristic of our projects, in my case the principal characteristic is that the shelter open and close. For the input devices I gonna need the next items:

Sketch plan.

Components:

Eagle

I started creating a new project and opening the schematic window after that I added the components and organize them. It was a little difficult at the bigging to think how the connections gonna be but after some attempts and fixing some errors I managed to create the connections of all components.

Schematic

With the schematic ready I change to the board view and started to organize my components. This part was more difficult than the last one, I did it tree times until I complete the objective at the 3rd attempt.

Board attempts.

PNG Error

Finally export the file to png following the same work flow I did the for the week07, at that moment I didn't realized that I turn off the "pads" layer and because of that I had some troubles. Additional to that error I realized that my VCC connection for the Capacitor wasn't connected for that I create a bridge between the VCC Pin of the AVRISP, that don't look to good but I debug that after.

After that I use Photoshop to edit my PNG file adding an alien face.

PNG Error

Mods Error

I didn't listen well the recommendation from Alex about the parameters and I put in the tool depth 0.7 instead of 0.07 that causes me some problems.

Mods Error

Machining error

With my G-code ready I open it in LinuxCNC software to mill my PCB. I machine tree times the PCB:

Machining Error

Soldering Error

At this moment I realized that my circuit board was wrong because the traces were to small and the pads of the pins wasn't there because I forgot to turn on the pads layer in eagle when I create the PNG file.

Despite of the errors I try to solder the pins using cables but the traces were too small and I burn them in the attempt. And that was the moment that I decided to create a new circuit board taking into account all the errors that I had.

Soldering Error

Debugging

Eagle

For the design of the board this time I add a resistor of 0 ohms

Board view debugging

You can download the files:

I use Photoshop one more time to edit my PNG file adding an alien face.

INPUT Traces Alien
INPUT Cut Alien

Mods

Traces:

Cut:

Mods debugging

You can download the files:

Machining

This time the PCB result very well just with a little error in the pads of the pins for the limit switch and the pins for power supply. In Mods I didn't realized that in those parts the space between the pads and the traces was too close and because of that the settings of the tool diameter of 0.25 didn't allow the milling cutter to pass in those parts.

Milling cutter: 30 degrees for the traces and 60 degrees for the cut.

To debug that I use a scalpel to separate the pads from the traces.

PCB debugging

Holes

To make the holes in the PCB I use a tiny drill bit. Because this was the first time I do this and at the bigging I think to make the holes was a little difficult but it was really easy even though I broke the tiny drill bit because I put to much strength.

Soldering

This time soldering the components was easier than before but very laborious specially the micro controller.

Holes / Soldering top view / bottom view

Programing

Arduino Software

Open the digital serial and Software serial examples:

Copy the software serial to digital serial and specify "mySerial" to the correspondent baud "9600" and the delay "100".

Digital read serial example / Software serial example
C code test

Specify the RX and TX pins attached to the board also the pin attached to the switch, for that I had to review the schematic of my board and compare with the ATtiny 44 arduino pin-out.

Attiny44 Arduino pinout

The next step is Burn Bootloader:

Burn bootloader

And finally Upload!

Done uploading

You can download the file:

Hello world

I programed my Input board with the "hello-wold C-code" For that I followed the step described in the week 09 and this time I have to set up my C-code to fit my Attiny 44 micro controller.

hello.ftdi.44.echo.c:

make:

You can download the file:

Hello button

Also I programed my Input board with the "hello-button C-code" For that I had to change some lines of Neil's code to fit my board.

hello.button.44.c:

  • input_port PORTA
  • input_direction DDRA
  • input_pin (1 << PA3)
  • input_pins PINA
  • serial_port PORTA
  • serial_direction DDRA
  • serial_pin_out (1 << PA1)

make:

  • F_CPU = 20000000
  • MMCU = attiny44
  • t44

You can download the file:

Conclusion

Reading the data sheet specially the section of I/O ports in the register description help my a lot to know the DDR, PORT and PINS that correspond to my ATtiny44 Microcontroller .