Does anyone have a better solution for this design? - Page 1
Forum section: electronics / projects

author: blnc
author_rank: Newbie
timestamp: March 19, 2025, 06:30:00 pm
content: Hello everyone!I’m working on a quality control setup for a project that measures temperature with PT1000 sensors. Each device has 4 sensors, and I need to test 4 devices at the same time, so that’s 16 sensors total. To do that, I need to simulate different resistance values that correspond to temperature readings.Right now, I’m going with a setup where precision resistors are switched using MOSFETs, all controlled by a 16-channel SPI I/O expander to avoid wasting too many MCU pins. This keeps it simple, avoids mechanical relays (which are slow and wear out), and lets me control everything from an STM32. The attached image shows the setup for just one device, so I would need three more of these and i wonder if theres a way to make it simpler.I've looked into analog switches and digital pots but they all had issues (extra resistance, limited range or just low precision). The MOSFET + SPI expander setup seems like a good balance between accuracy, speed, and reliability, but before I lock it in, I wanted to ask:Is there a smarter way to do this?

author: mawyatt
author_rank: Super Contributor
timestamp: March 19, 2025, 06:49:05 pm
content: Might be slightly simpler, if you could also use a 800Ω, then three 100Ω in series. Switch in-between each to return for 800, 900, 1000, and 1100Ω. Would also allow some other values with various switches ON.Best

author: ajb
author_rank: Super Contributor
timestamp: March 19, 2025, 07:03:11 pm
content: Better depends on your priorities. Everything will add some amount of error resistance to the system, including those MOSFETs, but whether or not it's a problem depends on your accuracy requirements.What you have might work, but it depends on how the AIN ports are connected within the device. You need to make sure the source of each MOSFET stays a few volts below the supply voltage for the IO expander, otherwise the gate-source voltage won't be sufficient to turn the transistors on fully. To that end, you should probably put the resistors on the drain side of the transistors instead of the source side (or maybe the transistors are upside down?).

author: pcprogrammer
author_rank: Super Contributor
timestamp: March 19, 2025, 07:43:54 pm
content: To reduce on components a little bit you can also choose a STM32 MCU with 100 or more pins. For instance the STM32F401VB gives you 81 IO pins. To connect four of your setups you would need 64 IO pins, so plenty left.It might be cheaper than using the four IO extenders.

author: mawyatt
author_rank: Super Contributor
timestamp: March 19, 2025, 07:50:51 pm
content: Quote from: ajb on March 19, 2025, 07:03:11 pmGood spot, you want the sources to be common and Vgs to be + to turn On each switch.Best

author: Kleinstein
author_rank: Super Contributor
timestamp: March 19, 2025, 07:52:34 pm
content: If one does not need the exact values, one could get away with parallel switching. So the hightest resistance and than additional resistors switching in parallel. With 2 switching one could get 4 values, though not exactly evenly spaced resistance, but steps in 1/R.Even with 3 separate switches one would have less current though the MOSFETs and thus R_on less critical (roughly a factor of 5-10).As a downside one would need somewhat odd resistor values, that may need a conbination instead of standard values.

author: mariush
author_rank: Super Contributor
timestamp: March 19, 2025, 07:57:34 pm
content: Have you considered analogue muxers ? You have ICs like TMUX1208 which only add around 3-5 ohm of resistance (and typically < ~0.15 ohm variation between channels) :https://www.digikey.com/short/7z9bh5p9You could handpick muxers and measure each channel resistance and calibrate your circuit keeping account of the internal resistance of each channel. Are the mosfets gonna have the same Rds(on) value, or would you have to bin them as well ?

author: PCB.Wiz
author_rank: Super Contributor
timestamp: March 20, 2025, 04:38:46 am
content: Quote from: blnc on March 19, 2025, 06:30:00 pmThat's simple and easy to understand, and most important easy to update. It's for a test system, so no need to spend a day saving 1c.You could look to use Dual MOSFET packages, to reduce the BOM a little.

author: PGPG
author_rank: Frequent Contributor
timestamp: March 20, 2025, 08:44:46 am
content: If you are able to test one input after the other you can have one set of resistors switched between inputs.

author: temperance
author_rank: Super Contributor
timestamp: March 21, 2025, 08:12:03 am
content: Is there some reason to have more than two resistors? You only need/want to adjust and verify the ADC off set and gain error for which you only need two points.Adding more points will waste time during testing. That might add up to very high expenses.

author: CurtisSeizert
author_rank: Regular Contributor
timestamp: March 21, 2025, 02:15:19 pm
content: Kleinstein's solution for reducing the influence of the Rdson of the FETs is good. With the parts you have chosen, Rds errors would be at least 0.5 C as you have drawn it. The schematic as drawn seems to be missing a connection between Iout_shunt and the respective AIN channel for each block, and, as mentioned before the resistors should be connected to the drains of the FETs.Depending on how everything is isolated, using FETs may be a problem because the sources of the FETs should be grounded or there will be nothing defining their potential relative to the gate. I assume the channels for each device are not isolated from one another, so you would effectively be shorting the Iout_shunts from multiple channels together. This could be asking for trouble. You could fix this by switching to SSRs and incorporating Kleinstein's idea. This would increase the cost, but it may be necessary to ensure you're not rejecting good DUTs.Depending upon how closely you need to adhere to the values you have, you could get four values from just two switches by using two different value resistors. For example, 1k2 could always be connected and 3k6 and 7k5 could be switched. The values you can synthesize with those resistors are 1k200, 1k034, 900R, and 803R. That gets you down to eight signals for four channels.

author: MarkT
author_rank: Frequent Contributor
timestamp: March 23, 2025, 08:16:03 am
content: Firstly you can easily get MOSFETs with on resistances of tens of milliohms, yet you have chosen one's with 2 ohms of on-resistance - you might be better off with signal relays which have no leakage current.2-, 3- or 4-wire PT1000 sensors BTW?

author: 2N3055
author_rank: Super Contributor
timestamp: March 23, 2025, 01:16:05 pm
content: Quote from: temperance on March 21, 2025, 08:12:03 amI absolutely agree. Right on the money as usual.To O.P. :In practice i would prefer three (3) temp point test here:It is enough for full calibration of RTD PT 1000 system to rather high accuracies.2 mathematically needed and a third one midrange to verify linearity, a sanity checkUse relays and 4w layout if possible.Relays can easily do hundreds of thousands of switchings and are used all the time in scanners of this sort. Unless you are going to do 100000 tests in one go, relay wearout is not a problem..If you are going to do more than 100k tests, then it is a serious project and can have spares of scanners.Even if you use good quality relays, a board with 4W 4 ch scanner, relays are not going to be that expensive. Good resistors will be more, but if you go for only 3 temp points, which is all you need, that will not be much either.Instead of spending time trying to invent something "super duper" optimized, in time already spend discussing it , you could have laid out a relay based PCBs, ordered it and the material and had it on the way already.If you are not going to have 1000 of these testers, optimization for BOM is actually waste of time and money.And for last remark, but really the first one, the first most important question: what is actual accuracy specification for the tested/calibrated device?In reality, if specs are not that tight, just specifying a tight reference resistor and ref for the ADC in thermometer itself will provide accuracy required. Then you do single point sanity check and that is it.It all depends on volume of product and actual accuracy needed.There is also an option to use commercial scanner device of a sort and a resistor field.Our member Dr Pyta made a relay scanner device few years ago that was very good.There are also few DIY DMM6500 scanner cards designs in EEVBLOG.If your accuracy requirements are not very high, you might even be able to use some Arduino or Raspbery PI relay board and just use that...For limited accuracy and limited run that might be good enough.Impulse to make things on your own is not always beneficial. Not-invented-here syndrome (NIH) is not a positive thing.In production environment it is almost always better to just buy ready made devices, if they can do the job.It ends up being faster and cheaper. And you can use them for other projects too, being modular.You make something in house only if it is highly proprietary. It is either something so different that there is no instrumentation available in ready made form, or something you don't really want to give any hints to anybody what are you measuring here.You application is plain vanilla verification/calibration of an RTD PT1000 4 ch thermometer. That is being done for century and on the cheap. Thousands of devices out there to do so.Your boss needs working solution, and fast. So they can start moving products off the production line. Optimize for time to deliver test solution, because you will otherwise become the reason production is not running.Optimize for reliability of results (not equipment). Make scanner work really well, reliable and repeatable. Have a spare scanner or a two, so it can be swapped out quickly if there is a problem. Make sure your wiring is made to be able to swap scanner quickly. You can have devices that have bad MTBF but a solution using them can have 100% uptime because things are cleverly redundant and repair is seamless to customer.Micro optimization of the scanner card/solution is not in any way relevant for your problem.. Optimize test protocol and just implement it in simplest possible way. And simple helps with reliability and ease of troubleshooting and making production going smooth.

author: temperance
author_rank: Super Contributor
timestamp: March 24, 2025, 09:44:45 am
content: QuoteI would omit the sanity check as well.This circuit can be reduced to a fixed resistor and a switched resistor. But you must implement a sanity check on the calibration values for gain and offset.QuoteFor those small signal relays they specify a contact resistance between 0.1...0.5 R.A floating solution could be: A VOM1271 driving a MOSFET.https://www.vishay.com/en/product/83469/MOSFET: SIR178DP-T1-RE3This MOSFET has een on resistance < 1mOHm and only needs < 3 V to drive the MOSFET into saturation.An other remark: in a system with PT1000 sensors you need to take care of the connectors because the currents are very small. As such there is no means to keep the contacts clean in case of tin plated connectors. (search for fretting corrosion if you need to know more) For this application you need gold plated connectors. Preferably hard gold plating. But those hard gold plated connectors are very difficult to find.