I've seen Dallas' 1-wire sensors, they look great. But, I'd like to make some custom 1-wire slaves which can be parasitically powered (just ground + data).

Can anyone recommend a low power microcontroller which is suitable for this?

Does anyone have a sample circuit for how I would power an MCU from the 1-wire bus?

  • \$\begingroup\$ Java buttons. they exist. TI did it. Java Card IIRC \$\endgroup\$ – Tim Williscroft Nov 30 '10 at 9:46
  • \$\begingroup\$ To follow up and enhance the question - what about power on reset of MCU? How this is addressed? (For sensors specifically designed for 1-wire this should be handled by the device itself as it is prepared for it). Should MCU be equipped with brownout detection? Is this enough? \$\endgroup\$ – mazurnification Nov 30 '10 at 11:31
  • \$\begingroup\$ @macurnification - that sounds like a new question to me \$\endgroup\$ – Toby Jaffey Nov 30 '10 at 11:58
  • \$\begingroup\$ asked:electronics.stackexchange.com/questions/7323 \$\endgroup\$ – mazurnification Nov 30 '10 at 15:42

The one wire bus has the bus passively (i.e. with a resistor) pulled up in the system, and devices communicate on the bus by pulling the bus down. What I would do if I wanted to pull power from the bus is:

  1. Feed the data line right into the data input pin of your microcontroller.
  2. Also feed the data line into a Schottky diode.
  3. At the output of the diode put a largish (say 10uF) capacitor to ground.
  4. Send the output of the diode to the VCC pin of your microcontroller.

You should use a Schottky diode, to minimize the voltage drop. The diode/capacitor combination should make it so that communication can take place (i.e. grounding the bus periodically) without shutting down the MCU. Putting the capacitor after the diode will keep the transitions on the bus data sharp, while keeping the decay of power (voltage) to your MCU gradual. The lower power the device you use is the better to minimize drain on your capacitor, but pretty much any MCU will probably work for you. My preference is Atmel's AVRs, but TI MSP430s and Microchip's PICs are also good candidates for low power consumption.

  • 9
    \$\begingroup\$ +1 on the TI MSP430s. I think they win the lowest power consumption contest. \$\endgroup\$ – pingswept Jun 23 '10 at 15:25
  • 8
    \$\begingroup\$ I'm sure you could power one off a few potatoes :) \$\endgroup\$ – Jim Jun 23 '10 at 15:39
  • 2
    \$\begingroup\$ What do you mean by "buffer"? Normally you would use a diode, preferably a Schottky diode for its low voltage drop. \$\endgroup\$ – starblue Jun 24 '10 at 8:42
  • 2
    \$\begingroup\$ @starblue a buffer is an electrical component that typically is used increase drive strength and providing a low-impedence output while "passing through" the input signal. It has the effect of effectively isolating its input from its output, while making the output "follow" the input. There are many ways of implementing it (an op-amp is one way; two CMOS inverters in series is another way), but you can also find them as discrete components or ICs. \$\endgroup\$ – vicatcu Jun 25 '10 at 17:47
  • 1
    \$\begingroup\$ @vicatcu I think starblue knows what a logic buffer is - Just a non-inverting amplifier. He might have been wondering if you were referring to something different. You're forgetting that the input bias current to a buffer is on the order of nano- or micro-amps, and that this current is shunted to ground rather than to your capacitor. A conventional buffer (like the CD4010) won't work without power and ground. As your answer was selected, please edit it to reflect this fact. \$\endgroup\$ – Kevin Vermeer Jun 25 '10 at 19:24

You might consider adding a request to your custom slave's functions to say "OK, I'm going to need a lot of current for a little while here", and add a MOSFET pullup to your output. Then, you could turn this off for a few cycles, and see if the slave is still allowing the line to be resistively pulled up (like on p.3 figure 2 of the DS18S20 datasheet.) A lot of 1-wire devices aren't really 1-wire. If you don't need to interact with actual 1-wire parts and/or you control the master node, you can define your own specs and this should make things much easier.

Your job is made easier because your micro can probably handle between the 5V of the bus and decay all the way to ~2.6. Therefore, the aforementioned Schottky and capacitor setup should work, or even a silicon diode. Consider the following diode setups:

  • Silicon diode: This would be my first choice. As long as your micro and any peripherials can run at 4.3V, you will minimize your reverse current from tens to hundreds (and even up into mA when warm) on a Schottky down to tens of nano-amps
  • Schottky diode: Use only if the .4V between the standard diode and Schottky is significant for your application, but reverse current on the order of 100uA is acceptable.
  • Ideal diode: Try the LTC4411 or similar if cost is not an issue (Only $1.75, but more than a passive diode) and 20uA reverse current is acceptable. Refer to the MSP430 datasheet for power consumption. At 3V (Using a Li-ion battery rather than a leaky supercap, assuming that you might want to remove this device but retain RAM for lower power code execution), you can have a 100na (nano-amp, .1uA) hibernate mode requiring an external interrupt (like a pin change!)

The other option is to be miserly in power requirements, and use a battery. See this app note from Maxim. If you can keep your MSP430 in sleep mode (i.e., only wake on a pin change, like a 1-wire initialization pulse), you can average less than 1uA and a coin cell will last you for ten years (In theory.) How long do you want the device to last?

  • \$\begingroup\$ Will Ideal Diode be fast enough to turn off when transmitting data? \$\endgroup\$ – mazurnification Nov 30 '10 at 12:22

Use a capacitor to store the energy, and connect the negative end of the capacitor to ground, and connect a Schottky diode between the data line and the capacitor. Schottky diodes have a low forward drop.


The TI MSP430 was mentioned and I concur. I've used the MSP430F1101 running at a 32.768kHz crystal and powered from 3V which consumed less than 4\$\mu\$A. At 2.2V it would even be less.

To power the microcontroller from the bus you only need a diode and a capacitor. The capacitor buffers the bus voltage, and the diode prevents a low level on the bus from discharging the capacitor. Choose a Schottky diode to have a minimum voltage drop.

Warning: dirty trick ahead!
This gal doesn't need the diode to parasitically power her microcontroller, and even the capacitor doesn't seem to be required. She uses a coil as RFID antenna on an I/O port, and the voltage across the coil powers the device through the clamping diodes.

enter image description here

I/O pins on logic ICs, including microcontrollers, have clamping diodes to protect them against overvoltage. If the input voltage is higher than \$V_{DD}\$ + 0.5V the power clamp diode will conduct and the overvoltage will be taken down to \$V_{DD}\$. Beth abuses the diode to power the controller from the I/O's high input level. And apparently her controller even keeps working without the capacitor. (On another prototype she did use capacitors for stability.)

  • \$\begingroup\$ Woe betide ...! If Russel or Olin see that clamp diode abuse... :-) \$\endgroup\$ – Curd Apr 27 '12 at 10:42
  • 1
    \$\begingroup\$ @Curd - Russell or Olin? How do you think I felt when I saw this for the first time?! :-) \$\endgroup\$ – stevenvh Apr 29 '12 at 9:49

Many of the 1-wire app notes show the standard circuit inside the slave: a capacitor between GND and VCC of the internal chip (in your case, between GND and VCC of your CPU). Also, a blocking diode from the data line to VCC of the internal chip, to allow the capacitor to fill up when the data line is high, but to block power from draining from the capacitor when the data line is brought low. Check out the schematic in these app notes:

As long as your capacitor is big enough, you should be able to run most modern microcontrollers. The Texas Instruments MSP430 was the lowest-power micro when it was introduced. I hear that Atmel claims their PicoPower AVRs use less power than the MSP430. Also the Microchip XLP micros use relatively little power.

You may be surprised to see what the nice people at 1wire.org have to say about building slave 1 wire devices: http://www.1wire.org/index.html?target=p_142.html&lang=en-us

  • \$\begingroup\$ I guess I'd better avoid the phrase "1-wire" then... \$\endgroup\$ – Toby Jaffey Jun 27 '10 at 19:22
  • \$\begingroup\$ Curiously, what that 1wire.org page says is "Do NOT change this page. It is NOT visible to customers." I guess I'm not a customer. At a guess, "shopfactory" do not know what happens if their javascript does not run. \$\endgroup\$ – Yann Vernier Nov 30 '10 at 9:54


Just stumbled on this thread...The real question is why you want to parasitically power your slave. Not all 1-wire devices are parasitic devices, and in general I recommend against powering them this way. Its a hold over from the need for devices on PCB's where the addition of a single trace was an issue. It can be the cause of several issues on a 1-Wire network depending on its overall design. Of course a lot depends on the bus master designs too. which may support active pull-ups.

Microprocessor 1-Wire slaves have been successfully done but you do need to meet the general 1-Wire timing specs. which most implementations I've seen do not (especially if this is for anything besides personal use). I'd be glad to talk about actual details with anyone. Its been done successfully on a 16Mhz AVR Mega8 with proper device specs. Meeting the critical response times with something slower would be a real challenge and interrupt service times and wakeups generally will slow the response time down too much to meet specs.

There are several different ways to put a micro on the 1-Wire bus that have been done over the past several years and 1-Wire micro slaves is a special interest area for me so I can give several design ideas to anyone interested. Opcodes (functions) should never be designed adhoc as it can easily cause trouble with other 1-Wire devices on a network.

Sorry about the 1-Wire.org web site, I've just kept it up out of my own pocket for the last few years so people had a starting point for their efforts with 1-Wire.

Anyway if anyone needs about 1-wire design issues feel free to contact me directly at dml (at) sprynet.com or thru admin@1wire.org and I'll try to help if I can.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.