Generic voltage sensor
-
I hope this isn't a question with an obvious answer, because I can't seem to find one.
I have an optical sensor that varies it's output between 0-10 volts.
What is the best way to configure a Mini5+ to read that sensor?
What is the best way to then get that reading?@dc42 this sounds like something you may know off the top of your head
-
I have found
M308 S0 P"io6in" Y"linear-analog" A"DNAreader" F0
maybe effectively sets up the sensor, and
M308 S0
reads the sensors value.
I'm wondering though, how can I configure the sensor to be sensitive to the voltage range of the optical reader: 0-10v? -
@drivetrainsystems use a voltage divider (2 resistors) to reduce the voltage to the range 0 to 3.3V.
-
@drivetrainsystems
Also use B and C values :Additional parameters for linear analog sensors Fn F0 = unfiltered (fast response), F1 = filtered (slower response, but noise reduced and ADC oversampling used to increase resolution). F1 is only available when using a port intended for thermistors, not when using a general input port. Bnnn The temperature or other value when the ADC output is zero Cnnn The temperature or other value when the ADC output is full scale
-
@drivetrainsystems See this thread - reading-sensor-pressure-from-analog-output for details. You can skip the posts involving the "Bi-directional Level Shifter" which returns a digital signal.
-
@dc42 do understand correctly that the value reported by M308 S0 in my above example (applying your voltage divider) will be a reflection of the voltage detected between the outer pins of io6in?
For instance, if I configure the reply value range for 0-100, and my sensor generates 5v (dropped to ~1.65v), will M308 S0 report a value of 50? (hope my details are sensible, I'm not quite yet grasping all the particulars of the process)
-
@drivetrainsystems that's correct, except that there is a 27Kohm pullup resistor to +3.3V on each IO_IN input which will affect the reading a little. It's not hard to calculate how much.