Logo academy

WEEK 13

INPUT DEVICES

Fab Academy 2017 at Fab Lab Barcelona By Trinidad Gomez Machuca

Learning outcome W13

Demonstrate workflows used in circuit board design and fabrication.

Implement and interpret programming protocols.

Step Response, TouchPad

For this assignment I want to learn how to do a touchpad, I would like to explore how this sensors works because for my final project i want to integrate this to trigger some of my outputs with this logic. The capacitive sensors works like this, the resistors plays as a components that measure the conductive amount of a object that has the properties that is conductive, in this case our body plays as a ground so allow to close the circuit.

Example of a Touchpad

Eagle

First I want to do a Touchpad, So I followed the project from Matt Blackshaw, so I did all the proces for making my board in the modela.

Schematic

After adding all the components I started doing the board design

Schematic

My final board design with some problems

Schematic

I check everything is ok with the DRC

Schematic

I exported to EPS to keep the real scale

Schematic

And finally I did my Traces and Outlines

Schematic Schematic

Fab Lab Modules

I prepared the two files in the Fab Modules with the correct settings

Fab Modules Fab Modules Fab Modules Fab Modules

Milling my board in the modela machine

Soldering

For this board i needed the following components

COMPONENTS

Attiny 44

1 Capacitors 1uf

8 Resistors 1M

1 Resistor 10k

3 Four Pin Header

1 Six Pin Header

1 Six Pin Header

Schematic

Here I started the soldering part

Schematic Schematic

I had the same problem of Matt Blackshaw so i fixed like him, with two horribles wires, but it worked perfectly.

Schematic

PROBLEM WITH THE CODE

