Posted by Tony Pratt 1 on 29/11/2021 21:34:52:
Hi Dave, thanks for the swift reply! The board is a Sunfounder model Uno R3, the shield has no name that I can see? I have ordered a new board & shield from Amazon to see if the figures make any sense with them, if no go is there any particular brand that is reliable, as most seem to be made in China generics?
Thanks Tony
Yes, you might have a duff Uno or Shield. Values higher than 1023 suggest a hardware failure. My LCD Shield came from DF-Robot, and I've used Sunfounder several times without bother, but the breed do turn up poorly sometimes. I try to avoid the very cheap no-brand boards, but the few I've used have been OK (I think I've only had two failures in over 100 purchases.)
You might try this test program, which can be used to test the Uno because it doesn't need the LCD shield plugged in. Instead it reports to the IDE's Serial Monitor at 9600baud.
Compile and load it onto the bare Uno, then turn the serial monitor on and set the baud rate to 9600 baud.
With nothing plugged into pin A0 should display a random value between 0 and 1023 due to picking up mains hum. Connect a jumper wire from A0 to the 3.3V socket:
Mine read 647 which equates to 3.16V (Maths: v= 647/1023 * 5V)
Reconnecting the jumper from A0 to a Gnd socket should read 0
And connecting the jumper from A0 to the 5V socket should read 1023
DO NOT connect the jumper from A0 to Vin!!! It will probably fry the ADC function,
This proves the UNO is Ok.
Next plug the shield in. The display won't work, but pressing the buttons down for a few seconds should show the ADC level each causes.
Fingers crossed, both work.
I can't think of a reason why A0 should ever read more than 1023. Possibly the ADC circuit behind A0 is has been spiked. They're robust unless fed more than whatever is on the supply rail, which is 5.0V. I've never killed one, but static might do it.
Dave