Input devices

Lesson 10

This week's assignment is to measure something: add a sensor to a microcontroller board that you've made and read it

I decided to make two different PCB boards as they will the most important parts for my final project. The temperature board and the step response board. I downloaded both designs from the fablab course directory and imported them into the modela to be milled. I used the same procedure to set the modela as in the embedded programming course. I did not encounter any problems in these steps. I did encounter problems with getting both boards to work. The boards were technically ok, but the python program did not run. It took as half a day to get this to work. We tried various solutions to get it work:

  1. download a lower version of python, namely 2.7 instead of 3.3
  2. set the PATH name in environment variables to c:\python27
  3. set the PYTHONPATH name in environment variables to C:\Python27\Lib\site-packages\;C:\Python27\Scripts\;
  4. download and install numpy.py
  5. set the PYTHONPATH name in environment variables to C:\Python27\Lib\site-packages\;C:\Python27\Scripts\; C:\Python27\Lib\site-packages\numpy-1.7.0\
  6. download and install pserial.py
  7. set the PYTHONPATH name in environment variables to C:\Python27\Lib\site-packages\;C:\Python27\Scripts\; C:\Python27\Lib\site-packages\pyserial-2.6\; C:\Python27\Lib\site-packages\numpy-1.7.0\
  8. download and install MINGW
  9. set PATH name in environment variables to c:\python27;c:\mingw\bin
  10. At this point the PCB boards, and in particular python, did not work. The pserial seemed to be ok, but numpy did not work. Bas proposed to download another numpy file then the regular file proposed by the website. When you are at the download page of numpy, then choose numpy instead of download numpy-1.7.0.zip and then in consecutive order click 1.7.0 and numpy-1.7.0-win32-superpack-python2.7.exe. Both boards worked after i had installed this numpy file. This program apparently sets the parameters automatically.

    To program the chip to function like in the video above, i downloaded the hello.temp.45.make and hello.temp.45.c files into a newly created directory in WINAVR and then executed the following commands:

    make clean
    make -f hello.temp.45.make
    make -f hello.temp.45.make program-usbtiny
    

    I downloaded the hello.temp.45.py file into the python27 directory and executed the following command in this same directory:
    python hello.temp.45.py com11

    To program the chip to function like in the video above, i downloaded the hello.load.45.make and hello.load.45.c files into a newly created directory in WINAVR and then executed the following commands:

    make clean
    make -f hello.load.45.make
    make -f hello.load.45.make program-usbtiny
    

    I downloaded the hello.load.45.py file into the python27 directory and executed the following command in this same directory:
    python hello.load.45.py COM11

    My board was connected to COM11. This can be different every time you connect the board to the computer.