I have a sensor that has a varying voltage. It ranges from 2.57v down to 1.82v.
The voltage varies as a result of reading the current from an electric pump. The controller for the pump operates on a PWM and therefore the voltage read from the sensor goes in steps.
The steps are off, slow speed, speed 1, speed 2, speed 3 and speed 4 (max).
I created a bar graph from a 2d table reading the voltage. This works, with the only issue being, the voltage moves around a little bit at each step and as such the bar graph can flicker between the steps when the voltage crosses between one or the other.
I then looked to see if it would be easier to use 6 separate mini bar graphs. The first displaying on all the time (to show it has power), then the subsequent bars displaying as the voltage changes.
I’ve not been able to figure out how to do this.
Can anyone offer any advice as to how either of the above can be created (that’s if they can)?
Below is the display for 6 steps. Is there a way to create a voltage ‘window’ for each step for example, step3 1.85v to 1.95v? This should then stop the flickering between the steps.
Is using functions the best way forward such as this example used by somebody else?
I create a function for the voltage ‘window’ for each of the separate steps/bars?
Does each bar then need a unique name to differentiate it from the others?
That’s what I would do, so in this case, no need for a table, just functions and simple indicators
It depends on when you want another indicator to come on..
Thanks again Greg, I have now managed to get it more or less how I wanted. The only slight issue is that as the controller ramps up the PWM to the pump the indicators do not react quick enough so when it goes from step 3 to step 6 the indicators can’t keep up so it basically jumps from step 3 to step 5 quickly before then settling at step 6.
I can’t see any way to change this as with indicators there isn’t an option to change the sampling frequency.
I may look to reduce the number of segments and instead have just off, on (low) and on (High). I’ll see how that looks.
Thanks again Greg, appreciate you taking the time to assist me.