Introduction: Arduino: How to Connect Common Sensors and Items

Picture of Arduino: How to Connect Common Sensors and Items

Sometimes, you just can't seem to figure out how to get a circuit to work out! This instructable will help you use your electronics in the way they were meant to be used by showing you how to connect them to your Arduino board.

Difficulty:easy..Beginner programming & breadboard skills

Also: Please feel free to comment

This Instructable includes instructions for proper use of these elements:

Battery16x2 LCDServo
DC MotorIR Motion DetectorAccelerometer
Piezo BuzzerLEDPotentiometer
Tilt SwitchTemperature SensorPushbutton
DHT-11Thumb JoystickFlex Sensor
Toggle SwitchPressure SensorSolenoid
Stepper Motor

See here for Arduino code reference:

http://www.arduino.cc/en/Reference/HomePage

UPDATE:

  • Added DHT-11, Thumb Joystick, Flex Sensor, and Stepper Motor

Step 1: Buttons and Other Manual Input Devices

Picture of Buttons and Other Manual Input Devices
  1. Pushbutton - connect to 5v, and ground through a 10kΩ (brown-black-orange) resistor. On the ground side, connect to a digital pin.
  2. Toggle Switch - connect to 5v, and ground through a 10kΩ (brown-black-orange) resistor. On the ground side, connect to a digital pin.
  3. Potentiometer - connect to 5v, ground, and the middle pin goes to an analog pin.
  4. Thumb Joystick - pin 1 goes to 5v, pin 2 & 3 go to an analog pin, pin 4 goes to ground through a 10kΩ (brown-black-orange) resistor and a digital pin, and pin 5 goes to ground.

Step 2: Photoresistors and Other Commonly Used Sensors

Picture of Photoresistors and Other Commonly Used Sensors
  1. Temperature Sensor - connect to 5v, ground, and middle pin goes to an analog pin
  2. Photoresistor - connect to 5v, ground through a 10kΩ (brown-black-orange) resistor, and the grounded side also goes to an analog pin
  3. Tilt Switch - connect to 5v, ground through a 10kΩ (brown-black-orange) resistor, and the grounded side goes to a digital pin
  4. Piezo (As Input) - connect to 5v, ground through a 1MΩ (brown-black-green) resistor, and the grounded side also goes to an analog pin
  5. Triple Axis Accelerometer - pin 1 is unconnected, pins 2-4 go to an analog pin, pin 5 goes to ground, and pin 6 goes to 5v
  6. Force Sensing Resistor - goes to 5v, and ground through a 10kΩ (brown-black-orange) resistor. The grounded side also goes to an analog pin.
  7. IR Proximity Sensor - goes to 5v, ground, and a digital pin.
  8. DHT-11 - pin 1 goes to 5v, pin 2 goes to a digital pin, and pin 4 goes to ground.
  9. Flex Sensor - pin 1 goes to 5v through a 10kΩ (brown-black-orange) resistor and an analog pin, and ground.

Step 3: Servos and Other Commonly Used Outputs

Picture of Servos and Other Commonly Used Outputs
  1. Servo - connect to 5v, ground, and a digital pin
  2. LED - connect to 5v through a 220Ω (red-red-brown) resistor, and ground
  3. Piezo(As Output) - connect to ground, and a digital pin
  4. DC Motor - connect an NPN transistor to 5v, ground, and the central pin goes to a digital pin. The DC motor goes to ground, and the pin on the right of the transistor.
  5. LCD 16x2 Display Screen - This one is sort of lengthy to explain, so just look at the picture.
  6. Solenoid - connect an NPN transistor to 5v, ground, and the central pin goes to a digital pin. The DC motor goes to ground, and the pin on the right of the transistor.
  7. Stepper Motor - Using an Arduino REV3 Motor Shield, pins 1,3,4, and 6 of the stepper go to pins A+,A-,B+, and B- of the shield respectively.

Step 4: Misc. Parts and Pieces

Picture of Misc. Parts and Pieces
  1. Use a battery to power your Arduino - connect (+) to Vin pin, and (-) to ground pin,
  2. Resistors - use this website to help calculate the resistance http://resistor.cherryjourney.pt/

Comments

winnietherpoh (author)2016-04-26

You could make use of the integrated pullup-resistors on the digital pins instead of connecting buttons for example to 5V. So you just need to connect one side to ground and the other side to a digital pin.

In the script, you set the pin as an output and then write digitalwrite(pin, HIGH); this way the normal state is HIGH and if you push the button the pin reads LOW. Very easy, less parts. Works with other parts on your list as well.

DarkstarSA (author)2016-04-25

Very useful, thanks. ?

agelbert (author)2016-04-25

Great info! Thank you.

clauculo (author)2016-04-24

Very useful! if you know more, please share. Also for esp8266 esp12e.

About This Instructable

4,714views

132favorites

License:

Bio: Oh hey, look, a bio section! In case you actually cared enough to look here, I'm millerman4487, and I like waffles and robots. I ... More »
More by millerman4487:Detailed Wallpapers With SnapseedPlant Moisture Sensor w/ ArduinoProvide Power With an Old USB Cord
Add instructable to: