Chandru42
Posts: 18
Joined: Fri Apr 13, 2018 7:23 am

Interfacing a Draw wire Sensor with Raspberry pi

Mon Apr 16, 2018 8:00 am

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 381 times

    markkuk
    Posts: 57
    Joined: Thu Mar 22, 2018 1:02 pm

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Mon Apr 16, 2018 9:38 am

    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.

    User avatar
    Gavinmc42
    Posts: 2122
    Joined: Wed Aug 28, 2013 3:31 am

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    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'm dancing on Rainbows.
    Raspberries are not Apples or Oranges

    Chandru42
    Posts: 18
    Joined: Fri Apr 13, 2018 7:23 am

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Mon Apr 16, 2018 10:58 am

    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?

    scotty101
    Posts: 3176
    Joined: Fri Jun 08, 2012 6:03 pm

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Mon Apr 16, 2018 11:28 am

    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.
    Electronic and Computer Engineer
    Pi Interests: Home Automation, IOT, Python and Tkinter

    Chandru42
    Posts: 18
    Joined: Fri Apr 13, 2018 7:23 am

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Mon Apr 16, 2018 11:50 am

    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?

    markkuk
    Posts: 57
    Joined: Thu Mar 22, 2018 1:02 pm

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    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.

    scotty101
    Posts: 3176
    Joined: Fri Jun 08, 2012 6:03 pm

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    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
    Electronic and Computer Engineer
    Pi Interests: Home Automation, IOT, Python and Tkinter

    Chandru42
    Posts: 18
    Joined: Fri Apr 13, 2018 7:23 am

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Mon Apr 16, 2018 12:11 pm

    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 ?

    Chandru42
    Posts: 18
    Joined: Fri Apr 13, 2018 7:23 am

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Mon Apr 16, 2018 12:12 pm

    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!!!!

    Chandru42
    Posts: 18
    Joined: Fri Apr 13, 2018 7:23 am

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    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.

    scotty101
    Posts: 3176
    Joined: Fri Jun 08, 2012 6:03 pm

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    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.
    Electronic and Computer Engineer
    Pi Interests: Home Automation, IOT, Python and Tkinter

    Chandru42
    Posts: 18
    Joined: Fri Apr 13, 2018 7:23 am

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Mon Apr 16, 2018 12:55 pm

    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...

    boyoh
    Posts: 1175
    Joined: Fri Nov 23, 2012 3:30 pm
    Location: Selby. North Yorkshire .UK

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    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
    BoyOh ( Selby, North Yorkshire.UK)
    Some Times Right Some Times Wrong

    Chandru42
    Posts: 18
    Joined: Fri Apr 13, 2018 7:23 am

    Re: Interfacing a Draw wire Sensor with Raspberry pi

    Tue Apr 17, 2018 2:36 pm

    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. ;)

    Return to “Beginners”