The following diagram shows how we connect the infrared receiver to the Arduino:
The 5V in and the ground pins on the IR receiver are connected to the appropriate rails on the breadboard. The signal pin is connected to the digital 2 pin on the Arduino. Now let's look at how we would connect the radio frequency receiver to the Arduino:
The 5V in and the ground pins on the RF receiver are connected to the appropriate rails on the breadboard. The four output pins on the receiver are connected to the 8, 9, 10 and 11 digital pins on the Arduino. When a button is pressed on the transmitter, the corresponding output pin on the receiver goes to HIGH.
Now let's look at the code for our projects.