Page 1 of 1

Interfacing a Draw wire Sensor with Raspberry pi

Posted: Mon Apr 16, 2018 8:00 am
by Chandru42
The project is to find the displacement of a moving rod in one of our company's tool. My task is to give the sensor output to raspberry Pi and obtain a graph between Displacement Vs Time.

For this i have chosen this as my position sensor.

https://www.waycon.biz/fileadmin/draw-w ... sor-FX.pdf

This is my first project that i am going to do it all alone. I am a beginner and i have only theoretical knowledge i wish to develop myself better by doing many projects. So i would like to get few things clarified.
    In the senor data sheet, I have seen that voltage supply is 4,9...30 VDC. What does that mean? Is it like the sensor needs a voltage supply of 30 V to function?

    How to connect the sensor output cable to raspberry pi physically? Do i need to use any connector like thing to connect the sensor with raspberry Pi? or is there any other way to connect it perfectly?
    2018-04-16 09_52_55-Installation Guide Draw Wire Sensor FX.jpg
    Sensor output cable imag
    2018-04-16 09_52_55-Installation Guide Draw Wire Sensor FX.jpg (32.07 KiB) Viewed 703 times

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Mon Apr 16, 2018 9:38 am
    by markkuk
    Chandru42 wrote:
    Mon Apr 16, 2018 8:00 am
    In the senor data sheet, I have seen that voltage supply is 4,9...30 VDC. What does that mean?
    It means that the supply voltage must be at least 4.9 Volts, but not more than 30 Volts.
    Chandru42 wrote:
    Mon Apr 16, 2018 8:00 am
    Is it like the sensor needs a voltage supply of 30 V to function?
    No.
    Chandru42 wrote:
    Mon Apr 16, 2018 8:00 am
    How to connect the sensor output cable to raspberry pi physically?
    The sensor output is an analog voltage beween 0 and 10 Volts. You can't connect that directly to a Raspberry Pi because there are no analog inputs on a RPi. You need an external analog to digital converter circuit. You should use at least 12-bit ADC to match the resolution of the sensor.

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Mon Apr 16, 2018 10:08 am
    by Gavinmc42
    Resistor voltage divider will get the 10V down to a voltage a 3V3 i2C ADC can read.

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Mon Apr 16, 2018 10:58 am
    by Chandru42
    Thanks a lot for your Answer!!!
    • You have told that a supply of 4.9 volts is enough to power the sensor. Can you please give me an idea of how to power the sensor? I mean is it possible to use an external power supply for sensor ?
    • The analog output of the sensor is from 0-10 V. Also, I have read that the raspberry pi can withstand only 3.3. volts , and it will blow the pi if the voltage exceeds. is it true? if true, is there any other way to connect it?

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Mon Apr 16, 2018 11:28 am
    by scotty101
    Chandru42 wrote:
    Mon Apr 16, 2018 10:58 am
    • The analog output of the sensor is from 0-10 V. Also, I have read that the raspberry pi can withstand only 3.3. volts , and it will blow the pi if the voltage exceeds. is it true? if true, is there any other way to connect it?
    Gavinmc42 wrote:
    Mon Apr 16, 2018 10:08 am
    Resistor voltage divider will get the 10V down to a voltage a 3V3 i2C ADC can read.

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Mon Apr 16, 2018 11:50 am
    by Chandru42
    Gavinmc42 wrote:
    Mon Apr 16, 2018 10:08 am
    Resistor voltage divider will get the 10V down to a voltage a 3V3 i2C ADC can read.
    So the sensor output has to be connected to Voltage divider and then it has to be connected to ADC. What does I2C mean? is there any programming that i should use to make i2c connection?
    Can you please explain this a little bit more?

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Mon Apr 16, 2018 11:58 am
    by markkuk
    Chandru42 wrote:
    Mon Apr 16, 2018 11:50 am
    So the sensor output has to be connected to Voltage divider and then it has to be connected to ADC.
    Yes.
    Chandru42 wrote:
    Mon Apr 16, 2018 11:50 am
    What does I2C mean?
    https://en.wikipedia.org/wiki/I%C2%B2C
    Raspberry Pi has an I2C interface on pins 3 and 5 of the GPIO connector.
    Chandru42 wrote:
    Mon Apr 16, 2018 11:50 am
    is there any programming that i should use to make i2c connection?
    You can use libraries like pigpio or WiringPi to access i2c devices.

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Mon Apr 16, 2018 12:03 pm
    by scotty101
    Or if you use ADC supported by gpiozero, you can use its built in support for reading from ADCs
    https://gpiozero.readthedocs.io/en/stab ... entiometer

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Mon Apr 16, 2018 12:11 pm
    by Chandru42
    markkuk wrote:
    Mon Apr 16, 2018 11:58 am
    Chandru42 wrote:
    Mon Apr 16, 2018 11:50 am
    So the sensor output has to be connected to Voltage divider and then it has to be connected to ADC.
    Yes.
    Chandru42 wrote:
    Mon Apr 16, 2018 11:50 am
    What does I2C mean?
    https://en.wikipedia.org/wiki/I%C2%B2C
    Raspberry Pi has an I2C interface on pins 3 and 5 of the GPIO connector.
    Chandru42 wrote:
    Mon Apr 16, 2018 11:50 am
    is there any programming that i should use to make i2c connection?
    You can use libraries like pigpio or WiringPi to access i2c devices.
    Thank you very much for your Quick response. I really appreciate it. You have told that a supply of 4.9 volts is enough to power the sensor. Can you please give me an idea of how to power the sensor? I mean is it possible to use an external power supply for sensor ?

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Mon Apr 16, 2018 12:12 pm
    by Chandru42
    scotty101 wrote:
    Mon Apr 16, 2018 12:03 pm
    Or if you use ADC supported by gpiozero, you can use its built in support for reading from ADCs
    https://gpiozero.readthedocs.io/en/stab ... entiometer
    Thanks a lot for the quick response. i will check into that!!!!

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Mon Apr 16, 2018 12:40 pm
    by Chandru42
    Gavinmc42 wrote:
    Mon Apr 16, 2018 10:08 am
    Resistor voltage divider will get the 10V down to a voltage a 3V3 i2C ADC can read.
    i know that voltage divider cirucit can be made easily by chossing correct resistors. But i would like to know is there any ready made chips to do this job so that it can be connected very easily with raspberry pi.

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Mon Apr 16, 2018 12:43 pm
    by scotty101
    Chandru42 wrote:
    Mon Apr 16, 2018 12:40 pm
    Gavinmc42 wrote:
    Mon Apr 16, 2018 10:08 am
    Resistor voltage divider will get the 10V down to a voltage a 3V3 i2C ADC can read.
    i know that voltage divider cirucit can be made easily by chossing correct resistors. But i would like to know is there any ready made chips to do this job so that it can be connected very easily with raspberry pi.
    Not really. You "could" find an ADC that is capable of reading 10V (max) which can also communicate with the Pi at 3.3v (but I don't think any exist, not that I can find anyway)
    Generally speaking, people use either passive components (voltage dividers) or active components (operational amplifiers etc) to change the voltage to something that is in the correct range.

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Mon Apr 16, 2018 12:55 pm
    by Chandru42
    scotty101 wrote:
    Mon Apr 16, 2018 12:43 pm
    Chandru42 wrote:
    Mon Apr 16, 2018 12:40 pm
    Gavinmc42 wrote:
    Mon Apr 16, 2018 10:08 am
    Resistor voltage divider will get the 10V down to a voltage a 3V3 i2C ADC can read.
    i know that voltage divider cirucit can be made easily by chossing correct resistors. But i would like to know is there any ready made chips to do this job so that it can be connected very easily with raspberry pi.
    Not really. You "could" find an ADC that is capable of reading 10V (max) which can also communicate with the Pi at 3.3v (but I don't think any exist, not that I can find anyway)
    Generally speaking, people use either passive components (voltage dividers) or active components (operational amplifiers etc) to change the voltage to something that is in the correct range.
    Thank you so much!!!! I will try to implement it soon...

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Mon Apr 16, 2018 9:45 pm
    by boyoh
    This project is well beyond your capability, due to your lack of understanding of basic electronics
    A course in basic electronics is you next step, You know what you want. But lack the ability to put
    it in to practice

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Posted: Tue Apr 17, 2018 2:36 pm
    by Chandru42
    boyoh wrote:
    Mon Apr 16, 2018 9:45 pm
    This project is well beyond your capability, due to your lack of understanding of basic electronics
    A course in basic electronics is you next step, You know what you want. But lack the ability to put
    it in to practice
    Thanks for your feedback . i will work on that. ;)