12th Anniversary Sale 12% Off in July & August with the voucher code "SUMMER12" *excludes trade customers
Support Forum
or

# Physical Sensor termination on ADC-DAC Pi Zero

The ADC-DAC Pi Zero is a 2 Channel ADC and 2 Channel DAC for the Raspberry Pi

652 Views - Created 21/10/2021

21/10/2021

Posted by:
agardner

Location:
Perth, Australia

Hi Everyone,

I'm looking to use the ADC-DAC Pi Zero with my Raspberry Pi4 to read the analogue output from the Sharp GP2Y0A41SK0F Analog Distance Sensor 4-30cm

From a physical connection point of view, is this as simple as:

2. Wiring the sensor as below

3. Coding in Python

Many thanks and apologies for the Newbie question.

21/10/2021

Posted by:
andrew

Location:
United Kingdom

According to the datasheet for the sensor, the output voltage can be between 0 and 5V. As the maximum input voltage on the ADC DAC Pi is 3.3V you will need to use a voltage divider between the sensor and the ADC input to reduce the maximum voltage down to a safe level.

We have a resistor divider calculator at Resistor Voltage Divider which you can use to find suitable resistor values. If you use a 1K resistor for R1 and a 1.8K resistor for R2 that would reduce 5V down to 3.21V making it safe to connect to the ADC input.

Using the above resistor values, in your python code, you will need to multiply the ADC voltage by 1.556 to get the correct voltage reading from your sensor.

21/10/2021

Posted by:
agardner

Location:
Perth, Australia

Would you mind rechecking the data sheet for me please? I believe the input is 5v, but the output maxes out at 3.3v (Third page shows the graph)

if that's the case, is my cable termination plan suitable? That is, voltage output of the sensor connected to In1 with the power and ground supplied to the sensor from the pins shown. I am assuming these are active and fed from the pi?

Thanks again and apologies for the basic questions. I'm still learning and have definitely had some expensive lessons when I fry things... :-)

21/10/2021

Posted by:
andrew

Location:
United Kingdom