Week 13:
Input Devices

Mission objectives:

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

Describe your design and fabrication process using words/images/screenshots.

Explain programming process/es you used and how the microcontroller datasheet helped you.

Explain problems and how the team solved them.

Include original design files and code.

Board design

The final project of mine requires sun light sensing and that lead me to choose the phototransistor sensor for the assignment.

I took the original design from tha assinment page to practice.

PCB fabrication

This time I had an opportunity to try another milling machine, the Othermill. After few minutes with Fab modules I was able to create .nc files for the milling process. The machine settings are automatically adopting to the tool size, the job definition (traces or cutout) and the kind of PCB.

There is also an option to set the size of the PCB and to place the board at specific location on it. Machine makes the Z axis 0 point reference by itself. The only thing that operator does during PCB milling is switching the bits between the traces (0.64’) and the outline cutout (0.32’).

Soldering

From my last experience I learned to prepare ahead some thin pads on the board that makes the parts attachment much easier.

Programing from terminal

After this step I did not figure yet how to run the serial output to see the sensor data. I installed phyton programm with serial out put but still could not compile/run all of it togather, not even with Xcode on Mac.

After experience with original board I designed my own version. The same components in different layout.

New spacing between traces in my design was bad in few places which I needed to locate and fix.

Here I point and cut the gaps.

Programming with Arduino IDE

I took the original Neil Gershenfelds code to make the first sensor readings.
Checked and difined the pins crossing the code elements with ATtiny45 pinout scheme and with my phototransistor board shematics.

Checked the code in Arduino IDE, setted the board kind as ATtiny, the ATtiny45 as the processor with intrnal 8MHz clock, the right programer type.

After that I Burned Bootloader on the processer to be sure that the chip and the the board are funtional.

Only then I uploaded the code from Sketch menu with "Upload Using Programmer" command.

At the peaks of the light measurement, were the value reaches 914-1012 value I pointed flash to the phototransistor circuit to catch the differences between the ambient room light and directly pointed light source.