W11│ Input devices

Group Assignment:

  • Measure the analog levels and digital signals in an input device.

Individual Assignment:

  • Measure something: add a sensor to a microcontroller board that you have designed and read it.




1.Group Assignment



2. Individual Assigment.

2.1 MEASURE SOMETHING: ADD A SENSOR TO A MICROCONTROLER BOARD THAT YOU HAVE DESIGN AND READ IT.

Electronics and programing are new subjects to me and I really enjoy this assigment, because I was able to test and alternative that I can use on my Final Project. My idea is to design an Alarm Mat that you only turn it off by doing 5 minutes of exercice. Due to this one of my options to test was Motion Detection.


a. Design process

I used Neil's demo step response (transmit-receive) circuit as a starting point to I designed a capacitive touchpad that wich, depending on the pressure it detects will turn on a LED o two LEDS at the same time.


b. Schematics & Board.

I decided to continue to use the ATtyni45 (as Neil´s demo) because, for this project, it was only required to add 1 green LED, 1 red LED and 2x 499Ω resistors. To design the schematics in Eagle I followed the same steps made on week 07.


c. Milling process.

This part is really mechanical and easy but in this opportunitty afte milling my board the traces where really thing and I was worried they won't work. After soldering I use a multimeter to test continuity. Fortunately, there was not any issue on the board and I was ready to test my idea.


c. Touchpad.

It was time to face the unknown: How to use the copper pads.
To achive it I need to solder 2 cables (one for each pad) and use a 2x6 pin header to connect them to the circuit board.

  • Before I soldered the cables, I looked up the ATtiny45 Pin configuration (from the Data Sheet) to locate wich PINs where conected to the LEDS. Later, on the programmation part we will use these information again.


d. Programming the Attyni45.

I used Neil'code first to test the funtion of the copper pads without the LEDS: Here the steps I followed:

    1. I downloaded the Makefile and used the AVR programer(avrisp2)on Ubuntu's terminal to program the .hex file


    2. Then I run Neil's code (C language) hello.txrx.45.c and transfered it to the board

    3. Everything was working ok until this point. To receive and display transmit-receive step response I needed to run the Python file hello.txrx.45.py but the terminal show me this error: "No protocol specified". I didn´t have any idea how to solve it so I looked up on google and found a very useful Tutorial from Andrews computer corner called How to solve "No protocol specified" on Ubuntu 17.10. Basically, in order to solve it you need to close everything, log out and log in again. But, before log in you need to switch from Ubuntu to Ubuntu on Xborg. Now you are able to run the Graphical display.


d. Programming the LEDS.

After checking that everything was working OK with the copper pads I needed to modify Neil's code in order to program the LEDS. Here the steps I Followed:

    1.Neil´s code was written in C language, I don´t have experience with it so I needed information on how to program LEDs with C language. I found that in a tutorial that the code used to Blink a LED was:


    2. Neil has define as: set for LED ON and clear for LED OFF

    3.Now I had to define the LEDpin I will use frm the Attyni45 PIN configuration.


    4.I needed to specified wich copper pad will light on each LED. To do it, first I tested the right copper pad with the display "transmit-receive" and I got values under 8 000. The left copper pad showed values over 11 000 and when I touched both copper pads at the same time the values went over 25 000. Here how I use the Values:


RESULT

Input_devices from alucyem on Vimeo.


FILES
Input:Code
Eagle:Schematics
Trace:PNG file
Interior:PNG file


← Previous Assignment → Next Assignment