# Measuring thousands of sensors using a single board

#### NorthGuy

Joined Jun 28, 2014
611
If it is a resistive matrix, you can connect a set of wires to rows from one and and another set of wires to cross-row from the other end. 256 wires from one end, and 256 wires from other end will let you measure 65536 resistor points. 512 wires is quite manageable. All you need is to connect ground to exactly one wire from one end and positive voltage to exactly one wire at the other end. This will push all the current through only one resistor and you can measure it. If you can control capacitance, it may be feasible.

#### NorthGuy

Joined Jun 28, 2014
611
We need context.

Very, very confusing.
He's afraid we steal his idea.

#### BR-549

Joined Sep 22, 2013
4,938
When someone is that unclear on the setup, it's a false setup.

Instead of resistors, it's probably sensors with a resistive output.

And because we can't get the real setup, the solutions will not work.

Edit: for all we know, it could be a simulation.

#### rhydo

Joined Jul 5, 2016
14
rhydo, I have read this thread several times, and still haven't a clue as to what you are asking.

Are you sorting resistors? If so, how do they come? Are they on tape?

How are you matching the measurement to the individual resistor?

Use 1 resistor as an example. From the start to the finish. What has to be done?

We need context.

Very, very confusing.

I have tried to simplify this several times. I will try again with a single resistor as an example.

- I have to repeatedly measure a resistance value.

- I have a single resistor that is not soldered, this means it can be connected to the circuit with alligator clips and similarly removed.

- I am passing current through it at a set voltage and calculating the resistance through the analog input of a microcontroller.

- Once this resistance value is obtained, I compare it to a finite range of acceptable values within my code using if -then statements.

- If the measured value lies within this set range, the code declares - 'alright, nothing to worry about, the resistance is connected to the circuit'

- On the contrary, if I measure infinite resistance (or any value outside the preset range) the code declares - 'ok the resistance is missing/ this is the wrong resistance'

THIS is literally it. I shouldn't have talked about arduino and voltage dividers and all. I realise that was superfluous information. I am not doing anything as complex as sorting values. In the simplest terms I am just measuring resistance values and and generating 2 bits of data as in 1 meaning 'resistance present' and 0 meaning 'resistance absent'.

This is not something that experienced embedded engineers would have any problems with. I just need some guidance on what hardware to look into in order to do this exact thing sequentially on 200 resistors (50,000 is impossible, I get that).

Edit - I am not afraid that someone will steal my ideas. As you guys already mentioned, it is physically impossible to do what I was planning on doing.

Also this is not a simulation.

I am not very experienced with electronics on a large scale. I can build and design circuits and code them on a basic level but I do not know what type of hardware professionals prefer when they have to scale their set up to measure sensors that are more in number than the available number of analog inputs of most generic microcontroller boards that I know.

Last edited:

#### John P

Joined Oct 14, 2008
1,910
As far as I can read from the descriptions given, there has been no definitive statement about how many resistors are present at once. Just one? Or potentially a full complement (256 for a 16x16 matrix, or 50000 for a full system). I'd be confident that a matrix setup could work for 16x16, but any larger and the non-ideal features of the circuit might start having an effect. However, if you're sure that only one resistor is going to be in the circuit at a time, there's not much limit to how large the matrix can be.

NorthGuy, if it's a full matrix I believe it can't be as simple as you say. Consider that every crosspoint is resistive, so there are a very large number of paths through the matrix from a given row to a given column. As I said, I figured this out a while ago (like 35 years!) and I thought I'd done a good day's work.

#### BR-549

Joined Sep 22, 2013
4,938
Ok. Let's see if I have this.

You want a two terminal device, that you can put a resistor across. The hardware device will measure the resistance, check the tolerance, then indicate good or bad resistance. With a one bit output.

And you want to do this 50,000 times. Is this correct?

If this is correct, the solution depends on a many more details.

What is your tolerance? In other words, how accurate do you need to be?

What is the task duration? In other words, how fast do you have to do it?

