Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Adafruit DS2413 1-Wire Two GPIO Controller Breakout: Examples, Pinouts, and Specs

Image of Adafruit DS2413 1-Wire Two GPIO Controller Breakout
Cirkit Designer LogoDesign with Adafruit DS2413 1-Wire Two GPIO Controller Breakout in Cirkit Designer

Introduction

The Adafruit DS2413 1-Wire Two GPIO Controller Breakout is a versatile module that enables control over two digital General Purpose Input/Output (GPIO) pins via the 1-Wire protocol. This protocol allows multiple DS2413 devices to be connected to a single data line for communication with a microcontroller, such as an Arduino UNO, which simplifies wiring in complex projects. Common applications include home automation, industrial control systems, and DIY projects where remote or numerous digital signals need to be managed.

Explore Projects Built with Adafruit DS2413 1-Wire Two GPIO Controller Breakout

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Raspberry Pi-Controlled Dual Servo Driver with PCA9685 Interface
Image of Copy of PWM, SERVO, ESC Wiring: A project utilizing Adafruit DS2413 1-Wire Two GPIO Controller Breakout in a practical application
This circuit controls two servomotors (MG996R and MG995) using a Raspberry Pi 5 and an Adafruit PCA9685 PWM Servo Breakout board. The Raspberry Pi communicates with the PCA9685 via I2C (using GPIO 2 and GPIO 3 for SDA and SCL, respectively) to send PWM signals to the servos. Power distribution is managed through an Adafruit Perma Proto Small Mint board, which connects the 5V and GND from the Raspberry Pi to the PCA9685 and the servos.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 and MCP23017-Based Smart Relay Control System with DHT22 Sensors
Image of Indoor Lounge: A project utilizing Adafruit DS2413 1-Wire Two GPIO Controller Breakout in a practical application
This circuit is a control system that uses an ESP32 microcontroller to manage multiple relays and read data from DHT22 temperature and humidity sensors. The DFRobot Gravity MCP23017 I2C module expands the GPIO capabilities of the ESP32, allowing it to control additional relays for switching high-power devices.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 5 Temperature Monitoring System with DS18B20 Sensor
Image of temperature sensor: A project utilizing Adafruit DS2413 1-Wire Two GPIO Controller Breakout in a practical application
This circuit interfaces a DS18B20 1-Wire Temperature Sensor with a Raspberry Pi 5. The sensor's data pin (DQ) is connected to GPIO 4 of the Raspberry Pi through a 220-ohm pull-up resistor, while the power (VDD) and ground (GND) pins are connected to the 3.3V and GND pins of the Raspberry Pi, respectively. This setup allows the Raspberry Pi to read temperature data from the sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 5-Controlled Multi-Servo System with Environmental Sensing
Image of cit: A project utilizing Adafruit DS2413 1-Wire Two GPIO Controller Breakout in a practical application
This circuit is designed to control multiple servos using two Adafruit PCA9685 PWM Servo Breakout boards, which are interfaced with a Raspberry Pi 5. The Raspberry Pi provides power and control signals to the PCA9685 boards, which in turn generate PWM signals to control the position of each servo. Additional sensors, including a DHT11 temperature and humidity sensor and an MKE-S01 ultrasonic distance sensor, are connected to the Raspberry Pi for environmental data acquisition.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit DS2413 1-Wire Two GPIO Controller Breakout

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Copy of PWM, SERVO, ESC Wiring: A project utilizing Adafruit DS2413 1-Wire Two GPIO Controller Breakout in a practical application
Raspberry Pi-Controlled Dual Servo Driver with PCA9685 Interface
This circuit controls two servomotors (MG996R and MG995) using a Raspberry Pi 5 and an Adafruit PCA9685 PWM Servo Breakout board. The Raspberry Pi communicates with the PCA9685 via I2C (using GPIO 2 and GPIO 3 for SDA and SCL, respectively) to send PWM signals to the servos. Power distribution is managed through an Adafruit Perma Proto Small Mint board, which connects the 5V and GND from the Raspberry Pi to the PCA9685 and the servos.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Indoor Lounge: A project utilizing Adafruit DS2413 1-Wire Two GPIO Controller Breakout in a practical application
ESP32 and MCP23017-Based Smart Relay Control System with DHT22 Sensors
This circuit is a control system that uses an ESP32 microcontroller to manage multiple relays and read data from DHT22 temperature and humidity sensors. The DFRobot Gravity MCP23017 I2C module expands the GPIO capabilities of the ESP32, allowing it to control additional relays for switching high-power devices.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of temperature sensor: A project utilizing Adafruit DS2413 1-Wire Two GPIO Controller Breakout in a practical application
Raspberry Pi 5 Temperature Monitoring System with DS18B20 Sensor
This circuit interfaces a DS18B20 1-Wire Temperature Sensor with a Raspberry Pi 5. The sensor's data pin (DQ) is connected to GPIO 4 of the Raspberry Pi through a 220-ohm pull-up resistor, while the power (VDD) and ground (GND) pins are connected to the 3.3V and GND pins of the Raspberry Pi, respectively. This setup allows the Raspberry Pi to read temperature data from the sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of cit: A project utilizing Adafruit DS2413 1-Wire Two GPIO Controller Breakout in a practical application
Raspberry Pi 5-Controlled Multi-Servo System with Environmental Sensing
This circuit is designed to control multiple servos using two Adafruit PCA9685 PWM Servo Breakout boards, which are interfaced with a Raspberry Pi 5. The Raspberry Pi provides power and control signals to the PCA9685 boards, which in turn generate PWM signals to control the position of each servo. Additional sensors, including a DHT11 temperature and humidity sensor and an MKE-S01 ultrasonic distance sensor, are connected to the Raspberry Pi for environmental data acquisition.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Key Features

  • Communication Protocol: 1-Wire
  • GPIO Channels: 2 independently controlled
  • Supply Voltage (VDD): 2.8V to 5.25V
  • Output Current: 20mA per channel (max)
  • Operating Temperature Range: -40°C to +85°C

Pin Configuration and Descriptions

Pin Number Name Description
1 GND Ground connection
2 VDD Supply voltage (2.8V to 5.25V)
3 DQ 1-Wire data line
4 PIOA GPIO channel A
5 PIOB GPIO channel B

Usage Instructions

Connecting to an Arduino UNO

  1. Power Connections:

    • Connect the VDD pin to the 5V output on the Arduino.
    • Connect the GND pin to one of the GND pins on the Arduino.
  2. Data Line Connection:

    • Connect the DQ pin to a digital I/O pin on the Arduino, for example, pin 2.
  3. External Components:

    • Connect external components such as LEDs or relays to PIOA and PIOB pins, ensuring they do not exceed the maximum current rating.

Programming the DS2413

To communicate with the DS2413 using an Arduino, you will need to use a 1-Wire library, such as the OneWire library, and possibly a DS2413-specific library for easier interaction.

Here is a simple example code to control an LED connected to PIOA:

#include <OneWire.h>

// OneWire DS2413 address (replace with your own)
uint8_t ds2413_address[] = { 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

// Instantiate a OneWire object
OneWire oneWire(2); // Pin 2 connected to DS2413 DQ

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, HIGH); // Turn on built-in LED to indicate setup is complete
}

void loop() {
  // Code to toggle PIOA would go here
  // This is a placeholder for actual DS2413 library code
}

Important Considerations and Best Practices

  • Ensure that the supply voltage does not exceed the maximum rating of 5.25V.
  • Use a pull-up resistor (typically 4.7kΩ) on the DQ line for reliable communication.
  • Avoid long wire runs to minimize signal degradation, or use a 1-Wire extender if necessary.
  • When controlling inductive loads like relays or motors, use appropriate flyback diodes to prevent back EMF damage.

Troubleshooting and FAQs

Common Issues

  • No response from the DS2413: Check connections, ensure proper power supply, and verify that the pull-up resistor is in place.
  • Intermittent communication: This can be caused by long wires or inadequate pull-up resistance. Shorten the wires or adjust the resistor value.

FAQs

Q: Can I connect multiple DS2413 modules to the same data line? A: Yes, the 1-Wire protocol is designed to handle multiple devices on the same bus. Each device has a unique address.

Q: How do I find the address of my DS2413 module? A: You can use a 1-Wire address finder sketch that searches the bus and prints out the addresses of all connected 1-Wire devices.

Q: What is the maximum distance for the 1-Wire bus? A: The maximum bus length depends on the environment and pull-up resistor value, but it is typically around 100 meters. For longer distances, consider using a 1-Wire extender.

For further assistance, consult the Adafruit DS2413 datasheet and the OneWire library documentation.