I am working on my first project in a very long time. A bench power supply with built in digital voltmeter. The voltmeter will have a PIC 18F45K20. The PIC will also operate the front panel.
After ordering everything, I quickly realized that it is probably cheaper to buy a bench supply rather than build it on my own. But I sort of already knew this, from what others have said on this forum. But it is hard to put a value on the challenge, the education and the exercise to my old brain cells.
Anyway, I knew I could not directly measure negative voltages with the PIC. So I thought what I really need to do is to measure absolute voltages and I probably would need to use an op amp to do this. So I did some searching and sure enough I found an op amp circuit to measure absolute voltages.
But what I can't figure out is how the PIC would know a negative or positive voltage was being measured. How would I do this? Maybe a voltage divider and a diode on the input to the op amp?
Or is there an easier way to measure both negative and positive voltages altogether?
After ordering everything, I quickly realized that it is probably cheaper to buy a bench supply rather than build it on my own. But I sort of already knew this, from what others have said on this forum. But it is hard to put a value on the challenge, the education and the exercise to my old brain cells.
Anyway, I knew I could not directly measure negative voltages with the PIC. So I thought what I really need to do is to measure absolute voltages and I probably would need to use an op amp to do this. So I did some searching and sure enough I found an op amp circuit to measure absolute voltages.
But what I can't figure out is how the PIC would know a negative or positive voltage was being measured. How would I do this? Maybe a voltage divider and a diode on the input to the op amp?
Or is there an easier way to measure both negative and positive voltages altogether?
Last edited: