For this week's assignment I decided to make the Synchronous Detection Board. Synchronous detection of light is a technique that uses a phototransistor or a photo darlington device and a controlled light (for this board: an IR LED) to gather data about reflected light by levelling out the influence of ambient light.
I redrew the original board in Eagle (see Light section on this webpage). I added a zero ohm resistor (R4) to the board because I did not manage to have 4 copper lines under the ATtiny45 like they were in the original board design.
After arranging all components in Eagle's Board mode I exported the result in .png format to be sent to the Modela MSX-20 milling machine. I did not manage to get rid of the large black area around my board. This was not a real problem since the machine only mills the white parts, but I have to figure out later how to fix this.
After having soldered all components to the board, I made a smaller version by rearranging the components in Eagle's Board mode. Unfortunately later in the process this smaller board appeared to have a problem: an error 1 message and an advise to check the connections. I checked all connections, but couldn't find what was wrong. For the next steps I decided to go back to the bigger board I made first.
When it came to programming the board, I didn't remember quite well anymore how to do it. Fortunately one of my class mates reminded me of this document in which it is clearly explained.
It took a while to figure out how to use it (trial and error and trying to understand what the error messages meant), but then it worked: in the command line I typed python hello.reflect.45.py COM21 and that was it! (Before this and in order to make sure the baud rate was 115200 I downloaded term.py and in cmd typed python term.py COM21 115200. I am not sure you really have to do this though).
By holding a black or white piece of paper in front of the IR LED, I could see the difference between the phototransistor detecting (almost) no reflected IR light versus detecting a lot. For my final project I plan to use this sensor data as input for changing the colors of a set of RGB LEDs. UPDATE: because of to be expected latencies in reaction speed, I later decided to use the HALL effect for detection of spinning speed in my final project.