Fab Academy 2014 : Input Devices

This week’s assignment is use input device. To verify the sensor sense is using in a Python interface program.
In this case this assignment has three important Steps:

  • Step one : Make Electronic Board
  • Step Two : Programming Board
  • Step three : Use Python Interface

Step 1 : Make Electronics Board

For design the electronic board, first I need to choose what can I sense. I choose to sense two diferent variable, luminosity (with a phototransistor) and wind velocity using the Atiny45. In the case of sense wind velocity I decide to design and create my own sensor. I design the mecanical part,using Inventor, so to have something to take the largest posible wind.


After design, print the mecanical part of the sensor with the 3D printer (replicator 2X)



After printing the mecanic you connect it to a motor ( motor rotate when you put enegy, but it generates energy when it in rotation).



In this case I used the motor to generate energy. I connect it to osciloscope to look the signal generated and I observe a continues signal which amplitude change with the wind, but the voltage amplitud created is low (200mV), in this case I decide to amplify this voltage. .



I modify the schematic to include the new sensor with its amplification part and the phototransistor. This sensor was conected to the ADC2 input, and the light sensor in the ADC3.....


and the routing board...


... making the board with the Roland and mounting the components ...


After that, the next Step.

Step 2 : Programming Board

Now, the Hardware was finish, it's necesary to program them.
I am using 2 sensors, and I need to use 2 analog inputs. The problem is that, the 2 inputs are multiplexed, and you configure the chip for use one of them.
To read data from the 2 inputs first set one, launch the conversion. Read and send the values. Do the same with the other input.



If you look the code, you observe that I can send wind velocity (ADC2) and after light value (ADC3) alternatively.

Step 3 : Python Interface

Now, the 2 parts of the programation, read data send with Python.
Here the problem was read a Wind value and after light value, because the python program written by Neil, works differently.
I decide to modify the program after analyse them. And here was the result.

click here to video



That's all ....