I am fairly new to Raspberry and Coding/electro-engineering in general but wanna get it done anyways. I've some questions regarding reading data from analog sensors.

Background: I got an AD/DA-high-precision-board from Waveshare which is already connected to the Raspberry Pi 3B+ and is delivering some data. Unfortunately this data seems to be way off the expected results.

Current status: the Sensor is a Lux-sensor which has three cables (positive, negative, ground - I guess) and I attached one of them to AGND and the other to a GPIO. The data isn't right though.


  1. If I run the Board-Code (which is on their website High-Precision AD/DA Board) seemingly random numbers appear (see in the picture) Why's that?

  2. If I connect the GPIO's with the sensor, the data behaves like it's AC but it's 100% DC

Also, I don't think it's anything wrong with the sensor because the Voltmeter is able to detect 10 mV (when in Sunlight) and about 0.1mV (when it's dark) on the sensor.

The AD/DA-Board

The AD/DA-Board

The Wires from the sensor

The wires from the sensor

The Board-Code with data, but nothing is connected to the GPOI's

Test output

The Sensor (Lux-meter)

Lux meter sensor

  • 1
    You should probably only have one question per, well, question. There are a couple of things here that with a slight bit of research you could remove. For example, causing a short between VCC and GND is rarely a good thing to do. You do need to connect the gnd of the Pi and the gnd of the A2D or you'll have problems.
    – NomadMaker
    Commented Jul 25, 2018 at 11:16
  • 1
    The three wires of the sensor are typically power, ground, and signal.
    – NomadMaker
    Commented Jul 25, 2018 at 11:18
  • Ok, sorry. Let me narrow it down for you since i found some stuff out in the last hour. Forget the Volt questions, i was mistaken. The Voltmeter shows 10mV, not 10V. I also noticed that the board has a default Vref with 5V (from the Raspberry) My main problem, which i just can't figure out, is - why the programm shows me 0-2mV when liteally nothing is attached to it. That seems so wrong. Commented Jul 25, 2018 at 11:18
  • It would help a lot to have links to the A2D board and the sensor.
    – NomadMaker
    Commented Jul 25, 2018 at 11:20
  • Please wait a minute, i'll upload some pictures and edit my question. Commented Jul 25, 2018 at 11:23

1 Answer 1


I'll take a shot at this.

  1. You can test this with the on board variable resister (ADJ) or the onboard photocell (LDR). First, remove all normal sensors. Second, short the ADJ and AD0 pins of the rightmost header. Third, short the LDR and AD1 pins of that header. Then you can measure the voltage of the builtin sensors of the board. Use the knob on the lower right to adjust the resister. Change the overhead lighting to change the photocell. If you can't get these to work, it might be a problem with your programming or the pi.
  2. You have just shorted the power supply. Be thankful that your Pi still works. It's rarely a good idea to short Vcc and Gnd.
  3. Why are you insisting on connecting Vcc and Gnd? Putting a resister between them still allows current to flow, therefore wasting power. Is there something other than the resister?
  4. Make sure that you have the sensor hooked up properly and powered properly. Do the test I suggested in #1. A picture of your sensor might help, and a link to a datasheet or descriptinon.
  5. Vref is a known voltage. I would run the A2D board on 3v3 if possible or 5 if not. But I would use the Vcc as the reference voltage. Though if the Vcc (power to the module, I'm guessing) is 5v, you might need a level converter to use it safely on the Pi.
  6. (optional) If you don't know which channel you are using, you can't read it properly. So experiment and find out. Use your light sensor and try those two readings on each sensor channel. The one that gives the expected results for that sensor (as determined in #1) is the channel. I would start with the left-most connector on the board and assume this is channel 0. But test, and find out if it is the first or last channel. They might have a strange numbering scheme, but most likely it will be ordered.
  • First of all: Thanks for your help and time! 1) Are you sure this isn't a sensor which doesn't require power to run? Because i can measure Voltage & it's not connected to any power source 2) Oh, lol 3) Well I thought i might need a constant power source to have a proper Vref but yeah, you're right i'll try differently next time. I also find out that the board has a default Vref = 5V so i think im good 5) Good idead, I'll do that 6) Yeah, right. I know which channel it is on the programm from waveshare but i don't know which pin it is so i'll experiment, just as you suggested Commented Jul 25, 2018 at 12:09
  • I've done the test but it doesn't really seem to work. The Voltage measured on the GPIO is higher than the others but still bounces around like crazy and doesn't react if i put the sensor in sunlight or not. My other sensor (Par-Sensor) shows the same behavior. Commented Jul 25, 2018 at 12:19
  • Then things are hooked up incorrectly. Does the +5v and +3v3 measure at 5v and 3v3 respectively?
    – NomadMaker
    Commented Jul 25, 2018 at 15:31
  • The Voltage seems to be correct. VCC-Ground = 5,3V (hooked up to 5V). 3,3V-Ground = 3,3V. Commented Jul 26, 2018 at 7:55
  • Hi again! I managed to get some results from the sensor. It now shows me the correct Voltage-difference (+- 0.4mV). What I've done is to hook up the two sensor cables to A0 and A1 and putting a jumper on A0-ADJ. I then darkened the Lux sensor (=0V) and tried to achieve that A0 and A1 are the same value. I then put light on the sensor (meter -> 8mV) and the voltage-difference between A0 and A1 was almost exactly 8mV. So far so good but can't i just somehow put all channels (A0-A7) equal zero and do the same thing? Commented Jul 26, 2018 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.