Skip to content

Commit

Permalink
Replace 'sensor' with 'receiver'
Browse files Browse the repository at this point in the history
This only affects comments and documentation
LuisMiCa committed Jan 12, 2022
1 parent df49e50 commit 3ca2006
Showing 23 changed files with 41 additions and 41 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -8,15 +8,15 @@ This is a Library for receiving and decoding IR signals from remote controls. Pe
* [Main features](#main-features)
* [Supported Protocols](#supported-protocols)
* [Supported Boards](#supported-boards)
* [Connecting the IR sensor](#connecting-the-ir-sensor)
* [Connecting the IR receiver](#connecting-the-ir-receiver)
* [Installing the library](#installing-the-library)
* [Using the library](#using-the-library)
* [Possible improvements](#possible-improvements)
* [Contributions](#contributions)
* [Contact information](#contact-information)
* [License](#license)
* [Appendix A - Details about this library](#appendix-a---details-about-this-library)
* [Appendix B - IR sensor connection details](#appendix-b---ir-sensor-connection-details)
* [Appendix B - IR receiver connection details](#appendix-b---ir-receiver-connection-details)


## Main features
@@ -49,8 +49,8 @@ ATtiny 25/45/85/24/44/84 microcontrollers are supported.
If you have problems with this library on some board, please submit an issue here: https://github.com/LuisMiCa/IRSmallDecoder/issues or [contact me](#contact-information).


## Connecting the IR sensor
The sensor's output must be connected to one of the Arduino's digital pin that is usable for interrupts and, also, it must work with the CHANGE mode if the intended protocol uses this mode. (One example of a board that does not have CHANGE mode on some of the interrupt pins is the Arduino 101; and one protocol that uses that mode is the [RC5](#speed)).
## Connecting the IR receiver
The receiver's output must be connected to one of the Arduino's digital pin that is usable for interrupts and, also, it must work with the CHANGE mode if the intended protocol uses this mode. (One example of a board that does not have CHANGE mode on some of the interrupt pins is the Arduino 101; and one protocol that uses that mode is the [RC5](#speed)).

| Board or microcontroller | Usable digital pins numbers |
|-------------------------------------|--------------------------------|
@@ -70,7 +70,7 @@ The sensor's output must be connected to one of the Arduino's digital pin that i

<sup>(Sources: <https://www.arduino.cc/reference/en/language/functions/external-interrupts/attachinterrupt/>; <http://highlowtech.org/?p=1695> and <https://github.com/SpenceKonde/ATTinyCore>)</sup>

If you're not sure about how to connect the IR Sensor to the Arduino, go to: [IR sensor connection details](#appendix-b---ir-sensor-connection-details) at the end of this document.
If you're not sure about how to connect the IR receiver to the Arduino, go to: [IR receiver connection details](#appendix-b---ir-receiver-connection-details) at the end of this document.


## Installing the library
@@ -107,7 +107,7 @@ before the

Then you need to create **one** decoder object with the correct interrupt pin:
```ino
IRsmallDecoder irDecoder(2); //IR sensor connected to pin 2 in this example
IRsmallDecoder irDecoder(2); //IR receiver connected to pin 2 in this example
```
And also a decoder data structure:
@@ -432,16 +432,16 @@ In order to make this library compatible with most of the Arduino boards, I didn
---
<div style="page-break-after: always;"></div>
## Appendix B - IR sensor connection details
## Appendix B - IR receiver connection details
If you are using a simple IR Receiver module the pinout order will be, most likely, `Vout Gnd Vcc` like in the the following examples:
If you are using a simple IR receiver module the pinout order will be, most likely, `Vout Gnd Vcc` like in the the following examples:
| ![](extras/IRsensors/PIC12043S.jpg) | ![](extras/IRsensors/TSOP48xx.jpg) |
| ![](extras/IR%20receivers/PIC12043S.jpg) | ![](extras/IR%20receivers/TSOP48xx.jpg) |
|-------------------------------------|------------------------------------|
But beware, there are other IR Receivers with different pinouts, like these examples:
But beware, there are other IR receivers with different pinouts, like these examples:
| ![](extras/IRsensors/TSOP17xx.jpg) | ![](extras/IRsensors/SFH505A.jpg) |
| ![](extras/IR%20receivers/TSOP17xx.jpg) | ![](extras/IR%20receivers/SFH505A.jpg) |
|------------------------------------|-----------------------------------|
<table>
@@ -451,7 +451,7 @@ But beware, there are other IR Receivers with different pinouts, like these exam
written on it (sometimes it's <br />
DAT or S instead of Vout).
</td>
<td> <img src="extras/IRsensors/IRModule.jpg" alt=""></img> </td>
<td> <img src="extras/IR%20receivers/IRModule.jpg" alt=""></img> </td>
</tr> </tbody>
</table>
@@ -461,13 +461,13 @@ The connection to the Arduino is very straightforward, just connect:
- VCC to the Arduino's +5V or (+3.3V if you are using a board with lower operating voltage<sup>[2]</sup>);
- GND to one of the Arduino's Ground connector.
<sup>[1] Go to [Connecting the IR sensor](#connecting-the-ir-sensor) for more information.</sup>
<sup>[2] Note that not all IR Sensors can operate at low voltages.</sup>
<sup>[1] Go to [Connecting the IR receiver](#connecting-the-ir-receiver) for more information.</sup>
<sup>[2] Note that not all IR receivers can operate at low voltages.</sup>
Nearly all IR Sensor's datashets recommend the usage of an RC filter (R1, C1) at the power input, but it's not really necessary, (it's meant to suppress power supply disturbances):
Nearly all IR receiver's datashets recommend the usage of an RC filter (R1, C1) at the power input, but it's not really necessary, (it's meant to suppress power supply disturbances):
![](extras/IRsensors/IR%20Receiver%20Connections.jpg)
![](extras/IR%20receivers/IR%20receiver%20connections.jpg)
Note that most IR Receiver Test Modules already have that RC filter.
Note that most IR receiver Test Modules already have that RC filter.
2 changes: 1 addition & 1 deletion examples/HelloNEC/HelloNEC.ino
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
*
* Note: for the NEC extended protocol, just define IR_SMALLD_NECx instead of IR_SMALLD_NEC
*
* In this example it's assumed that the IR sensor is connected to digital pin 2 and
* In this example it's assumed that the IR receiver is connected to digital pin 2 and
* the pin is usable for external interrupts.
*
* For more information on the boards' usable pins, see the library documentation at:
2 changes: 1 addition & 1 deletion examples/HelloRC5/HelloRC5.ino
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
*
* Note: this works for both RC5 and RC5 extended.
*
* In this example it's assumed that the IR sensor is connected to digital pin 2 and
* In this example it's assumed that the IR receiver is connected to digital pin 2 and
* the pin is usable for external interrupts (that work with the CHANGE mode).
*
* For more information on the boards' usable pins, see the library documentation at:
2 changes: 1 addition & 1 deletion examples/HelloSAMSUNG/HelloSAMSUNG.ino
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
* - The SAMSUNG32 protocol corresponds to the standard described in this application note:
* http://elektrolab.wz.cz/katalog/samsung_protocol.pdf
*
* In this example it's assumed that the IR sensor is connected to digital pin 2 and
* In this example it's assumed that the IR receiver is connected to digital pin 2 and
* the pin is usable for external interrupts.
*
* For more information on the boards' usable pins, see the library documentation at:
2 changes: 1 addition & 1 deletion examples/HelloSIRC/HelloSIRC.ino
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
* If the decoder detects 12 or 15 bits, the ext data member is set to 0.
* If it detects a 20-bit code, it will save the extended data in the ext member.
*
* In this example it's assumed that the IR sensor is connected to digital pin 2 and
* In this example it's assumed that the IR receiver is connected to digital pin 2 and
* the pin is usable for external interrupts.
*
* For more information on the boards' usable pins, see the library documentation at:
2 changes: 1 addition & 1 deletion examples/HelloSIRCbasic/HelloSIRCbasic.ino
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
* - IR_SMALLD_SIRC12 will receive signals from SIRC15 and SIRC20, but the codes will not be correct;
* - In a similar way, IR_SMALLD_SIRC15 will receive signals from SIRC20, but not from SIRC12.
*
* In this example it's assumed that the IR sensor is connected to digital pin 2 and
* In this example it's assumed that the IR receiver is connected to digital pin 2 and
* the pin is usable for external interrupts.
*
* For more information on the boards' usable pins, see the library documentation at:
8 changes: 4 additions & 4 deletions examples/KeyHeldNEC/KeyHeldNEC.ino
Original file line number Diff line number Diff line change
@@ -4,17 +4,17 @@
* a possible usage for the keyHeld data member.
*
* How to use this sketch:
* - Connect the sensor (see library documentation);
* - Connect the IR receiver (see library documentation);
* - Upload the sketch and open the Serial Monitor;
* - "Teach the Arduino" which keys you want to use to increase or decrease a value:
* point the NEC remote to the IR sensor and press any key of your choosing then press a different key;
* point the NEC remote to the receiver and press any key of your choosing then press a different key;
* - Use the selected keys to increase/decrease the value, one unit at a time for each keypress,
* or, if you hold the key:
* 1 unit for each of the first 9 repeat codes;
* 5 units for each of the next 18 repeat codes;
* 25 units for each of the subsequent repeat codes.
*
* In this example it's assumed that the IR sensor is connected to digital pin 2 and
* In this example it's assumed that the IR receiver is connected to digital pin 2 and
* the pin is usable for external interrupts.
*
* For more information on the boards' usable pins, see the library documentation at:
@@ -24,7 +24,7 @@

#define IR_SMALLD_NEC
#include <IRsmallDecoder.h>
IRsmallDecoder irDecoder(2); //assuming that the IR sensor is connected to digital pin 2
IRsmallDecoder irDecoder(2); //assuming that the IR receiver is connected to digital pin 2
irSmallD_t irData;

int value = 0;
6 changes: 3 additions & 3 deletions examples/SingleHold/SingleHold.ino
Original file line number Diff line number Diff line change
@@ -4,15 +4,15 @@
* a possible usage for the keyHeld data member.
*
* How to use this sketch:
* - Connect the sensor (see library documentation);
* - Connect the IR receiver (see library documentation);
* - Uncomment the #define for the desired protocol,
* (leave the others as comments, only one is allowed);
* - Upload the sketch and open the Serial Monitor;
* - "Teach the Arduino" which keys you want to use;
* - Hold the selected keys to turn on/off the built-in LED.
* If you keep holding, it won't do anything else.
*
* In this example it's assumed that the board has a builtin LED and the IR sensor is
* In this example it's assumed that the board has a builtin LED and the IR receiver is
* connected to digital pin 2, which must be usable for external interrupts.
*
* For more information on the boards' usable pins, see the library documentation at:
@@ -29,7 +29,7 @@

#include <IRsmallDecoder.h>

IRsmallDecoder irDecoder(2); //assuming that the IR sensor is connected to digital pin 2
IRsmallDecoder irDecoder(2); //assuming that the IR receiver is connected to digital pin 2
irSmallD_t irData;
int keyOn, keyOff;
bool keyReleased = true;
6 changes: 3 additions & 3 deletions examples/TemporaryDisable/TemporaryDisable.ino
Original file line number Diff line number Diff line change
@@ -4,15 +4,15 @@
* a possible usage for the enable and disable methods of the decoder.
*
* How to use this sketch:
* - Connect the sensor (see library documentation);
* - Connect the IR receiver (see library documentation);
* - Uncomment the #define for the desired protocol,
* (leave the others as comments, only one is allowed);
* - Upload the sketch and open the Serial Monitor;
* - "Teach the Arduino" which key you want to use to disable the decoder;
* - The selected key will temporarily disable the decoder;
* - Any other key on the remote will toggle the builtin LED;
*
* In this example it's assumed that the board has a builtin LED and the IR sensor is
* In this example it's assumed that the board has a builtin LED and the IR receiver is
* connected to digital pin 2, which must be usable for external interrupts.
*
* For more information on the boards' usable pins, see the library documentation at:
@@ -33,7 +33,7 @@
#include <IRsmallDecoder.h>
#define TIMEOUT 8

IRsmallDecoder irDecoder(2); //assuming that the IR sensor is connected to digital pin 2
IRsmallDecoder irDecoder(2); //assuming that the IR receiver is connected to digital pin 2
irSmallD_t irData;
int ledState = LOW;
int keyDisable;
6 changes: 3 additions & 3 deletions examples/ToggleLED/ToggleLED.ino
Original file line number Diff line number Diff line change
@@ -3,10 +3,10 @@
* How to use this sketch:
* - Uncomment the #define for the desired protocol,
* leave the others as comments (only one is allowed).
* - Upload to the Arduino board, connect the IR sensor and
* - Upload to the Arduino board, connect the IR receiver and
* - press any key on the remote to toggle the builtin LED
*
* In this example it's assumed that the board has a builtin LED and the IR sensor is
* In this example it's assumed that the board has a builtin LED and the IR receiver is
* connected to digital pin 2, which must be usable for external interrupts.
*
* For more information on the boards' usable pins, see the library documentation at:
@@ -26,7 +26,7 @@

#include <IRsmallDecoder.h>

IRsmallDecoder irDecoder(2); //assuming that the IR sensor is connected to digital pin 2
IRsmallDecoder irDecoder(2); //assuming that the IR receiver is connected to digital pin 2
int ledState = LOW;

void setup() {
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion src/IRsmallD_NEC.h
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@
*/


void IRsmallDecoder::irISR() { //executed every time the IR signal goes up (but it's actually FALLING @ SensorOutput)
void IRsmallDecoder::irISR() { //executed every time the IR signal goes up (but it's actually FALLING @ ReceiverOutput)
// NEC timings in micro seconds:
// Minimum Gap length = repeatPeriod - SignalFrame = 108000 - 67500 = 40500
const uint16_t c_GapMin = 32400; // = 40500 * 0.8 (20% less)
2 changes: 1 addition & 1 deletion src/IRsmallD_SAMSUNG.h
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@
#define STOP_SPACE_MAX 27938 //27937.5 to be more precise


void IRsmallDecoder::irISR() { //executed every time the IR signal goes UP (but it's actually FALLING @ SensorOutput)
void IRsmallDecoder::irISR() { //executed every time the IR signal goes UP (but it's actually FALLING @ ReceiverOutput)
// SAMSUNG timing thresholds:
const uint16_t c_LMmax = LEADING_MARK * 1.1; // 10% more = 9900
const uint16_t c_LMmin = LEADING_MARK * 0.9; // 10% less = 8100
2 changes: 1 addition & 1 deletion src/IRsmallD_SAMSUNG32.h
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@
#define STOP_SPACE_MAX 72563 //72562.5 to be more precise


void IRsmallDecoder::irISR() { //executed every time the IR signal goes UP (but it's actually FALLING @ SensorOutput)
void IRsmallDecoder::irISR() { //executed every time the IR signal goes UP (but it's actually FALLING @ ReceiverOutput)
// SAMSUNG32 timing thresholds:
const uint16_t c_LMmax = LEADING_MARK * 1.1; // 10% more = 9900
const uint16_t c_LMmin = LEADING_MARK * 0.9; // 10% less = 8100
2 changes: 1 addition & 1 deletion src/IRsmallD_SIRC_basic.h
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@
*/


void IRsmallDecoder::irISR() { //executed every time the IR signal goes down (but it's actually RISING @ SensorOutput)
void IRsmallDecoder::irISR() { //executed every time the IR signal goes down (but it's actually RISING @ ReceiverOutput)
#if defined(IR_SMALLD_SIRC12) //Conditional code inclusion (at compile time)
const uint8_t c_NumberOfBits = 12;
#elif defined(IR_SMALLD_SIRC15)
2 changes: 1 addition & 1 deletion src/IRsmallD_SIRC_multi.h
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@
*/


void IRsmallDecoder::irISR() { //executed every time the IR signal goes down (but it's actually RISING @ SensorOutput)
void IRsmallDecoder::irISR() { //executed every time the IR signal goes down (but it's actually RISING @ ReceiverOutput)
// SIRC timings' thresholds in micro secs:
//Minimum standard Gap length = (75-(4+3*20))*600 --> assuming 20 bit 1s, which has the smallest gapMin
//Maximum standard Gap length = (75-(4+2*12))*600 --> assuming 12 bit 0s, which has the biggest gapMax
2 changes: 1 addition & 1 deletion src/IRsmallDecoder.h
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ bool IRsmallDecoder::_irCopyingData = false; //to avoid volatile _irData corrup
/**
* IRsmallDecoder object costructor
*
* @param interruptPin is the digital pin where the IR sensor is connected. That pin must be is usable for external interrupts
* @param interruptPin is the digital pin where the IR receiver is connected. That pin must be is usable for external interrupts
*/
IRsmallDecoder::IRsmallDecoder(uint8_t interruptPin) {
pinMode(interruptPin,INPUT_PULLUP); //active low

0 comments on commit 3ca2006

Please sign in to comment.