6
\$\begingroup\$

Below you will find a buffet of questions and the schematic for my device. (Click on it and you will get the full-size image.) Please tear this up. I'm a self-taught novice putting together a high-precision device. Can you help me validate the circuit?

  • There is a pull-down resistor (R15) at location B7 on the schematic, I need help calculating the value.
  • I have access to SPICE, would this kind of circuit be suitable for simulation?
  • Where have I failed to follow standards?
  • Which capacitors are bypass, blocking or coupling?
  • The ADC and the LED driver both communicate with SDI/SDO. Can I serve both components on the single input/output of the development board? (Location B8.)
  • Can I use different color lines to represent signal and communications?
  • I need help calculating the voltage divider for an output that is 1/4 of the input (R17/R18 at location B9).

The component labeled soil probe is under development. Essentially, at this point in time, I am using the sub-circuits at the left side of the schematic to create two separate precision current meters where the load is the dirt. I got the circuit from page 22 of the op-amps datasheet.

Datasheets for all the major components follow:

Schematic Diagram

\$\endgroup\$
13
  • 1
    \$\begingroup\$ @TimCerka I would really suggest that you remove everything from the circuit and leave only arduino and the probes. Arduino can even be powered directly from 4.5V if you connect your battery holders in parallel (or from 9V if you make them 2 in series). \$\endgroup\$
    – floppydisk
    Commented Dec 28, 2022 at 20:57
  • 2
    \$\begingroup\$ +1 for saving people's time with links to datasheets \$\endgroup\$
    – floppydisk
    Commented Dec 28, 2022 at 21:09
  • 2
    \$\begingroup\$ @TimCerka still I dont see any reason for not using Arduino's internal ADC :) Start with simple things then move on to a more complex design if you find yourself hitting some limitations. \$\endgroup\$
    – floppydisk
    Commented Dec 28, 2022 at 22:39
  • 1
    \$\begingroup\$ Have you actually tested long-time performance of the probes? My guess is that feeding with DC will in some soils create ion movement and possibly corrosion which will over time degrade quality of measurement. I would probably not have contiunous power and possibly use AC for the probe. \$\endgroup\$
    – ghellquist
    Commented Dec 29, 2022 at 6:45
  • 1
    \$\begingroup\$ Without looking into it more carefully, it's clear that your R19/R20 network should be connected to the top of C3, rather than the switching output of the regulator. You also need a lot more decoupling capacitors, One per IC would a good start. Because you are clearly inexperienced, I suspect you need to do a lot of reading about layout. 24-bit converters need very clean inputs. You ARE using a ground plane, right? And you ARE paying attention to stray current paths, right? \$\endgroup\$ Commented Dec 29, 2022 at 17:00

4 Answers 4

4
\$\begingroup\$
  • C1 definitely shouldn't be there. It disconnects V+ pin from the actual power line. Probably you meant to place it between V+ and ground
  • Crystal resonator is supposed to be connected between X1 and X2 pins, not between X1 and the ground.
  • U5 probably needs its own crystal between OSC1 and OSC2 (or clock source, check with datasheet)
  • If R1 and U1 are meant to form a voltage divider, R1 value is too small. (same goes for R4) Proper value should be roughly the same order as U1 resistance in normal operating conditions.
  • Not clear what R15 "pulldown" is referring to - VCC of U6 or SDI of U5. In any case, neither of those need a pull-down.
  • In general, the situation with op-amps and MOSFETs is not too clear. Are you trying to achieve voltage repeaters? Or amplify the signal? This can be done a lot simpler without the need for any transistors and will also produce cleaner signal. I don't see any reason why soil probes should be its own circuits (as for your update) If they are just some kind of variable resistance that seems to be enough here. (Only with proper R1 R4 values)
  • SDA / SCL lines are not connected correctly. You need SDA/SCL lines going directly from arduino to U6 and both of then pulled-up independently to VCC.
  • SPI bus seems to have 2 devices connected but no way of actually switching between them two. (CS pin is hard-wired to ground) This is related to your question #5. If you need to connect 2 devices to a single SPI bus, you need to wire their CS pins to your arduino GPIO lines and use that to switch them at runtime.
  • SDI/SDO pins are connected wrong way around to Arduino. SDI should go to Arduino's MOSI and SDO to MISO.
  • Getting a 24 bit ADC doesn't automatically make your circuit 'precision'. You need to take a lot of care with power isolation and smoothing. Simply sticking power line info VREF is definitely not enough. So either your ADC is too powerful for this task and you don't really need all that precision or you need to properly insulate analog circuitry from the digital noise. That's a big topic on its own.

