This week our goal is add a sensor to a microcontroller board and read it.
I decided to make a board with a phototransistor. This might end up as a part of my final project and I need some practice with the light sensor. I milled a board and stuffed it using the model given in the class.
Using the c program and the makefile given in the class, I set up the ATiny45 chip for its new purpose in life - monitoring the phototransistor sensor. This worked the first time! Perhaps I am getting better at the board making.
However, I spoke too soon. Once I got the python script running (I had to add a library), The sensor did nothing. It was nonresponsive and the reading was stuck on .33.
I double checked my solder traces and my connections. Finally I realized that my FTDI cable was on backwards. Fixing this, everything worked.So here is the sensor using just ambient light in the room.
Here it is with the sensor covered with my thumb.
Finally, here it is with a flash (and pre-flash) from my phone camera.