home > services 

Adaptive Path Blog

The Team

Adventures in Physical Computing, Part 3: Input via a Sensor

by Dan



Light Sensor Triggers LEDs

Originally uploaded by odannyboy

While working my way through the Making Things Talk book, I hit a wall when it started to get into electronics. I had to stop and read Physical Computing and go through some basic Arduino tutorials just so I could understand what in the heck was going on. I had no idea what a basic circuit was, or how a switch worked, and especially not how to read an electronics schematic. A bunch of reading and some experimenting later, I have a much better handle on that stuff. Enough to be dangerous, probably, but at least enough to continue.

The next thing I wanted to do was hook up a sensor to the Arduino board and just see what it did. I had a light sensor laying around, so I plugged that in and found a simple piece of code that basically just reads and reports the data coming in from the sensor. I put that into the Arduino programming environment and ran it.

What I got back was a simple, rapid string of numbers ranging from 520 (when the sensor was covered by my hand and thus in the dark) to 600 (when the sensor was in the full light). What these numbers mean, I have no idea, nor does it really matter very much, I suppose. At least not for playing around.

I wanted to then have the sensor do something other than tell me the data, so I added a little bit of code (from an earlier program I’d done based on a tutorial), that made two LED lights light up based on the sensor reading. Red for dim light, blue for bright light. Any number below 530 made the red LED turn on, anything about 560 makes the blue light turn on. And, voila, I had a sensor that controlled some lights. Definitely not brain surgery, but fun, and it is, I think, as simple as it is, a great step towards a bigger world for me.

Next up: a more complicated response to sensor data…

One Response to “Adventures in Physical Computing, Part 3: Input via a Sensor”

  1. Jan Vantomme Says:

    The arduino platform is indeed great to play with. You don’t really need a great understanding of electronics to create something useful. The book you’re using is very nice. I’m using it too on some projects.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>