At the start of Fab Academy, one of the projects I wanted to tackle was making a cat laser that would turn on by sensing a movement, stay on for a short duration of time and then turn off. The idea behind it was that a recent adopted pet seems to need much more exercise and goes crazy for the laser pointer, but the house is often empty and we don’t have much time to play with her. So I decided this would be a good thing to try out for input and output device weeks. The second step would be adding a servo motor that would make the laser move around.
I took apart a little laser cat toy to obtain the laser diode inside. It was labeled as a class IIIa, which I found to have be a 5mW, 4.5v diode. I was able to remove it with the 1130ohm resistor intact. Initially, I was going to make a circuit with an additional power source of a 9v cell battery and a regulator, but after further mapping, it seemed unnecessary. So I decided to use the 5V from the usb to power the breakout board, and the MOSI pin on the 6-pin header to receive information from the piezo.
The design of the board was straightforward, as there were very few components needed. Aside from power and ground, I connected the laser diode to mosi, a diode to step down power to 4.5v, and a Nchannel MOSFET to act as a switch, turning the diode on and off.
When I first tried to program the board, the error message returned that the laser was not declared. I added to the code and was able to burn the bootloader and program the main board. When I removed the 6pin header and attached the breakout board, the light went on right away. Unfortunately, there was no communication between the main board piezo input and the laser output.
initial arduino sketch I worked with:
error readings when trying to program:
Shawn double-checked my traces and soldering and thought that it could be that I was using the wrong type of transistor. I replaced the transistor with a PchannelMOSFET and will test this soon.
changing the MOSFET component (last Pchannel in the drawer!)
I am continued to troubleshoot over the next week, moving between replacing parts and testing with the multimeter. I was unable to get the laser light to be triggered by the piezo.
relevant files:
- laser breakout board
- laser breakout board
- Codefile1
- Codefile2