HRS-4B-R
AI

The **HRS-4B-R** typically refers to a specific series of **Rotary DIP Switches** or high-reliability electromechanical components, often manufactured by companies like Hartmann (a Phoenix Mecano brand) or similar electronic part suppliers.
Below is a detailed breakdown of its electronic characteristics and specifications.
---
## 1. Technical Specifications
The HRS-4B-R is designed for PCB mounting to provide binary-coded inputs to a circuit.
| Feature | Specification |
| :--- | :--- |
| **Type** | Rotary DIP Switch |
| **Coding** | Binary Coded Decimal (BCD) or Hexadecimal |
| **Positions** | 10 (BCD) or 16 (Hex) depending on sub-model |
| **Mounting Type** | Through-hole (THT) |
| **Actuator Type** | Recessed Slot (Arrow-shaped) |
| **Contact Rating** | 100mA @ 50V DC (Static) / 100mA @ 5V DC (Switching) |
| **Life Cycle** | ~10,000 to 20,000 Steps |
---
## 2. Pin Configuration and Logic
These parts are "4-bit" encoders. They convert a physical rotational position into a logic signal that a microcontroller can read.
### Pinout Structure
1. **Common (C):** The input voltage source (usually VCC or GND).
2. **Bit 1 (2^0):** Least Significant Bit (Value: 1).
3. **Bit 2 (2^1):** (Value: 2).
4. **Bit 4 (2^2):** (Value: 4).
5. **Bit 8 (2^3):** Most Significant Bit (Value: 8).
---
## 3. Key Features
* **Gold-Plated Contacts:** Ensures high reliability and prevents oxidation over long periods of inactivity.
* **Sealed Construction:** Usually features an O-ring or potting to withstand wave soldering and board washing processes.
* **Compact Footprint:** Designed to save space on crowded Printed Circuit Boards (PCBs).
* **"R" Suffix:** Often denotes "Real Code" (where the output logic matches the physical number) versus "Complement Code."
---
## 4. Application Examples
* **Address Setting:** Used in industrial networking (like RS-485 or CAN bus nodes) to set a unique ID for a device.
* **Mode Selection:** Choosing between different firmware operation modes without needing a digital display or interface.
* **Configuration:** Setting baud rates or hardware parameters on embedded systems.
---
## 5. Circuit Integration Example
To use the HRS-4B-R with an Arduino or MCU, you would typically use pull-up resistors:
```cpp
// Example: Reading a 4-bit Rotary Switch
int pin1 = 2; // Bit 1
int pin2 = 3; // Bit 2
int pin4 = 4; // Bit 4
int pin8 = 5; // Bit 8
void setup() {
pinMode(pin1, INPUT_PULLUP);
pinMode(pin2, INPUT_PULLUP);
pinMode(pin4, INPUT_PULLUP);
pinMode(pin8, INPUT_PULLUP);
}
```
- ⤷
What is the difference between Real Code and Complement Code in rotary switches?
- ⤷ How do I calculate the output value based on the pin states?
- ⤷ Can this component be used in surface mount (SMD) applications?