Digital to Resistance Converter, is it a thing? How to design one? - Page 1
Forum section: electronics / projects

author: ellipse
author_rank: Newbie
timestamp: November 09, 2023, 11:04:00 am
content: We all know DAC for converting from digits to volts; is there a circuit forconverting from digits to ohms?I mean, let's say the microcontroller says "1523 ohms" and the circuit magically bahaves like a 1523 resistor to whaterver connects to it (well, within reason)I need it to replace some old resistive sensors that are no longer manufactured.Being a digital guy, the idea is to use an up-to-date sensor, reading it with a microcontroller, using a look-up table, and emulating the matching resistance of the old sensor so that it can be used as a replacement in old equipment.I know there are current mirrors and virtual capacitors circuits made out of op amps, so I expect that voltage-to-resistance circuits can be possible, but I wasn't lucky googling it, nor can I help for myself.Old sensors range is from 600 ohm to 2 or 20 kiloohm, they are connected to equipment whose input stages are powered from 5 volts max and currents below 1 mA.Any circuit, hint, pointers?

author: ch_scr
author_rank: Frequent Contributor
timestamp: November 09, 2023, 11:10:47 am
content: What you want is called a "digital potentiometer"

author: harerod
author_rank: Frequent Contributor
timestamp: November 09, 2023, 05:55:23 pm
content: Digital Potentiometers for low resolution - or you could have a look at "multiplying DAC's"...

author: TimFox
author_rank: Super Contributor
timestamp: November 09, 2023, 09:36:22 pm
content: The literal meaning of "potentiometer" is a voltage divider, such as a three-terminal variable resistor, while a "rheostat" is a two-terminal variable resistor.Most "digital pots" are potentiometers, used to control a voltage or voltage gain.One way to make a digitally-controlled resistor is to use a binary sequence of resistors inserted/removed from the circuit by relays or analog-switch ICs.The tricky bit is at low resistance, to compensate for the relay/switch resistances.Decade resistance boxes work this way, where each manual switch switches four resistors in a BCD decade (1-2-4-8 or 1-2-4-4).

author: PCB.Wiz
author_rank: Super Contributor
timestamp: November 09, 2023, 10:57:25 pm
content: Quote from: ellipse on November 09, 2023, 11:04:00 amYou need to measure the part in circuit.Likely are simple resistor feed (eg 2.5K in host gives 50% ADC with 2.5K sensor value), or a 1mA current source, which gives 2.5V with 2.5k, 1.0V with 1k etcDigital potsmaydo the job, but they need to be accurate and low drift, and those only come in a few values.(many are ratiometric only, with poor tolerances in resistance mode)eg perhaps 20 kΩ better one from ADI, which gives 10ohm steps, is enough ?AD5272 1024-Position, 1% Resistor Tolerance Error, Single Channel I2C Interface and 50-TP Memory Digital Rheostat 20 kΩ, 50 kΩ, 100 kΩ nominal resistanceOr you can use a MCU with a DAC, and provide a voltage that the host is fooled into thinking is derived via a resistance.That only works if the host is known and consistent.

author: Terry Bites
author_rank: Super Contributor
timestamp: November 10, 2023, 01:24:13 pm
content: Synthesise a resistance?Check this out:www.edn.com/multiplying-dac-makes-programmable-resistoredn circuit ideas are always worth a read (unless your brain has been corrupted by arduino's).

author: tooki
author_rank: Super Contributor
timestamp: November 10, 2023, 02:31:53 pm
content: Quote from: Terry Bites on November 10, 2023, 01:24:13 pmYou could have provided that very interesting link without the judgmental snipe. Arduino is simply MCU programming using C, with a nicely set up toolchain that lowers the barrier to entry. It’s not that different from the HAL libraries the MCU manufacturers themselves produce.

author: coppercone2
author_rank: Super Contributor
timestamp: November 10, 2023, 02:38:14 pm
content: a jfet

author: CaptDon
author_rank: Super Contributor
timestamp: November 10, 2023, 02:51:13 pm
content: Many styles of DAC's are simply R2R ladders. What you don't get is isolation from the binary input side to the R2R output side in the event you were wanting to digitally program a 'plate resistor' for a vacuum tube with perhaps 250vdc on the high side of your resistor. You would in some cases need a 'digital isolator' in a package which are available to go between your DAC inputs and your perhaps ground referenced computer which will be driving the DAC inputs through the isolator. Then the R2R DAC along with its now required isolated power supply could safely be referenced to any reasonable voltage perhaps that voltage even being A.C.! We do a similar circuit which controls individual cell charge balance on a high voltage multi-cell battery stack by providing a leakage resistance across the fully charged cells while waiting for the lesser charged cells to 'catch up' during the charging event. We even do sort of the same thing in reverse allowing us to read the voltage of the individual cells through ADC's and isolators. Complicated, yes, but it works!!

author: macboy
author_rank: Super Contributor
timestamp: November 10, 2023, 03:09:05 pm
content: Quote from: TimFox on November 09, 2023, 09:36:22 pmThe digital pots I have worked with will literally connect the wiper to any point on a resistive string using an array of CMOS switches. It acts like a pot. If you choose to only use the wiper and one end terminal, then it is a variable resistor or rheostat. One of the limitations is that the voltage at all three terminals must remain within the power supply rails, and that might be just 0 to 5 V. Another limitation is resolution, you will rarely find more than 8 bits resolution due to the number of resistors and CMOS switches involved; 2^N are needed, unlike a DAC where only N are needed. An example of a device I've used is the Microchip MCP41XXX (MCP41050). The datasheet specifies both modes of operation: pot and rheostat.Other solutions to digitally controlled variable resistance are a relay-switched resistor bank, or a servo motor controlled pot. Sometimes a dual or multi gang pot is used, with one of the gangs used as the servo motor controller feedback. The latter is one of the only ways to provide an isolated, continuous, glitch-free variable resistance.

author: TimFox
author_rank: Super Contributor
timestamp: November 10, 2023, 04:52:09 pm
content: Looking at the datasheet for the MCP41050: it does, indeed, have rheostat and potentiometer modes.Look carefully at the rheostat mode specs to see if it fits your application (looking at 10 k\$\Omega\$ version with 5 V power):The nominal resistance is 10 k\$\Omega\$ +/- 20%. This range needs to be calibrated out for the user, but cancels out in potentiometer mode.The tempco for rheostat is typ 800 ppm/K, which cancels out for potentiometer mode to typ 1 ppm/K.The linearity (compared to a straight line through the actual endpoints) is good: +/- 1 LSB.The "wiper" resistance (minimum rheostat resistance) is max 100\$\Omega\$..The voltage limits on the two ends of the rheostat from the Vss pin are -0.6 V to +6 V (with 5 V power).The rated current through the rheostat resistance is +/- 1 mA.https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/11195c.pdf