Hi, I have a sensor that outputs a voltage range that sometimes changes on me.
Usually, it ranges from -2.5V up to 5V or sometimes 10V. I was hoping that I could get whatever voltage output I get and map the voltage to 0- 5V. This means that the voltage output I want will never go above 5V and below 0V.
I need it from 0-5V because my other device will only accept a 0-5V range.
I'm not too shabby with the math and design of the comparator, and I hope you can help me with that as well. Thank You.
Hi, I should have been more specific. I don't have a MAP sensor. I have a laser sensor that outputs a voltage reading that can range from -2.5V up to whatever voltage. It changes on me at times. I was hoping to be able to map that output voltage, whatever it may be, to 0V to positive 5V.
[laser sensor] --> -2.5V to 5,7,10V (voltage fluctuates) --> [black box(mapping voltage)] --> 0V to 5V --> microcontroller
The laser sensor is powered by a 12V power adaptor, but the sensor itself can operate on 9V. The output of the laser sensor fluctuates between the voltages I mentioned above. The black box will be the circuit comparator/voltage limiter that I need to make to take in that input voltage and output a mapped voltage between 0V to5V for use in microcontroller.
To answer your first question: yes and no. It would be similar to that, but in case i have a +7V or +8V or +10V input, I would still want it to be mapped to 5V. and yes I want to change whatever negative voltage input I receive up to 0V.
I can have a 9V or 12V supply voltage available. Sensor and supply are stable.
Attached is a single supply circuit with offset. The voltage reference can be a TL431 or op amp. All op amps will need to be single supply type if you only have a positive supply.
Question: How is the sensor generating negative output voltage if it's powered only by a positive supply?
Also, I am confused about mapping anything greater than +5 from the sensor to 5V at the input of the ADC. Are the sensor outputs >5V significant? If so, you likely want to map +10V to +5V at the ADC input (i.e. give up some of the ADC's resolution). If not, then you want to clamp anything above 5V to 5V?
Attached is a single supply circuit with offset. The voltage reference can be a TL431 or op amp. All op amps will need to be single supply type if you only have a positive supply.
Question: How is the sensor generating negative output voltage if it's powered only by a positive supply?
The sensor has a negative and positive supply, sorry i forgot to mention that.
In your schematic, is the U1 just a regular op-amp? What specific one do you suggest I use?
Also, is it possible to not use a voltage reference in the circuit? Or is it necessary? If needed, how will I implement the LT431 to reach 1.667V to attach to that 10k Resistor.
Also, does this circuit have to share the ground with the sensor?
Also, I am confused about mapping anything greater than +5 from the sensor to 5V at the input of the ADC. Are the sensor outputs >5V significant? If so, you likely want to map +10V to +5V at the ADC input (i.e. give up some of the ADC's resolution). If not, then you want to clamp anything above 5V to 5V?
The voltage readings above 5V are significant. I would like to map the voltage above 5V down to 5V. For example, if I am getting a wave signal that goes from -2.5 to say 6.5V, I would like it to be mapped to 0V to 5V. If my sensor gives me a signal that ranges from 2V to 10V I would like it to be mapped to 0V to 5V. I hope that makes sense.
Okay. What do you suggest I do? Will the schematic that the other replier posted work? And when looking at that schematic, how will I be able to implement the LT431 as the reference voltage? Will it be possible to not use a power supply(ref voltage) for this circuit and just have an incoming signal?
Actually, since the ADC input is ratiometric with respect to a reference inside the microcontroller, can you make that available on a pin? What voltage is it?
Actually, since the ADC input is ratiometric with respect to a reference inside the microcontroller, can you make that available on a pin? What voltage is it?
I am not familiar with Arduino-Uno. Most uPs I have worked with can optionally make the internal reference available on one of the pins of the microcontroller. If so, we could use that voltage as a reference source instead of having a secondary reference. Advantage of that is since the ADC inside the Atmega is ratiometric with respect to the internal reference, then there will be no relativer drift between the external and internal reference...