Resistor Duplicator

Resistor Duplicator © GPL3+

This circuit allows for one thermistor input and will output up to four similar values using digital pots.

  • 838 views
  • 0 comments
  • 8 respects

Components and supplies

Apps and online services

About this project

I recently contracted to have a whole house humidifier installed. It requires an outdoor thermistor. Unfortunately, the installers could not run the wire to properly install a new one. Since there was one already installed at my AC unit for my fresh air intake damper, I began to look for a device to take that one input and supply two outputs to feed both the humidifier and air intake controllers. I didn't find one for that style of thermistor but found some in Italy that were for a different style thermistor and range for about $100.

I had previously worked with digipots for an interface to my hvac system controller so I started looking for one that would suffice over the useable range. The MCP42100 is a 100K digipot that is SPI. It has 256 steps so there is about 400 ohm resolution.

I had some 16x2 LCD's and I2C backpacks squirreled away so I used them to provide input and output resistance readout. To supply the output resistance readout value, I incorporated some jumpers (J1A-J1B and J2A-J2B) that would allow using one of the digipots to drive an analog input to the NANO.

Bear in mind, that with some software changes, you can connect the digipots in series or use different range digipots to change the range and resolution. For my project, I only needed to cover about 100K of resistance while the thermistor is capable of over 200K.

The wipers for these digipots are low current, so you must be careful as to how much load there is on them. That being said, I have driven LEDS with them although you might not think so by the specs. I incorporate SPI and I2C in this project without issue.

To be truthful, I did not end up using this circuit as I properly installed another thermister for the controllers in about two hours. However, I thought someone may find interest in this circuit.

Code

Resistor MultiplierArduino
For operating two MCP42100 digipots and an LCD
/*
This code used to control the digital 
 potentiometer MCP42100 connected to arduino board
 
 SCLK >>D13   
 DI >>> D11 
 CS >>> D10   chip IC2 
 SHDN >>D9
 RS >>> D8
 CS >>> D7   chip IC3
 input >>> A0
 output >>> A1
 SDA >>> A4
 SCL >>> A5
 
 */


#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SPI.h>
byte addressPot0 = 0b00010001; // last two bits 01 is Pot 0
byte addressPot1 = 0b00010010; // last two bits 10 is Pot 1
byte addressPot0and1 = 0b00010011; // last two bits 11 is Pot 0 and 1
byte CS1 = 10; //first chip select  
byte CS2 = 7;  //second chip select
byte SHDN = 9; //chip shutdown is pin 9 use 4700 ohm for pulldown
byte RS = 8;  //chip reset is pin 8 use 4700 ohm for pulldown
byte thermister = 0;  //thermister input on A0
byte reference = 1;  //second pot input for lcd

float PotRatio = 390.625; //100000/256
float Vout=0;
float Vin=1024;
float R1=9860;  //measured resistance value for input R3
float R2=9830;  //measured resistance value for output R4
float out1=0;
float out2=0;
int out3=0;
int out4=0;
float Voutb=0;
float out1b=0;
float out2b=0;
int out3b=0;
LiquidCrystal_I2C lcd(0x3F,16,2);  // for 16 x 2 

void setup()
{
  pinMode (CS1,OUTPUT);  //when high chip reads data
  pinMode (CS2,OUTPUT);  //when high chip reads data
  pinMode (SHDN, OUTPUT);  //when high chip reads data
  pinMode (RS,OUTPUT);  //when high chip reads data
  pinMode (thermister, INPUT);
  pinMode (reference, INPUT);
  digitalWrite (SHDN, HIGH);  //power up chip (high)
  digitalWrite (RS, HIGH);  //power on reset (low)

  SPI.begin();

  digitalPotWrite(245, addressPot0and1);
  digitalWrite(SHDN, LOW);  //power off
  digitalWrite(SHDN,HIGH);  //power on
  digitalPotWrite(245, addressPot0and1);
  digitalWrite(RS,LOW); //power on reset
  delay(100);
  digitalWrite(RS, HIGH);  //power reset
  delay (2000);

  lcd.init(); 

  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.print("INPUT");
  lcd.setCursor(0,1);
  lcd.print("OUTPUT");
}

void loop()
{
  //PotHighAndLow_mt(addressPot0);  // change values on pot 0
  //PotHighAndLow_mt(addressPot1);  // change values on pot 1
  PotHighAndLow_mt(addressPot0and1);  // change values on both pots
}

void PotHighAndLow_mt(byte address)
{
  Vout=analogRead(0);
  out1=(Vout/((Vin-Vout)/R1));
  out2=out1/PotRatio;
  out3=round(out2);
  out4=round(out1);
  digitalPotWrite(out3, address);
  delay(10);
  Voutb=analogRead(1);
  out1b=(Voutb/((Vin-Voutb)/R2));
}

int digitalPotWrite(byte value, byte address)
{
  digitalWrite(CS1, LOW);  //set chip IC2 active
  lcd.setCursor(7,0);
  lcd.print(out1);
  lcd.setCursor(7,1);
  lcd.print(out1b);
  SPI.transfer(address);
  SPI.transfer(value);
  delay(10);
  digitalWrite(CS1, HIGH);  //set chip IC2 inactive
  digitalWrite(CS2, LOW);  // set chip IC3 active
  SPI.transfer(address);
  SPI.transfer(value);
  delay(10);
  digitalWrite(CS2, HIGH);  //set chip IC3 inactive
}

Schematics

Resistor Multiplier
This is the scheme I used. Note that there are jumpers for using the LCD or the output. Connect jumpers for output value in readout.
Digipotscheme q9ln58vgx4

Comments

Similar projects you might like

Get Data from the Cloud to Your Arduino

by Jaume Miralles

  • 3,273 views
  • 4 comments
  • 22 respects

The Vibrating Pressure Temperature Altitude Tilt Detector

Project tutorial by Kutluhan Aktar

  • 1,658 views
  • 0 comments
  • 4 respects

Publish Your Arduino Data to the Cloud

by Jaume Miralles

  • 5,249 views
  • 10 comments
  • 44 respects

Home Plant Watering System

Project tutorial by Alexander

  • 15,191 views
  • 2 comments
  • 42 respects

Arduino Control AC Water Heater temperature

Project tutorial by Mohannad Rawashdeh

  • 9,039 views
  • 0 comments
  • 6 respects

High Precision Scale with Arduino

Project showcase by mPelectronic

  • 8,269 views
  • 13 comments
  • 35 respects
Add projectSign up / Login