Light Sensor (LDR)

Light dependant resistor (LDR) detects light, you can also use it to sense proximity and gesture, etc. See KOBAKANT's example of detecting hand gestures using LDR. 

​Connect the sensor to INFINITE mainboard

Things you need

  • INFINITE mainboard

  • LDR

  • 2 * Crocodile test lead

  • ​USB cable

Steps 

1. Snape the e-textile connections to the three snaps in Analog 1 on the mainboard, but if you want to use it as a digital sensor to triggter an output, connect it to Digital 1​.

2. Connect the sensor to the mainboard by crocodile test leads, alternatively, you can sew the LDR to your design and close circuit by sewing conductive material. 

Testing with Arduino IDE

Steps 

1. Connect INFINITE mainboard to your PC through the USB cable

2. Open Arduino IDE, open the AnalogReadSerial sketch by clicking File > Examples > 01.Basics > AnalogRead Serial. If you use the LDR as a digital sensor, click DigitalRead Serial

Screen Shot 2021-04-17 at 23.57.25.png

3. Change int sensorValue = analogRead(A0); to int sensorValue = analogRead(A5);

Screen Shot 2021-04-18 at 00.00.34.png

4. Go to the Menu, click Tools > Port > /dev/cu.usbmodem146201(Adafruit Feather M0)

5. Click Upload icon on the top left of the window

Screen Shot 2021-04-17 at 23.20.10.png

6. When you see "Done uploading", open the serial monitor by clicking the icon on the top right corner

Screen Shot 2021-04-17 at 23.22.03.png

7. On the serial monitor window, you should see the reading changes while you the light flickering