Input Component Setup Examples

Supplies for All

Circuit Board

Breadboard

Jumper Cables

Photoresistor

Additional Supplies

Photoresistor

(light sensor)

100 Ohm Resistor

Diagram

The data (yellow) wire is connected to pin A0 (analog).

Code

This code will print to the Serial Monitor the amount of light detected by the sensor.

Ultrasonic Distance Sensor

This sensor works like a bat or a clicker from The Last of Us to detect objects and their distance from the sensor using a soundwave pulse outside of human hearing ranges.

Additional Supplies

Ultrasonic Sensor

(distant sensor)

Diagram

The Trigger (yellow) wire is connected to pin 7 and Echo (green) to pin 6.

Code

This code will print to the Serial Monitor the distance of an object in front of the sensor.

Last updated

Was this helpful?