DS2413 1-Wire 2 GPIO drive relay

Hi there

I am studying on a project. There is a multicore cable 500meters or 300 like that. Every 25meters
I want to put a ds2413 and with this want to drive relays from the beginning of the cable
Lots of ds2413 with a relay.

as you see my very bad drawing. I want to Control relay position .
case 1 connect yellow-red
case 2 connect yellow - black
case 3 open circuit yellow black red open not connected.

How can I do that. and maybe I have to use 50 ds2413 on 1 - wire with adresses.
can 1 - wire protocol communicate 300-500meters.
How can I send commands to them. What should I use for host (command sender) arduino or what ?
And power? Should I add a battery all of these or I can suply their power on 1- wire
How can I program these ds2413 with my purpose.

Thank you .

Sorry but your schematic is meaningless because it doesn’t reference chip pin labels
as defined in the datasheet.
Also, it appears to be upside down.
Read the datasheet. A onewire device has a common GND bus.
Schematic convention is GNDs are at the BOTTOM, (NOT the top of the schematic)
In addition, the DS2413 is a dual switch and your schematic only shows one output.
Also, cascading switch outputs makes no sense. If a connection comes in the left
side of a device and goes out the right side, it is not connected as a bus.
The DS2413 would have an I/O bus with all devices tied to the IO pin and all GNDs
tied to together, and two outputs from each dual switch. In that context , your
schematic makes no sense. Also, the chip appears to be a dual current sink, in that
it connects the switch output to GND. (SEE DATASHEET) You need to keep this in mind when wiring it.
Please label the pins and the bus lines.

Start with the data sheet, it answers many questions.

Look for app notes, I found easily a Maxim page on how much distance is possible and various arrangements for achieving it are handled.

Google and you’ll turn up an Arduino library for 1-wire devices, this might make it easy to do w/o a full understanding of every little technical issue as far as the code goes.

At a glance the challenge will be getting this working over the distances you want.

The local circuit seems trivial, a relay module or a plain relay and a transistor circuit to take the logic signal from the DS2413 and drive the relay coil.

Cool part, BTW. I only tuned in here for a look because I thought that was an RTC which had me wondering.



First question is what are the specifications for your relay?

From you post you could have as many as 20 relays.

What size (i.e. gauge) wire is your multicore?

The DS2413 is only specified for a load of 20 ma.


I think that’s why @alto777 hinted at local circuitry that would be a relay module requiring only a logic signal or a transistor as a logic driven switch to handle the relay current.


This is really makes me happy to see lots of helpful people. Thank you

Okay. I will prepare for your questions.

I make Better drawing better explainining.

Thank you

Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".

To add code please click this link;

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom..... :grinning: :+1: :coffee: :australia:

Hi there again. Thank you all…

I am a Geophysicist. I am doing researc for metals. Name of the method we use is “Resistivity” How measure resistivity.

We apply current from certain points to the ground with a transmitter.

Then We measure milivolt (potential difference) on certain points.

We use iron sticks to connect cables to ground surface.
Current sticks calling “C”
Potential difference measuring sticks is E1, E2 …

When we apply a current on C1 and C2 at first point.
We measeure mV from E1 and E2
Then while current cotinues to apply to ground
we change E1 -E2 to E2,E3 and measure measure again.

You know Potential difference measuring needs to pole possitive ,negative or E1,E2 or like that.

We have a lot of potentiel difference stick on the ground.

But we have two cable on receiver to measure.

we want When finish E1 and E2 measurements. then cable went to E1 go to E3. so I have new couple E2-E3

Then when we finish E2-E3. E2 connection cut and cable goes E4

You see in picture. There are nodes here. This nodes where put ds2413 and relay circuit. This nodes needs to control by me from receiver side with a pc program. Pc side later. Now We need solve how We can switch this nodes ?

Poledple 300px-Poledipole

There is not any circuit desing. I dont kcow How I start maybe I would know How ds2413 works. Then I can make a circuit diagram. I cant understand this module.

I think I see what you are trying to do.

Wouldn’t running through all those relays affect your measurements?

But the DS2413 is easy enough, google

arduino ds2413

like I just did and poke around, plenty of tutorials and examples.


Below is a simplified diagram of the DS2413-1


Features / details:

  1. Power is “stolen” from the IO (when receiving data).
  2. The command is 64 bits. 48 of those bits are address.
  3. Every DS2413 has a different address.
  4. The outputs act like switches to ground.
  5. You can create a command to:
  • Close 1
  • Close 2
  • Close 1 and 2
  • Open 1
  • etc

It is possible to supply power to the device by using sending power to one of the outputs (while the output is open). I would recommend this in your case.


Just a thought before you go too far. At mVolt ranges and µVolt resolution you are going to need a lot of analog filtering (purely digital will not work) and lightning protection for any lighting strikes within a kilometer or two of you test.

If you haven’t already, I suggest you perform a single measurement or a few a close range and far range to see if this approach will provide the required data.

Are there commercial versions of what you are building?

With 0.01mV, that is 10uV, sensitivity you will need some very serious shielded cabling to keep noise to a minimum.
Even the signal data you send to the nodes to operate the remote relays could cause interference.

Tom… :grinning: :+1: :coffee: :australia:

Thank you All answers.

İ will try a prototype and will wrote here results. Maybe we use rs485.

The topic can close :slight_smile:

Yes there are a lot of commercial versions but most know “Agi Supersting r8” but it has a so thick and heavy cable there is no node switch. It has a switch box on the head.

and this device also gives current in this cable. I cant undarstand how does not effect signal like this.

unnamed 300x300-AGI 112 Switch Box asasdsd


The cable is probably double shielded, plus heavy insulation to make it rugged in the field.
This is not the job for cheap cables.

Tom… :grinning: :+1: :coffee: :australia:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.