"Which capacitors are bypass, blocking or coupling?" - is kinda odd question to ask. It implies that you first randomly slap a bunch of capacitors on and then ask what is their purpose?

Conclusion (based on comments and other's input): Just use Arduino and plug your sensors directly into it using proper R1/R4 for voltage dividers.

\$\endgroup\$
5
  • \$\begingroup\$ Thank you for all your valuable information. Page 22 of the op-amps datasheet is the source for that part of the circuit. As I mentioned, I'm a novice, this whole circuit is assembled out of sub-circuits described in the datasheets. I just connected inputs and outputs. \$\endgroup\$
    – Tim Cerka
    Commented Dec 28, 2022 at 20:39
  • 3
    \$\begingroup\$ @TimCerka are you sure you really need all that stuff to just measure soil moisture? Arduino has a pretty decent ADC already built-in. I'm pretty sure you can just connect the input signal from your probes directly to arduino and get rid of Op-Amps/LPF/ADC altogether. Simpler is better, especially in case you're a beginner. \$\endgroup\$
    – floppydisk
    Commented Dec 28, 2022 at 20:45
  • \$\begingroup\$ @TimCerka also why would you need an RTC for a soil meter? I don't see how you can use date/time information without any connectivity to external world from arduino (like LCD or other user interface) \$\endgroup\$
    – floppydisk
    Commented Dec 28, 2022 at 20:47
  • \$\begingroup\$ The RTC is part of the device to support future development where there will be an interface and data transmission out of the device. \$\endgroup\$
    – Tim Cerka
    Commented Dec 28, 2022 at 20:57
  • 2
    \$\begingroup\$ The config on page 22 is a current meter, you're probably interested in a voltage meter. I agree that the best idea is to simply plug in the meter to the Arduino, with nothing else. Otherwise, you'd be more or less in the dark about your circuit without learning analog electronics in detail. Also the situation with the voltage seems unusual. You could simply use a 9V battery and the Arduino will regulate its own voltage. In my view plug in the sensor to Arduino, and try coding it. Your current implementation is a bit complicated even for professionals. \$\endgroup\$
    – ee_student
    Commented Dec 28, 2022 at 20:58
5
\$\begingroup\$

In addition to what everyone else mentioned, all the filtering you need will be accomplished by the ADC itself, and by post-processing the data in software. As a starting point, I'd consider connecting the ADC inputs as "directly" to whatever it is you're measuring as possible - this will remove a whole bunch of design risk. If, in the end, the sensitivity is too low, you can always add external amplification - that may improve S/N ratio but does so at the expense of other parameters.

The reason I am seeking precision is because I expect to need to accurately measure very low currents

The number of bits determines dynamic range. What is the dynamic range of currents you'll be measuring?

All you need in your application is maybe 1% accuracy and 0.1% resolution. A 12-bit ADC is plenty for that, if the range is fixed.

Soil impedance measurements allow for error correction when done across a range of frequencies, and DC is a bad idea due to galvanic effects. When using DC, in order not to degrade the sensing cell, you may need to drive a certain amount of charge into the cell, then reverse polarity and extract that same charge, and so on. The net charge after a measurement session should be zero. This should be fairly precise, as the errors accumulate, and will cause a DC drift. That's why AC impedance spectrum may be less of a chore to obtain.

\$\endgroup\$
4
\$\begingroup\$

I see many probable errors as well as questionable design implementations. Most have been noted in other answers and comments.

But in order to fully critique the design, you will need to provide a complete specification and theory of operation, which should include all non-obvious circuit elements. Maybe the most important is what is being analyzed (soil moisture, apparently), and why it needs to be such high precision as to require a 24 bit ADC. AFAIK soil moisture is highly variable and depends greatly on the exact construction of the probes and how they are inserted into the sample.

You show an LT1475-5 buck regulator, which is fixed at 5V. You might want an LT1476, which has an internal 2.4V reference. Your feedback network R19 and R20 will regulate to about 5V. It also needs to be connected to the output (C3). It also needs a bypass capacitor close to the device. And you don't show the voltages of your battery packs. You can use LTspice to simulate this circuit element. I think you are using it for a 5V supply, so the feedback network is not needed.

As for using two aluminum plates for moisture sensors, you should consider that they will quickly become coated with a layer of aluminum oxide, which is an insulator, and will probably not function well for resistance measurement. They should probably be made from stainless steel, or platinum, or gold plated. Commercial probes seem to be made of stainless steel. Some material to review:

https://extension.umn.edu/irrigation/soil-moisture-sensors-irrigation-scheduling#tensiometers-1870360

https://dynamax.com/products/soil-moisture/pr2-multi-depth-soil-moisture-probe

https://extension.okstate.edu/fact-sheets/soil-moisture-sensing-systems-for-improving-irrigation-scheduling.html

And here is an Arduino project with a "dirt simple" soil moisture sensing circuit. Perhaps you should try this and get some experience before building a highly questionable device.

https://www.wellpcb.com/how-do-soil-moisture-sensors-work.html

https://sensors-technology.com/qa/what-is-soil-moisture-sensor-and-its-uses.html

\$\endgroup\$
4
  • \$\begingroup\$ Each probe, at this time, consists of two aluminum plates, an anode and an electrode. The probes will be buried in the soil. The reason I am seeking precision is because I expect to need to accurately measure very low currents. \$\endgroup\$
    – Tim Cerka
    Commented Dec 28, 2022 at 20:51
  • \$\begingroup\$ All the precision will do is show noise and drift at the low end of the scale. You need to properly amplify the current, which will probably involve much larger sense resistors. If you want to measure 100 uA, the 0.1 ohm resistor will just provide 10 uV. To get a reading within 1%, you will be reading to 100 nV. \$\endgroup\$
    – PStechPaul
    Commented Dec 28, 2022 at 20:58
  • \$\begingroup\$ Can you expand on how to properly amplify the current? \$\endgroup\$
    – Tim Cerka
    Commented Dec 28, 2022 at 21:19
  • \$\begingroup\$ First, you need to supply complete specs and theory of operation. And extended discussion in comments is not according to forum policy. Provide the details in your question and you will get sufficient advice. But, really, you need to greatly simplify if not completely redo your circuit. \$\endgroup\$
    – PStechPaul
    Commented Dec 28, 2022 at 21:27
0
\$\begingroup\$

It looks like you’ve connected the soil probe to 3.3V from your Arduino. That’s likely to carry a lot of digital noise. Ideally you’d use a dedicated low noise voltage reference, or at least isolate using a small inductor in series with decoupling caps on either side. You have a 0.1R pull-up resistor which seems much too small, although the ideal value will depend on the dimensions of the probe, aim to have the probe’s output be at about half of your supply voltage under normal conditions. You might also want to switch the voltage to the probe, if you supply DC then there will be electrolytic effects such as corroding the probe and turning the surrounding water into gas.

\$\endgroup\$
3
  • \$\begingroup\$ I will change the voltage for the probes to the 5V output of the regulator. The corrosion I knew was coming, but I had not thought about electrolysis. Is there an electrolytic effect threshold on the voltage? If not is AC the only way to avoid it? \$\endgroup\$
    – Tim Cerka
    Commented Dec 28, 2022 at 20:29
  • 2
    \$\begingroup\$ @Tim Cerka AC is effective, but I’ve found that in seawater probes it’s ok to use short pulses of DC. Presumably the ions don’t move far and mostly recombine after the voltage is removed. An ADC measurement might only take a few microseconds (grab a number of samples to see how quickly the analogue circuitry stabilises) and you may only need to take a measurement every few minutes \$\endgroup\$
    – Frog
    Commented Dec 28, 2022 at 20:37
  • 1
    \$\begingroup\$ thanks for letting me stick with DC! What I will do is switch the probes on only when taking a measurement. \$\endgroup\$
    – Tim Cerka
    Commented Dec 28, 2022 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.