Lab Exercise:
For this lab’s exercise, please work with a partner. Choose at least one sensor that gives you digital information and one that gives you analog information of the sensors listed below. Read about what it is and how it performs. Once you have picked a sensor, attach it to your Arduino and use the data from your sensor to drive an output (Servo-motor, LEDs, Buzzer, etc.) on and off. Document the finished circuit and your interaction with it. In addition to this, draw a diagram of how all the components are connected and add this to your documentation.
Note: Information about the individual sensors and how to use them can be found in the Information on Sensors and Resources section below.
- Touch Sensor (in your kit)
- Moisture Sensor
- Vibration Sensor (in your kit)
- Infrared Distance Sensor
- Ultrasonic Ranger (in your kit)
- 3-Axis Analog Accelerometer
Information on Sensors and Resources
A touch sensor enables you to replace press with touch. It can detect the change in capacitance when a finger is near by. That means no matter your finger directly touches the pad or just stays close to the pad, this sensor will detect it. A sample code for this sensor can be found here.
The Moisture Sensor can be used as if you were doing simple Analog Read with any analog device. This is to say, connect the sensors’ power and ground pins to the Arduino’s power and ground, respectively. The signal pin from these sensors can be connected to an Analog Input pin.
Infrared Distance Sensor (IR Proximity Sensor):
Similar to the Moisture Sensor, the Infrared Distance Sensor can by used by implementing the connections and code from a simple Analog Read Sketch. In the case of Infrared Distance Sensors, using the “map()” function can be helpful. This function maps the analog readings from the sensor to the distance between the sensor and the object. For the Sharp Infrared Distance Sensor you can also follow the sample code available here.
To understand what information this sensor is giving you, you can use the DigitalReadSerial example on your Arduino IDE — under Examples —> 0.1Basics.
Notice that when this module is stable, the circuit is turned on and the output is high. When the movement or vibration occurs, the circuit will be briefly disconnected and output low. This sensor is designed with adjustable sensitivity option as well, allowing you to tailor the sensor according to your own needs, adjust the sensitivity by turning the screw in the little blue box.
Module connection details:
- The VCC: positive
- The GND: connect power negative
- DO: digital signal output
- AO: this feature with the vibration sensor is invalid
Ultrasonic Ranger (Ultrasonic Sensor):
The Ultrasonic Ranger (AKA Ultrasonic Sensor OR HC-SR04) can be used to detect distance. To program Arduino to work with this sensor, you can use the Ping example on your Arduino IDE — under Examples —> 0.6Sensors.
Note: In order for the HC-SR04 to work with the Ping code, you must connect both Trig and Echo to the same Digital Pin in your Arduino.
For the Grove 3-Axis Accelerometer (3-Axis Analog Accelerometer) you can use the ADXL3xx example on your Arduino IDE — under Examples —> 0.6Sensors.
Documentation:
For documentation, work individually to answer each of these questions. Add your answers to your post, along with the other documentation for the circuits that you built in class, including the arduino code you wrote.
- Why did you choose that specific sensor and output? How do you think you could use this sensor to create an interactive experience?
- With the information you have so far and your personal experience, in what ways do you believe the computer influences our human behaviors? Give an example.
Leave a Reply
You must be logged in to post a comment.