Input Device

During this week I had to make a sensor and measure something with it. In the web page of Input Devices serveral sensors are shown in order for you to copy the board. Because of my glove project I wanted to build the acceleration sensor for tracking, but it needed reflow soldering, and we don't have the tools required for that. That's why I changed to hall efect sensor. I can used them for making a simple, but efficient, mechanism to recognize pre stablished hand gesture.

But first of all, lets explain what is the hall effect: Wikipedia define it as: "The Hall effect is the production of a voltage difference (the Hall voltage) across an electrical conductor, transverse to an electric current in the conductor and a magnetic field perpendicular to the current. It was discovered by Edwin Hall in 1879."

In simple words, is the effect where a voltage is generated by the prescence of a magnetic field.

A board was design following the idea from the LCD example Input Device lecture and milled in the MODELA DMX-20. The next images shown this..

 photo week15_zpsa69d723b.png

Afterwards I soldered the components. The components needed were:

  1. Attiny45
  2. Pin headers 1x6
  3. Pin headers 2x3
  4. Resistance 10K
  5. Capacitor 1uF
  6. Hall efect sensor SOT23W

The hall effect sensor used is different from the one proposed, however I review both datasheet and I didn't find any significant difference. Know, we need to program the attiny. For doing this we download the files hello.mag.45.c and hello.mag.45.make and save them in a specific folder. We connect the FTDI cable and AVRISPmkll to the board and open the COMMAND at the folder site. We introduce the next command:

make -f hello.mag.45.make program-avrisp2

And...Voila! It is done. I didn't require to use the datasheet from the Attiny45. The process was straight forward.

The last step is to run the interface to see if the sensor works. I downloaded the hello.mag.45.py file and runned it. For this to work first you need to be sure of having the Pyserial and Tkinter modules. By default the Tkinter module should be installed. To be sure just write inside the command the following line: python -m tkinter. If it is installed the program will tell you to avoid installing it again.

For installing the Pyserial module write the following command:

pip install pyserial

There was an issue with the python application that was needed to fix. The program downloaded was not working in my computer. For used it I had to change some parts of the code... Well, actually I deleted them:

if (len(sys.argv) != 2):

print "command line: hello.mag.45.py serial_port"

sys.exit()

For the next line I change it by investigating the used port at the device manager.

port = 'COM4'

This solution works pretty well if you have the port connected at the momento of running the program.

The video shows the sensor board working:

Video

To get to the files please check the next link.

Download all the files from here.

Return to index