We are a FIRST robotics team of students doing a project on Water Quality. We are trying to use the Particle Electron to create an inexpensive remote water quality meter.
Our plan is to emulate this arduino project using the Electron, but the assumptions in the project are difficult to translate to the Electron. The problem is the differences between the Electron and the Arduino.
Specifically, the project creator (M. Ratcliffe) has documented this diagram:
Vin = the voltage supplied to the sensor
Ra= the resistance of the digital pins (on the Arduino)
Vout = the voltage to be measured.
Rc = The resistance to be measured/calculated across the sensor
R1 = a fixed resistor (that we need to select for our design)
He then proceeds to calculate a value for R1 that will give good resolution to Vout (and subsequent calculations for Rc). A key assumption is that Vin is 5VDC, and Ra for the Arduino pins are 25ohms.
Would we use Vin of 3.3VDC for the Electron? What about Ra? What value for fixed resistor R1 should we choose to give good resolution for the expected range of Rc values? Note that we expect Rc to be between 114 ohms and 2195 ohms based on the temperature and dissolved solids in the water.
We can probably handle the programming if we can get the hardware worked out. Thanks in advance for helping out the newbies.
I would recommend you made a test with a buffer to implement the electron
The reason is simple like the voltage drop, the current that you will have in a 5 volts changes as the voltage decreases or increases.
To fixt your problem:
You should measure the voltage drop in each resistence and applay the Ohm law,
You can use a TL74LS245 to amplify the voltaje output.(lookingfor the datasheet in this link: 74LS245 datasheet )
I was the same problem working with difent voltaje, using the mc9s08qg8
if the output signal is analogic, you will used a OPAM like TL084 to amplify signal output with a gain that you need
Yes, you should use 3.3 volts to power your voltage divider (the analog pins are not 5 volt tolerant when in analog mode)
Ra is irrelevant – I’ve never seen anybody include that in a voltage divider calculation before, and its value is small enough that it can be ignored.
Picking the right value for R1 would be very easy if you use a spreadsheet like Excel or Apple’s Numbers (or calculus if you prefer). Have column A with putative values for R1 (say 100 ohms to 2000 ohms), Then give column B the formula 114/(A + 114), column C would have the formula, 2195/(A + 2195), and have column D be the difference between columns B and C. The formulas are just the formulas for a voltage divider using your two expected extremes. Column D would show you which value of R1 will give you the maximum difference in signal between your two ends.
After Edit: I just checked out your reference, and noticed that they used a spreadsheet too, to find the best value for R1.
Thanks for the help. Using your formulas, we figured out that if we use a 500 ohm resistor, we will have a voltage range of just over 2VDC, which should give us good resolution.
I’m glad that worked. As I said in my post, you could also use calculus to directly calculate the best value for R.
You would want,
where a and b are the exxtremes that you expect to measure, and x is the value of the fixed reisistance (R1)
If my very rusty calculus is correct, the solution to that is,
Plugging in your numbers of 114 and 2195 for a and b, I get 500.23 ohms using this equation