Connecting the Sharp IR Sensor
|
Connection
Like the Parallax PING sensor, the Sharp IR sensor has 3 connections:
- Ground
- Power (5V)
- Signal (analog output)
However, unlike the PING sensor, the Sharp IR Sensor uses what is called a JST connector. Unfortunately, this connector can't be plugged into the breadboard with out a wire adapter. You can find these adaptors online at places like sparkfun.com and the Parallax website. [1]
The Circuit
NOTE: ROBOTC currently configures the analog input pins slightly different from the wiring language (Arduino IDE). As such it is currently necessary to use the resistor between the signal connection and ground.
Making the Connections
Connecting the JST to the sensor
First connect the JST connector to the Sharp IR sensor.
Connecting the sensor to the board
Now connect the other end of the JST connector cable to the breadboard.
Adding the resistor
Since we currently need the resistor (10k Ohm) to get the correct values, we will connect it next. It will go from the signal pin to ground.
Adding the wires
Now we can add the wires. The red wire of the sensor connects to +5 volts, the black wire connects to Ground (GND), and the yellow signal wire connects to analog pin A0 through the same bus as the 10k ohm resistor that is connected to ground.