Archive for the ‘Uncategorized’ Category

New Location

Posted: November 30, 2012 in Uncategorized

I’ve decided to move my blog to a new home:

http://blog.theincredibleholk.org/

I’ll keep the existing posts in their current location, but all my new posts will be at the new location. Hope to see you there!

Advertisements

Apparently someone recently guessed my super-ingenious password and starting telling the world that my opinions were worth money. Thanks for Erick Tryzelaar for pointing this out to me. I’ve updated my password and hopefully I’ll be safe for a while.

It turns out that many electronic components can run backwards and forwards. For example, it’s possible to use headphones as a microphone. Here’s a simple Arduino-based circuit that shows how to use an LED as a light sensor. The diagram below shows how to hook everything up.

LED Light Sensor Diagram

The basic idea is then to use analogRead() to detect the voltage across the LED. If the value is low, it means the LED is not detecting much light, while if the value is higher then there is more light present.

Three different versions of the code that goes along with this circuit is available at https://github.com/eholk/ArduinoExamples/tree/master/LEDLightSensor. The SerialOutput folder has a sketch that just dumps the values it reads to the serial port. You can use this to find a good threshold value, depending on the exact light conditions you are seeing. The Threshold sketch simply turns the LED on pin 13 off when there is light, and on otherwise. You could use this as a simple night light. Finally, the Fading sketch adjusts the intensity of the LED based on how much light is detected. It requires the output LED to be connected to a PWM pin, so if you are using an Arduino Uno instead of a Mega, you’ll want to adjust the code and the circuit to use, for example, pin instead of pin 13 for the output.

Here’s a video of the fading example.

Hello world!

Posted: March 4, 2012 in Uncategorized

Welcome to my blog! My name is Eric Holk, and I’m a Ph.D. Student at Indiana University studying programming languages for parallelism. This blog is where I’ll share various computing-related projects that I’m working on.