EEVblog Electronics Community Forum

Electronics => Microcontrollers => Topic started by: m.m.m on September 30, 2013, 03:09:03 pm

Title: DIY MCU controlled decade resistance box
Post by: m.m.m on September 30, 2013, 03:09:03 pm
hi everybody, I thought it would be awesome if we can make a decade resistance box using microcontrollers, it could be controlled over usb, and also a simple keyboard connected to it, I don't ask for the software, but my question is about how can I make the switches between the resistors? should I use relays? is there any way for making it using op amps? sorry if I posted it in wrong category.  :-//
Title: Re: DIY MCU controlled decade resistance box
Post by: ve7xen on October 02, 2013, 05:07:18 am
Relays are the only sensible way I can think of. Analog switches will have too much resistance on the low ranges. If you did use analog switches you might be able to estimate the total resistance of the switches and compensate for it, but it will substantially reduce your accuracy and tempco on the low ranges.

Resistance boxes are supposed to be passive. You could probably design something that's not a resistance box but behaves like a controlled resistance, but it would have many additional limitations on bandwidth, input voltage, would need a power supply of its own, and could also oscillate with whatever circuit is on the input.
Title: Re: DIY MCU controlled decade resistance box
Post by: mariush on October 02, 2013, 02:34:23 pm
Might be cheaper to use a sort of stepper motor and some rotary mechanism like on multimeters perhaps....
Title: Re: DIY MCU controlled decade resistance box
Post by: alanb on October 02, 2013, 06:20:12 pm
Have you considered using binary steps rather than decimal, it will require significantly less resistors and switches. You can convert from the decimal / dedcade values to binary in your microcontroller software.

Title: Re: DIY MCU controlled decade resistance box
Post by: jbe on October 07, 2013, 09:54:01 am
I'm currently working on the design of a passive audio pre"amplifier", which is basically a configurable voltage-divider.

I've built one very promising prototype so far. The divider-design is somewhat similar to this very nice project http://www.vaneijndhoven.net/jos/relaixed2/ (http://www.vaneijndhoven.net/jos/relaixed2/) (all the documentation including schematics are online)

The one i build is a 8-stage logarithmic divider, configured by relais. I used an uln2803 as driver, controlled by a simple 74hc595 8bit shift register. In my next design iteration i consider moving away from the shift-resister, to either a small mcu or an i2c gpio-chip.

If you are interested i could post some schematics and/or layouts of my prototype.

Hope this helps.
Title: Re: DIY MCU controlled decade resistance box
Post by: dannyf on October 07, 2013, 11:11:14 am
Not sure how you could implement it via opamps.

If it is all DC, you may be able to implement it via mosfets.

Otherwise, relays controlled by mcus + lcd + rotary encoders would be the way to go.
Title: Re: DIY MCU controlled decade resistance box
Post by: andtfoot on October 07, 2013, 11:21:13 am
I wonder how viable it would be to use motorised pot(s), maybe with some kind or measuring circuit hanging off the second pole for self calibration.
Something like this:
http://au.mouser.com/ProductDetail/Bourns/PRM162-K420K-103B1/?qs=sGAEpiMZZMtC25l1F4XBUzdugALayiIk5Z3Iirm62DU%3d (http://au.mouser.com/ProductDetail/Bourns/PRM162-K420K-103B1/?qs=sGAEpiMZZMtC25l1F4XBUzdugALayiIk5Z3Iirm62DU%3d)
Title: Re: DIY MCU controlled decade resistance box
Post by: m.m.m on October 11, 2013, 01:36:03 pm
Have you considered using binary steps rather than decimal, it will require significantly less resistors and switches. You can convert from the decimal / dedcade values to binary in your microcontroller software.
you mean the first resistor 1k, second 2k, third 4k, etc for example? just like dave explained it on a previous video? It also needs a kind of switch or relay to short the resistors by parallel. I guess using this way costs less than using stepper motors and rotary switches and is more accurate.
Title: Re: DIY MCU controlled decade resistance box
Post by: Jeroen3 on October 13, 2013, 11:15:45 pm
Why not take a look at some load generators or dummy loads.
In short these are some kind of controlled power resistors.

And you can use some high-side n-mosfets for your purpose.
Title: Re: DIY MCU controlled decade resistance box
Post by: dannyf on October 14, 2013, 12:24:02 am
Quote
Why not take a look at some load generators or dummy loads.

Their behaviors in a circuit, particularly ac circuit, can be quite difficult to describe / predict.
Title: Re: DIY MCU controlled decade resistance box
Post by: geraldjhg on October 14, 2013, 03:55:22 pm
hi
u could use relays and resistor values power of 2 based
it would be fun but slow

try a digital potentiometers from intersil
in digikey
Title: Re: DIY MCU controlled decade resistance box
Post by: m.m.m on October 25, 2013, 10:42:08 am
thanks a lot, but I don't like potentiometers (they're not accurate, and need cleaning, and can't handle much current, etc) and I don't have access to digikey, mouser, etc in my region  :palm: I just found a transistor optocoupler in my junk box  :) I didn't know what a optocoupler is before today, now I have a brief knowledge about it after reading this (http://www.electronics-tutorials.ws/blog/optocoupler.html), can I use these in this application? thanks a lot.
Title: Re: DIY MCU controlled decade resistance box
Post by: macboy on October 25, 2013, 02:00:35 pm
I would also use a binary arrangement as already suggested. Decade is useful when using manual switches. We "think" in decimal numbers, so making the switches that way is logical. But when you add a microcontroller between you and the resistors, then there is no longer any need to use a decade arrangement. Now you can use a power-of-two arrangement (like a R2R DAC, google it and study it) and have the micro convert between the decimal number that was input by the user, and the binary arrangement of the switches. You will end up with fewer resistors and switch poles this way.

You could use relays for the switches, or power MOSFETs. Either one will have roughly a few tens of milliohms of resistance when On. Solid State relays are also an option, but probably more expensive. Mechanical relays work well if you don't need extremely fast switching times or a lifetime or millions of switch cycles.

Nobody has addressed your requirement for the device to be controlled over USB. I personally think that the easiest way to do this would be to use a small cheap USB-to-serial (TTL level) converter which can be had for less than $2 on eBay, etc. Connect that to the UART of the microcontroller. Receiving and sending bytes from the UART is at least an order of magnitude easier than USB, both in terms of effort, code size, and code speed. Let the USB-serial converter do that work, that's what it's made for. Then you just need to come up with a simple command protocol, and send those commands as strings to the device over the serial port.
Title: Re: DIY MCU controlled decade resistance box
Post by: rudika79 on November 01, 2013, 06:38:28 pm
Hi,

Here is one quick sketch how I will implement MCU controlled resistor decade box with relays. The schematic showing just one decade.
You can see one picture off resistor network on Vishay web site http://www.vishaypg.com/foil-resistors/case-studies/study/Meatest_1/ (http://www.vishaypg.com/foil-resistors/case-studies/study/Meatest_1/)

Rudolf
Title: Re: DIY MCU controlled decade resistance box
Post by: N TYPE on November 04, 2013, 11:50:48 am
Guilding . The . Lily .
Title: Re: DIY MCU controlled decade resistance box
Post by: casinada on November 06, 2013, 07:13:32 am
Watch Dave's Last video of the Fluke 5450 Rasistance calibrator. You can also look at the schematics. Plenty of resistors and relays :)