The light sensor (plus a few other goodies) arrived from Adafruit a couple of week ago. Since then I’ve had a chance to bread board the final circuit that will make up the smart lamp. I still have to order a case for the final product and decide where to mount the light sensor for optimal exposure. The plan has been modified from creating a smart lamp to creating a smart extension cord as I found out that there are multiple sets of lights that will run off this device. So I will mount the finished circuit to the end of an extension cord instead which will allow whatever is plugged into it to be activated when light levels drop below a set threshold.
I’ve posted the code that runs on the Adafruit 5v Trinket on my github page for those interested. Working with the Trinket itself has been mostly pain free. Adafruit has a great tutorial section for setting up and working with the Trinket. However, I did have trouble getting the light sensor to work with the Trinket when I first started out. Since the Trinket is not able to send back serial communications to a connected PC, I had to switch to an UNO R3 to see what was going on via the serial monitor. The light sensor from Adafruit I chose is perhaps not the best suited for this project because it requires a reference 3.3v inorder to gaurantee the best accuracy in taking readings. This is despite the fact that this sensor can be supplied with up to 7v. In the end I was able to get it working with the 5v Trinket and accuracy does not seem to be an issue from the subjective testing I’ve done. Keep an eye out for a post with the final circuit all soldered together!