What is your knowledge? What equipment are you familiar with? And what is your budget?

There is more than one strategy. The details matter. For instance, how fast you can change out the test resistor, will help determine the hardware. Or if you want to measure 5, 10 or 20 at the same time will change the hardware.

There are more than a thousand hardware solutions. Do you want to hear all of them?

#### NorthGuy

Joined Jun 28, 2014
611
The description in post #44 and earlier ones suggest that you can use one pair of alligator clips to consecutively measure any number of resistors (given enough time and workforce). As you describe it, it would be crazy to use more than one. For example, I have one DMM and I can make 100 measurements every day. I wouldn't want to use 100 DMMs for that, let alone unite all these DMMs into a single device. So, apparently, what you want is different. You need to explain why can't you use just one pair of alligator clips, as this seems to be the best solution as it stands now.

#### NorthGuy

Joined Jun 28, 2014
611
NorthGuy, if it's a full matrix I believe it can't be as simple as you say. Consider that every crosspoint is resistive, so there are a very large number of paths through the matrix from a given row to a given column. As I said, I figured this out a while ago (like 35 years!) and I thought I'd done a good day's work.
Yes, you're right. It can go from a column rail to any row rail, then from that row rail to any column rail, and from there to our destination raw rail. You would have to use diodes between individual resistors and column rails to eliminate these stray paths.

#### John P

Joined Oct 14, 2008
1,910
There is a way to make the measurement even if the crosspoints are resistors and not diodes. It would be nice to think I was the first person who ever figured it out, but I probably wasn't.

#### NorthGuy

Joined Jun 28, 2014
611
There is a way to make the measurement even if the crosspoints are resistors and not diodes. It would be nice to think I was the first person who ever figured it out, but I probably wasn't.
You could be able to calculate it from a set of measurements, but it'll take a while to figure out the formula.

#### rhydo

Joined Jul 5, 2016
14
He's afraid we steal his idea.
Ok. Let's see if I have this.

You want a two terminal device, that you can put a resistor across. The hardware device will measure the resistance, check the tolerance, then indicate good or bad resistance. With a one bit output.

And you want to do this 50,000 times. Is this correct?

If this is correct, the solution depends on a many more details.

What is your tolerance? In other words, how accurate do you need to be?

What is the task duration? In other words, how fast do you have to do it?

What is your knowledge? What equipment are you familiar with? And what is your budget?

There is more than one strategy. The details matter. For instance, how fast you can change out the test resistor, will help determine the hardware. Or if you want to measure 5, 10 or 20 at the same time will change the hardware.

There are more than a thousand hardware solutions. Do you want to hear all of them?

My idea was to have one resistor connected to each analog input pin of a microcontroler such that each resistance is measured sequentially to determine it's presence in an infinite loop.
The problem boils down to the fact that no microcontroller in the world will have 50,000 analog input pins. The original post was only to determine whether something existed to deal with such a scenario. I am no longer thinking of measuring 50,000 values. If I manage to find a solution then I would focus on 200 at a time.

Tolerance can be as high as 20% I am not very keen on being super accurate.
Speed also is not an issue. Even if it takes one hour to measure 200 values sequentially, it is fine.
I am familiar with the MCS51 series, arduinos and rasberry pi.

#### blocco a spirale

Joined Jun 18, 2008
1,546
I have tried to simplify this several times. I will try again with a single resistor as an example.

- I have a single resistor that is not soldered, this means it can be connected to the circuit with alligator clips and similarly removed.
My idea was to have one resistor connected to each analog input pin of a microcontroler such that each resistance is measured sequentially to determine it's presence in an infinite loop. The problem boils down to the fact that no microcontroller in the world will have 50,000 analog input pins.
Can you see why everyone is confused by your spefication?

