

The Adafruit DS2413 1-Wire Two GPIO Controller Breakout (Part ID: 1551) is a compact and versatile breakout board featuring the DS2413 chip. This component provides two general-purpose input/output (GPIO) pins that communicate using the 1-Wire protocol. The 1-Wire interface allows for simple communication with microcontrollers using only a single data line, making it ideal for projects where pin availability is limited.








The Adafruit DS2413 breakout board is designed for ease of use and integration. Below are the key technical details:
| Parameter | Value |
|---|---|
| Communication Protocol | 1-Wire |
| GPIO Pins | 2 (individually configurable as input/output) |
| Operating Voltage | 3.3V to 5.5V |
| Maximum Sink Current | 20mA per GPIO pin |
| Operating Temperature | -40°C to +85°C |
| Dimensions | 20mm x 18mm x 2mm |
The breakout board has four main pins for connection:
| Pin Name | Description |
|---|---|
| VIN | Power input (3.3V to 5.5V) |
| GND | Ground connection |
| DQ | 1-Wire data line for communication |
| IOA/IOB | GPIO pins (IOA and IOB) for controlling or reading external devices |
The Adafruit DS2413 breakout board is straightforward to use in a circuit. Below are the steps and considerations for integrating it into your project.
VIN pin to a 3.3V or 5V power source and the GND pin to ground.DQ pin to the microcontroller's 1-Wire data pin. A pull-up resistor (typically 4.7kΩ) is required on the data line.IOA and IOB) as inputs or outputs.DQ line to ensure proper communication.VIN and GND to stabilize the power supply.Below is an example of how to use the Adafruit DS2413 breakout board with an Arduino UNO. This code demonstrates how to toggle the GPIO pins.
#include <OneWire.h>
#include <DS2413.h>
// Define the 1-Wire data pin
#define ONE_WIRE_BUS 2
// Initialize the OneWire and DS2413 objects
OneWire oneWire(ONE_WIRE_BUS);
DS2413 ds2413(&oneWire);
void setup() {
Serial.begin(9600);
Serial.println("Adafruit DS2413 Example");
// Search for the DS2413 device
if (!ds2413.begin()) {
Serial.println("No DS2413 device found!");
while (1); // Halt if no device is found
}
Serial.println("DS2413 device found!");
}
void loop() {
// Set GPIO A high and GPIO B low
if (ds2413.write(DS2413::PINS::IOA_HIGH | DS2413::PINS::IOB_LOW)) {
Serial.println("GPIO A: HIGH, GPIO B: LOW");
} else {
Serial.println("Failed to write to DS2413");
}
delay(1000);
// Set GPIO A low and GPIO B high
if (ds2413.write(DS2413::PINS::IOA_LOW | DS2413::PINS::IOB_HIGH)) {
Serial.println("GPIO A: LOW, GPIO B: HIGH");
} else {
Serial.println("Failed to write to DS2413");
}
delay(1000);
}
Device Not Detected
DQ pin is connected to the correct microcontroller pin.DQ line.GPIO Pins Not Responding
Unstable Communication
VIN and GND.Q: Can I use multiple DS2413 devices on the same 1-Wire bus?
A: Yes, each DS2413 chip has a unique 64-bit ROM address, allowing multiple devices to coexist on the same bus.
Q: What is the maximum cable length for the 1-Wire bus?
A: The maximum cable length depends on factors like wire type and pull-up resistor value. Typically, lengths up to 30 meters are achievable with proper wiring.
Q: Can the GPIO pins source current?
A: No, the GPIO pins can only sink current (up to 20mA). Use external pull-up resistors if sourcing current is required.