Sensors Lab Reviewer
Sensors Lab Reviewer
EXPERIMENT 2: ANALOG AND DIGITAL SIGNALS • Serial Monitor – a separate pop-up window that
Parts of an Arduino UNO board acts as a separate terminal that communicates
by receiving and sending Serial Data.
• Displays values read by the pins
• A debugging tool
• Serial.begin(9600) –Tells the Arduino to get
ready to exchange messages with the Serial
Monitor at a data rate of 9600 bits(0s and 1s)
per second. Bps- bits per sec.
• baud rate - speed of data transfer; ex. 9600
• digitalReadSerial()- sends digital reading to
serial monitor
• analogOutSerial()- send analog reading to serial
monitor
• Range for sensor: 0-1023
• Digital signal vs. analog signal
• Range for output: 0-255
• A normal Arduino Uno board has 14 digital pins
• Command codes/ syntax for writing in the serial
and 6 analog pins
monitor:
• void setup() – codes under this block are
• Serial.print()
executed once
• Serial.println()
• void loop() – codes under this block are
• Serial.write()
executed more than once
• Serial monitoring can be done both on analog
• const int – holder of constant variables/
and digital signals
variables that won’t change their pin numbers
EXPERIMENT 4: ULTRASONIC SENSORS
all throughout the code
Operation formula:
• int – holder of integer variables (whole nos.)
distance = (velocity of sound ∗time)/2
• AnalogRead()- reads the input (HIGH or LOW) in
Minimum Range: The HC-SR04 can detect distances as
an analog pin
close as 2 cm (approximately 0.8 inches) from the
• the voltage reading of the pin is read from
sensor
0-1023
Maximum Range: The maximum effective range is 400
• 0 volts = 0; 5 volts = 1023
cm (approximately 13 feet) under optimal conditions
• values in between 0-1023 are determined
by ratio and proportion
Limitations:
• ex. a reading of 56 is equal to 0.26 volts -vaccum environments
• cw movement of potentiometer decreases -underwater applications
voltage -soft or absorbent materials
• ccw mvmt of potentiometer increases -small objects
voltage -angled surfaces
• DigitalRead()- reads the input(HIGH or LOW) in -unstable temperature environments
a digital pin -high humidity or fog
• PinMode()- sets a pin as an output (send
data)/input (receive data)
• e.g. pinMode(LED_BUILTIN, OUTPUT)
• DigitalWrite()- writes a high or low value to a
digital pin
• delay (1000) – one second delay; 1 sec =
1000ms
EXPERIMENT 1: ARDUINO SENSOR COMPONENTS
EXPERIMENT 5: TEMPERATURE SENSORS Sensors vs. Transducers in an Arduino kit
microcontroller.
The formula used in the experiment is fahrenheit
= ((celsius * 9) / 5 + 32).
• 5V Stepper Motor: Rotates in precise steps, used for
precise positioning.
• RGB LED: Emits different colors of light based on the • Big Sound Sensor: Detects sound levels, usually used for
combination of red, green, and blue signals. noise detection.
Sensors
• DHT11: Measures temperature and humidity. • RFID Module: Reads data from RFID tags for identification
and access control.