05-30-2023 02:55 PM
For example, when I try to have arduino read 5 volts coming from the power supply, it would read 1.2 V as you can see on the waveform chart below. What am I doing wrong? Also, I'm using the example from the Linx package.
Code
05-30-2023 04:32 PM
Which Arduino board are you using? And is your power supply input properly grounded? A lot of bench power supplies generate floating voltages, so you may need to tie a wire from the (-) terminal to the Arduino's ground.
06-06-2023 06:29 PM - edited 06-06-2023 06:30 PM
Hi BertMcmahan ,
thanks for answering. Yes, I connected the negative of the power supply to the ground. I am not sure what is going on. I am using arduino uno.
06-07-2023 10:21 AM
I wonder if it got set to use the 1V reference instead of the 5V reference. This is an older Help file but it might be something to look at:
In short, the ADC actually measures a value relative to a reference voltage and returns that value. If your input is pegged at 1V, then you might be measuring relative to the 1V reference.
There's also an external input (AREF) that can be used for comparison: https://www.instructables.com/The-Arduino-AREF-Pin/
I haven't used it myself. Is there any chance something's connected to your AREF pin? Or is the Uno completely by itself? If you have a shield on it, that shield might be doing something to that pin.
Unfortunately I can't find good documentation for the LINX toolkit to know what analog reference it uses by default, but going by this page (https://reference.arduino.cc/reference/tr/language/functions/analog-io/analogreference/) I can assume that "Default" uses the internal 5V reference, "Internal" uses the internal 1.1V reference, and "External" uses the AREF pin.
Your system is acting like it's using "Internal", so maybe try explicitly setting it to "Default".
I don't have the LINX toolkit installed or I'd give it a go myself, sorry.