Category:PCB PCB Industry Information

Group Administrators: 1 | Group Member: 148 | Group Threads: 374

This Group provides continually the latest information on the most recent trends, forecasts and analysis in the printed circuit board space.

Thread Reply
Reading Sensors with an Arduino Reply 2017-01-19 21:21:12
2K+ views
2 comments
511 likes

don_peter

Leave A Message

Follow

The ease with which an Arduino can obtain sensor values is one of the features that makes it so useful.
Sensors are devices that convert a physical quantity, such as light intensity or temperature, into an electrical quantity. A thermocouple, for example, outputs a voltage proportional to its temperature. There are many different types of sensors:
  • Light sensor
  • Motion sensor
  • Temperature sensor
  • Magnetic fields sensor
  • Gravity sensor
  • Humidity sensor
  • Moisture sensor
  • Vibration sensor
  • Pressure sensor
  • Electrical fields sensor
  • Sound sensor
  • Position sensor
These sensors are used in thousands of different applications, including manufacturing, machinery, aerospace, automobiles, medicine, and robotics.
EXPERIMENT 1: Distance sensor
In this experiment, we will use a Sharp GP2Y0A21YK proximity sensor to control the brightness of an LED.
SHARP IR Sensor
Hardware Required
  • 1 x Arduino Mega2560
  • 1 x breadboard
  • 1 x LED
  • 5 x jumper wires
  • 1 x 470 ohm resistor
  • 1 X Sharp GP2Y0A21YK proximity sensor
  • Wiring Diagram
    The Sharp proximity sensor can detect objects as close as 10 cm and as far away as 80 cm. It emits a pulse of infrared light and then detects the angle at which that light is reflected. The farther away an object is, the lower the output voltage. If the sensor receives no reflection, the output voltage of the sensor will be 0 V. If the object is 10 cm or closer, the output voltage will be equal to 5 V. (In this experiment, we are supplying 5V to the sensor.)
    The sensor's output is connected to an Arduino analog input. The Arduino's analog-to-digital converter (ADC) then converts that value to a value between 0 and 1023. This value is then mapped to a value between 0 and 255, and that number is used to set the duty cycle of a pulse-width modulated output, which controls the brightness of the LED. The result is that the closer an object is to the proximity sensor, the brighter the LED will shine.
    EXPERIMENT 2: Heat Sensor
    In this experiment, the Arduino will measure the temperature using an LM35 sensor IC. The LM35 is a low voltage IC which requires a power supply from +4 VDC to +20 VDC. This is ideal because we can power the sensor with the Arduino's +5 V output. The LM35 has just 3 pins, 2 for the power supply and one for the analog output. The output pin provides an analog voltage output that is linearly proportional to the temperature in degrees C. The output ranges from 0 V - 1.5 V, when powered with a single power supply. An output of 0 V corresponds to a temperature of 0 degrees C, and the output increases 10 mV for every degree increase in the temperature. To convert the output voltage to temperature, you need only to divide the output voltage in mV by 10. For example, if the output value equals 315 mV (0.315 V), the temperature is 31.5°C.
    Pin Configuration of LM35 IC:
    Pin ConfigurationHardware Required
    • 1 x LM35 Temperature Sensor
  • 2 x LEDs
  • 1 x matchbox
  • 2 X 470 ohm resistors
  • 1 x Arduino Mega2560
  • 1 x breadboard
  • 10 x jumper wires
  • 511 likes
    Statement: This post is only the personal view of the author and does not represent the opinions of ALLPCB.com.

    phenmarks

    Leave A Message

    Follow

    Bookmarked.Really helpful.

    NGUYEN VAN HAI

    Leave A Message

    Follow

    Your article answered all my puzzles.
    ThreadReply