As I said before I followed the Matt Blackshaw`s Touchpad files and when i started to programed, it appears some errors

As you can see it doesn't have the .MAKE extension

File

I was trying to program my microcontroler but it never worked so I decided to open that file with the help of my tutor Arnau. He explained me how a make file works, so we read it and we realized that besides the problem with the extention, the information was wrong, this code was for a Attiny 45 and also it was set that this microcontroler was going to be programed with the AVRISP

File

I followed the loading Step Response

File

I changed the information type of the microcontroller for the Attiny44 and the AVRISP and also I have changed extension

File

After fixing this now it worked!!!!

File

Thank you Arnau!!!!for the help in in this step of the process

Touchopad Board

For my final project i'm trying to do a mask, i want to active it with the touch pad. I divided it in 8 parts(every part is an input) so everytime you touch one part, you can see in the computer the one that you touched and besides you can trigger a servomor or a LED, etc.

File

The touch pad from the Example of Matt Blackshaw with 8 inputs

File

Circuit in the vinyl cutter

File

Programming

After pass through the all the process of design and fabrication the touchpad, I wasn't able to make it work. My tutor Xavi was traying to help me but we never make it work with the code from the example and for me was very complicated to undestand it because the code was in java, and I only know Arduino code. I was researching how to visualize the data in Arduino and the common process is installing the capacitive sensor library, plus the library of Serial port, I tried to do this but after i read the data sheet of the Attiny 44, this was too much information for a small microprocessor, So at the end I decided to integrate in my final electronics, in this case I will use the Arduino Leonardo, In this board I'm pretty sure it will work because I'm gonna use a very powerful microprocessor, the ATMEGA32u4. Wish me luck!. Until I finish, I let this video here, where you can see I've programed in Arduino and processing.

Here you can see in the Code how I added a library of capacitive sensors, then i defined wich digital pins will be receivers and senders from my Arduino Leonardo, then I stored in a variable because after i need to compare the information that is reading from this sensors in real time and then if the sentence is true i want to trigger something.

ELECTRONICS

When i was doing my input device assignment... I fail, but i've learned a lot about the properties of the microcontrollers. First before to choose a microcontroler, you have to know how many data you will store. In the input assignment i choosed to do a touchpad, for this you have to use capacitive senros. I you want to progam it in Arduino you will need to install the capacitive sensor library, this is the only way you can see if your sensors are giving you back in the serial port. But in the example that i was following they use a attiny44 microncontroller, a library and the code it was too much information for this attiny. So at the end i have to follow the same squematic but with other attiny. I followed Attinny44 datasheet, Attinny85 datasheet, and so many until i found the right one. For the time i want to pass directly to applied the capacitive sensor in my final board, with i will use a atmega32uf, the best one for doing a lot of task, at the beginning i wanted to used only for capacitive sensors but i realized that is a very powerful microcontroller that it will be a waste if you only used for this.

This is one of the reasons that i did all my circuit in the Arduino Board first, so i can know how many bytes i need to run all my code. You can know this information when you compile your code in Arduino, at the end it shows how many bytes you are using, so depending on this, you can choose a micro controller.

Werable

And here you can see how many bytes this microcontrollers can store, in the RAM bytes.

Werable

So before to start doing my own board for my final project i decided to do it first in the Arduino mega, So i can understand for complete how everything is connected and the also i want to understand all the code. I did not know a lot of things, like how the relays works, how to connect a nicrome wire, how to put capacitive sensors in the Arduinodirectly, etc. so it was good to do this because now I know and I think is very easy to do it, so I hope i can do it in my final board. After i finished to connect everything, I made this Fritzing/Illustrator diagram.

Fritzing

Components

For starting to design your schematic design of your microcontroller in Eagle, you need this kind of data sheet where you can see the pins and change it when you pass everything to your own board. The number of the pins always change from the arduino board to the other microcontrollers. For example if in your Arduino code and board your are using the A1, if you are using a attinny44 you should look the pin number equivalent. As you can see in this diagram, it shows the equivalent pins in Arduino.

Werable fritzing

Eagle and Fabrication

1- Here is the ATMEGA32u4

2- Here is the switch for the reset

3- Capacitors

4-Here is the system for the usb programmer

5- Here is the capacitive sensors for the pins

6-Here is for the external energy, I didn't add a voltage regulator, so here can only be 5 v, if you connect more energy, the ATMEGA can be burn.

7- Here is for connecting digital and analog pins.

8- Here is the AVRISP programmer

9- More digital pins

Schematic

Here you can see in the board how a order my components in Eagle.

Board

Here are my png files for the modella machine, The first one is going to be for to the 1/34 drill that is for traces, and the 0.01 is for the details that the ATMEGA34u2 need. First one the colors are invert, background should be black. The second one is for the holes, this one has the correct colors.

Traces holes

Here I'm using Fab modules for converting the files in c code. So here you can see how the machine is going to follow the path with the different drill bits. Here is very important to make the details with the 0.01 drill bits other wise you will have problems when you solder the Atmega because the 1/64 can not do the tiny details, the only thing that you have to do is use the same file for traces but change the settings in the Fab modules.

Traces Detail Holes

Here is the board milled, so now i will start soldering.

Milled

FAILS

Three weeks before the finals, I was trying to fabricate the Arduino Leonardo, the first one worked the milling, but not when I solder it, I couldn't do the bootloader in the Arduino, so i did it 4 more times and always something happened, the traces too thin, some were broken, or the last one it was a perfect one until it finish the holes, it went back to the start point but the drill didn't go up, so it broken all that ii was in its way, I lost one week just trying to milling, so I hope my board works in the last week of the academy.

FAILS

For the components i will need:

8 Capacitor .1 uF

2 Capacitor 18 pF

2 Leds

2 Resistor 22 ohms

2 Resistor 499 ohms

1 Resistor 10K

1 Resistor 680

4 Resistor 1M

2 Female Pin header 8x1

Crystal 16 Mhz

1 ATMEGA32u4

1 Switch

1 Female pin header 5x1

1 Male Pin Header 2x2

Componentes

A lot of people told me that soldering the ATMEGA would be difficult but for me it wasn't so complicated, I mean it was, but i had worst problems that this. When i sent my detail file, I did a wrong file and it did the details but it cut the traces that connect with the pins of the ATMEGA , so it was more difficult to do the bridges that connect again the traces than soldering the pins.

Atmega

Here is everything soldered

mi arduino

Here I'm trying to programme my board with the AVR ISP and it seems everything its ok because the light is green when i connected it

verde

Even Though the light was green, when i tried to program it in Arduino, it appears an error all the time with the clock. I researched on internet how to solve the problem but it seems it is something wrong with the programmer, the ATMEGA32u4 is not compatible with the AVR ISP. I ask to my classmates and some of them have the same problem, and they toldme they solved it only changing the AVR with the USBTiny programmer that we did before.

verde

Programming

I found this diagram in other fab academy page, where you can see the number of the pins, So now i can convert the number of the pins that I'm using now from the Arduino Mega to the pins of the atmega32u4.

Atmega

Here i could do the burnloader with the USB Tiny

verde verde verde verde

At the beginning if i want to upload a program in my Arduino Leonardo, i had to have connect the USB TINY every time i want to run a different code. Like this.

verde

Because if i disconnect the USB tiny it was impossible to upload the code, but one day before the final presentation, One of my tutors told me that this could happen because my soldering is not good in the USB component, so fix this and now it works perfectly but its own.

verde

First i programmed a LED, then my servo valve, and finally all my program for my final project.

verde

Mask working with Arduino Leonardo

SOFTWARE USED

//Eagle

//Terminal

//Illustrator

//Photoshop

Links for the Assignment

Input devices

Input devices Class

Input devices Assignments and Assessment

Input devices

Touchpad

DOWNLOAD

All files


Fab Academy 2017 Fab Lab Barcelona Trinidad A. Gomez Machuca
IAAC trinidad.gomez@iaac.net