menu icon

VASCO COSME

week 10.

This week's assignement was to...

Measure something: add a sensor to a microcontroller board that you've designed and read it



This week's assignement seemed like a good oportunity to test some ideas for my final project. Since I'm making a dog-food dispenser with weight measurement precision, this was the time to get my hands on it.

There are tremendously accurate weight-measurement cells, but for this purpose i wanted to try with one of the cheaper sensors.

My idea was to try HALLO EFFECT SENSOR, that measures the magnetic field around it. If a magnetic field gests closer, it puts out values that vary with the strength of the magnetic field.




- - - - - - - - - - - - - - - - -

DESIGNING, MILLING AND SOLDERING THE COMPONENTS

The first step was to once again go into Eagle and redesign Neil's board. To make it a little different from Neil's, i put the sensor further away from the rest of the components, what could be of some use when it stays inside the final box. It also served as a test for printing a different-shaped PCB in the Modela. These were the final designs....



... And the final completed board!!!




- - - - - - - - - - - - - - - - -

PROGRAMMING THE BOARD

For this step i once again used AS220 tutorials, wich are priceless!!


1.
Install PYSerial
(http://sourceforge.net/projects/pyserial/files/latest/download)
To install, open terminal and move to the directory.
Type:
sudo python setup.py install


2.
Install the C + Install the MAKEFILE
(http://academy.cba.mit.edu/classes/input_devices/index.html, and find:

)

Download both files by clicking on the link Click on the link and make "save as" to a folder of your choice.



3.
Flash the microcontroller

Type:
sudo make -f hello.mag.45.make program-usbtiny

4.
Run The Python Program

NOTE:Your serial port may be different depending on your computer. You need to find the port for your computer. To find your serial port, with the board attached:

Open Terminal > type:
ls /dev/tty.usb*

Then use the port you are given to run the python program.
(For example - when I type "ls /dev/tty.usb*", I get "/dev/tty.usbserial-FTF53NJC". So I would type: python hello.mag.45.py /dev/tty.usbserial-FTF53NJC







Working!


You can download the design files here