‘Smart’ lighting with LEDs and Photocells — my first attempts at programming an Arduino

9 min readJun 10, 2019

How have I never played around with hardware before? I’ve had some ideas in the past, but who has the time to sit down and learn electronics? They’re kind of complicated.

I had my first Arduino class about a week ago — two hours of learning that is outside of my wheel house. I have read some basic schematics and can tell the difference between a resistor and a capacitor but actually putting them to practical use and building circuits proved pretty tricky to wrap my head around quickly.

When I walked out of class, I had built my first circuit — a working LED. It was glorious. 3 days later and I sat down to rebuild it at home without instruction and I was perplexed, but I made my way back through it. Feeling a bit more confident, I set out to create 3 new projects in 1 week:

  1. Make an LED turn on when it’s dark and turns off when it’s bright
  2. Make an LED get bright when the environment gets bright (and a version that gets bright when the environment gets dark)
  3. Make an LED blink when the environment gets dark

I didn’t have a dedicated work space for doing this so I had to find a spare TV tray to go next to my desk — which might be its new permanent home.

This is how I got them all working.

Smart lighting




I’m Brad Cooper — UX Practitioner. A11y Evangelist (CPACC). Blockchain Enthusiast. Web Theorist. Find out more on how I work at https://uxBrad.com.