Recently I have been working on a robotic system that gets direction fron the position of the sun.
I use two LDRs on either side of a vein mounted on a stepper motor that tracks the sun so that the amount of light falling on the left LDR is equal to the right LDR.
To compensate for the difference in channnel and LDR measurement I have an initialisation routine that scans the whole arc of sky and records the difference between left and right LDRs. This correction is the applied to the readings.
Could you do a callibration run that records a table of corrections to the readings. These corrections are then added/subtracted from the readings to give an absolute result?
I do note that your question concers pin variations - and it is a good question. In my experience with the sun tracker the variation between channels (PORTA) plus the LDRs was quite small- about 2 parts in 255. If you are getting large variations I guess something is wrong? I think a hunt through the PIC MCU documentation "electrical charcteristics' may be useful?
Surley a simple RCTIME test will sort this out?
Regards Bill Legge
Bookmarks