These are raw ADC reads according to different input voltage.Code:Vin Raw Delta 0.1 10 0.5 88 78 1 213 125 1.5 335 122 2 460 125 2.5 580 120 3 700 120 3.5 807 107 4 927 120 4.1 960 33
These are raw ADC reads according to different input voltage.Code:Vin Raw Delta 0.1 10 0.5 88 78 1 213 125 1.5 335 122 2 460 125 2.5 580 120 3 700 120 3.5 807 107 4 927 120 4.1 960 33
Hi,
First of all. With a VRef of 4.096 you can not input a voltage HIGHER than that, so the 4.1V (although very close) isn't a valid test. With that said something is seriously wrong - either with the code, the setup, or the hardware.
And again, have you actually looked at the reference voltage AND at the input voltage with a scope to verify that they are clean? Simply measuring them with a voltmeter may not show the error.
Instead of using the pot across the reference voltage, try using a low impedance source, ie a variable DC supply, to feed the ADC and put a 10nF capacitor from the PIC pin to GND to act as a noise filter. See if that makes it any better. Also, take a couple of readings and average them to further clean any noise.
If the above doesn't help then try another channel on the ADC or try another PIC. It's possible, but not likely, that something got damaged when you overloaded the input.
/Henrik.
It is NOT 4.1V, it is 4.096v, I just wrote 4.1 to save space.
Yes, looked with scope and precision (3 digits after decimal point) multimeter.
Will try another channel and another pic, as well as another voltage supply.
Set scope to 50mV resolution and AC input. Found an 120mv max noise pulses, with 3.35hz following frequency.
Where?
On the power rail, at the output of the voltage reference, at the ADC input or all of the above?
If the noise is only present at the ADC input of the PIC then the problem is probably too high source impedance (that 10k pot you're using) and the 3.35Hz you're seeing is how often the ADC is sampling the input. Or is this with a low impedance source?
Yes it was with 10k pot, measured at ADC input. no other tests so far.
Actually, I went with ADC route because I was not able to make BH1750 light sensor to work with picbasic, and since I badly need light measurement, I've decided to do a circuit with photoresistor and ADC, but it appears to have it's own bunch of problems.
Yes, these pulses were from ADC. If turn ADC off, pulses are gone.
Problem is solved, but it was weird.
Since PIC has two Vss pins, I was using one Vss for GND, and to other Vss pin I've tied LCD gnd pin. So current going trough the PIC was causing the troubles. After I've added jumper to feed Vss directly to LCD, problem had gone and linearity improved.
Bookmarks