Anyway, what you want is achievable but it would have to be built as a quantity of sub-assemblies in order to minimise losses/leakage/noise/unmanageable complexity etc. Each sub-assembly could be addressable with its own micro-controller and each micro-controller reads the values in its own 16x16 array, for instance. If you measure the current drawn by the array when each resistor is selected its resistance can be calculated. You would then only need to build 196 sub-assemblies plus a master controller.

Last edited:

#### NorthGuy

Joined Jun 28, 2014
611
I wish I could discuss the mechanical aspect with you but I beleive you will understand that some things I just cannot share online.
I am not afraid that someone will steal my ideas.
I think it's just a troll. So I'm not going to feed him anymore.

#### joeyd999

Joined Jun 6, 2011
4,477
I just want to see OP attach 100,000 alligator clips to 50,000 resistor leads.

On second thought, watching paint dry or grass grow is likely more exciting.

#### ronsoy2

Joined Sep 25, 2013
71
This is not a hardware or microprocessor problem! This is a REALITY CHECK problem! When an engineer gets an assignment that is seemingly ridiculous it is time to do a reality check and reevaluate the overall concept. If an engineer is unable to do this, he is inherently unqualified to handle the task, and all results will end up as a lot of wasted time and money. Checking 50, 000 of anything is not a simple task! And somewhere in the post I saw that it was supposed to be done for 250 bucks? HA! REALITY CHECK, REALITY CHECK, REALITY CHECK!

#### splud

Joined Jun 30, 2013
30
And now you know why I decided to post this query here
I considered using multiplexers and the calculations ran off the page soon.
What other magical alternative do you think there would be?

Are you trying to test resistors as placed onto a PCB for assembly (and is this pre or post soldering, which will affect resistance), or for inventory tracking (unsoldered)? This is really only feasable if they're assembled and soldered.

Your physical connection to the board that the resistors would be on is going to be huge and error prone. Even if you had the thousands (or now scaled down, scores) of multiplexers, there are going to be thousands of connections.

Also, in the case of your specific resistor scenario, all measurements presume that you don't have parallel resistances - the measurement between V+ and your input has the one path through the resistor. Yes, your "expected reading" could compensate for that. In the case of resistors, there's also the matter of precision - if a resistor is 1% vs. 5% (or any number of other specifications), your code should account for that (and hopefully your measurement mechanism can manage as well).

In manufacturing, one uses things called "test points". These are pads, hooks, or pins on PCBs used to make contact with test jigs that can take measurements and/or inject signals at desired points on a PCB. Pogo-pins are a popular mechanism for use on test jigs - you can push the test jig down onto a PCB with enough force that they all make good contact - to the point that the tiny springs inside of the test pins compress a bit. Of course, a physical test mechanism will be subject to contact wear over time.

For the sake of argument (and that seems like all that can be done here if you can't elaborate for what you're really trying to accomplish, not this foolishness of "imagine if..."), let us say your resistors are actually soldered to a PCB, and there's a pattern to how they are soldered such that you could take measurements of 'x' of them at a time, then lift off, move the jig a specific distance in the X and Y, then seat down on the next test position, and repeat. If so, a combination of a small sized test jig, multiplexing, And a microcontroller could scale you up.

Let's say you have a uC capable of measuring from 4 inputs (other I/O would be for doing selection, motor control, or comms, but if you have more I/O do the math on scaling up), and have one 16 bit multiplexer IC per input, you'd be able to have 4x16 = 64 inputs routed out to pogo pins. This should be easy enough to implement on an UNO level device, though frankly, I'd be more prone to use an arm SBC such as a BeagleBoard/RPi/OrangePi/etc because you'll have direct networking interface, and far more storage. Note that the multiplexers could be driven from the same control input - that is, all of the multiplexers set to their fourth input in parallel, rather than individually interfaced to do so, which minimizes the I/O lines from your uC. I haven't had a need to wire such a thing up myself, but it should be doable. Obviously, if you had an I2C based analog multiplexer (if there is such a thing), you could just individually address each multiplexer on the same buss.

Storage is another matter: besides your code for running multiplexers, taking measurements, and communicating results, you need to be able to store your expected readings for each "position" as well as the rest result for that position. An UNO type board would need external storage (such as an SD card), or would have to be beaconing the readings out to another device. However, if you do with an ARM board with Linux, you'll have a filesystem and more than sufficient capacity. Plus, such boards have much more I/O, which would allow for more inputs.

With said controller, you could drive mechanicals to move the pogo pin array over the PCB to another registration point and land there to take measurements. Think CNC but without milling.

Note that the specifics of reading a bunch of resistors differs from polling thousands of RFID devices or reading a bunch of optical inputs.

I still fail to comprehend what real world application you have this need for.

#### splud

Joined Jun 30, 2013
30
- Once this resistance value is obtained, I compare it to a finite range of acceptable values within my code using if -then statements.
Use a LUT - Look-Up Table. An array of expected readings based on the indexed resistor (index being a combination of the jig position, I/O, and multiplexing values). Your LUT might contain just the expected value and you apply a 10% deviance to that, or you could have a LUT with two values - the expected value and the precision % (from which high and low can be computed).

In the simplest terms I am just measuring resistance values and and generating 2 bits of data as in 1 meaning 'resistance present' and 0 meaning 'resistance absent'.
That's actually 1 bit of data.

"resistance absent" is a misnomer - "out of range" would be more apt.

If the resistors are being temporarily put in place, how on earth are they all being swapped out for another test sequence within the 15 minute test cycle?

#### RaceNJason

Joined Apr 8, 2016
2
Multiplexer 32:1 ADG732BSUZ (TQFP48) x 7 @ 10.91 each = 224 Measure Points = 76.37 cost
Shift Register 8-Bit 74HC595PW (TSSOP16) with Serial Interface (So Cascade Them) x 7 @ 0.42 = 2.94 cost

Shift Registers control Multiplexers (1:1). Cascaded shift register interface would only require 3 Digital Pins.
Multiplexer's Outputs would require 7 Analog Pins (1:1)
ATmega32U4 MCU has enough pins and a USB interface for the above. Use this MCU if the interface needs to communicate with a computer. Use an ATmega8A if it is a slave module that pushes it's retrieved data onto another MCU (via UART - RX/TX).

If you make your own boards, add caps, resistors, inductors, etc sprinkled into the above...it could possibly be done for under $100. To scale to 50,000 test points would require 224 slave modules that are then multiplexed to a single data routing MCU. At$100 a module, \$22.5k is the total 'minimum' price a company would have to pay for this. That's about the cheapest 'real' solution you'll get.

#### NorthGuy

Joined Jun 28, 2014
611
Multiplexer 32:1 ADG732BSUZ (TQFP48) x 7 @ 10.91 each = 224 Measure Points = 76.37 cost.
or 5 PICs with 48 ADC channels each - PIC32MX130F128L x 3.02 each from Microchip Direct = 240 Measure Points = 15.10 cost

Enormous amount of computing power included.

#### RaceNJason

Joined Apr 8, 2016
2
or 5 PICs with 48 ADC channels each - PIC32MX130F128L x 3.02 each from Microchip Direct = 240 Measure Points = 15.10 cost

Enormous amount of computing power included.
Nice MCU considering how many analog ports it has. Might even buy a couple on next Mouser order to play around with considering cost vs. features (I constantly have projects that deal with 100's of sensors in agricultural automation...but so far not one with 50000 sensors lol). It's power supply specs are 2.3V to 3.6V. Going off of the only specs shown, 5V could be the voltage supply (if it was higher, the Arduino/Atmel MCU would potentially fail in that circuit). If it is 5V, then additional circuitry would be needed to use the Microchip MCU to not affect the signal and still bring the voltage range down to 3.6V (i.e. voltage follower into additional voltage divider). It is possible that the voltage divider (shown in the specs) would bring down the voltage enough...if not and/or without the additional circuity, you'd need an ADC that goes to 5V.

Now does Microchip have a similar MCU that operates up to 5V?