![]() |
Forum Index : Microcontroller and PC projects : LCD Backpack/External Reference.
Author | Message | ||||
Phil23 Guru ![]() Joined: 27/03/2016 Location: AustraliaPosts: 1667 |
So after contemplating & reading about using an external VRef, I notice on the Backpacks I'm using that Pins 2 & 3 are already in use for the LCD touch screen. Might for now change my thinking on the solar panel output. Was working towards 1000mV loaded = 1000Watts/m². Maximum unloaded output from the solar panel is about 2.9V. Might try & change the loading resistor to try & get around 2.8 volts when the suns at it's brightest or around 1000W/m². Then just scale it from there for the time being. Phil. |
||||
centrex![]() Guru ![]() Joined: 13/11/2011 Location: AustraliaPosts: 320 |
Hi Phil I dont know what other pins you are using but pins 4,5,26,24 are all analog and free on the backpac. Perhaps these could be used for your requirements. Perhaps not Matherp appears to have pins 2 and 3 locked in to the cfunction. Cliff |
||||
Phil23 Guru ![]() Joined: 27/03/2016 Location: AustraliaPosts: 1667 |
Pin 2 is VRef+ & Pin 3 is Vref- on the PIC, I didn't think other normal AIN pins could be used. Maybe they can, but I don't really know, I just assumed not. I thought the voltage to be measured could be any AIN, but the reference needed Pin 2 as it's the ACD's VRef+. Cheers. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10209 |
Correct I'm afraid - these pins are hardwired in the silicon |
||||
Phil23 Guru ![]() Joined: 27/03/2016 Location: AustraliaPosts: 1667 |
So my alternative could be LM336 connected to say pin 4, Voltage to be measured connected to pin 5. Assuming Pin 4 returned say 3.5 volts, instead of the 3.25, And Pin 5 was returning say 2.65, Corrected voltage would be; 2.46 = 3.25(Ref)/3.5*2.65 Is that going to give me at least better consistency & accuracy? Thanks. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6269 |
trueRef = 2.5 ' might want to get a precise value. myRef = pin(4) ' LM336 myCorrection = trueRef/myRef myreading = pin(5)*myCorrection ' do this for all analog inputs you can also monitor the 3.3V using a voltage divider. Jim Eit. The 3.3 can be determined directly from the reference reading without any other pin getting used. You can monitor other voltages such as the 5V or battery voltage by using voltage dividers. VK7JH MMedit |
||||
Phil23 Guru ![]() Joined: 27/03/2016 Location: AustraliaPosts: 1667 |
Voltages I'm reading still seem all over the shop.... Reading pin 4 I think, with a bit of averaging. Each reading only having a 10% weighting on the previous average.... Volts=volts*100 For n=1 to 10 Volts=Volts+Pin(4) Next n Volts=Volts/110 Still looks pretty ordinary... A few random reading I've observed... MM Volts Actual Volts 520 800 540 750 1060 1350 1300 1500 Have the panel feeding into the MM, with 27 Ohms Shunt, 0.1µF Ceramic across the shunt; Probably way too low??? 3.3V rail on the micro seems rock solid on 3.31V. Any Suggestions for a better result? Thanks Phil. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |