News Score: Score the News, Sort the News, Rewrite the Headlines

Two ways to use an LED as a light sensor with Arduino

I needed to log when a light switched on and off during the night as part of debugging an oddly behaving movement sensor. To do that I built a really simple light sensor logger using an Arduino Leonardo, a large LED and a resistor or three. Here it is:And here's the entire Arduino code:  analogReference(EXTERNAL);  Serial.println(analogRead(A1));The main loop() just reads the voltage across the LED from analog input A1 and writes it to the serial port. Then it waits for a second. The setup() rou...

Read more at blog.jgc.org

© News Score  score the news, sort the news, rewrite the headlines