henmina53
Posts: 20
Joined: Thu Apr 05, 2018 4:49 am

Xbee Connection with 4-20 MA with RASPBERRY PI interfacing

Thu Apr 05, 2018 11:02 am

Hi all as i am going through one of my new project

I am having problems reading some 4-20 ma sensors with Xbee AIO Adapter.

I can read correct values of sensors with raspberry pi using a 250 ohm resistor to convert 4-20ma to 1-5V and applying +12V to the sensor with and external power supply.

I can see how change the value when i apply heat to the sensor by directly connecting with Rsapberry pi

But when i connect the sensor to Xbee AIO Adapter in 4-20ma mode, its reads always the same value . This value read by sensor is not changing the value when i apply heat to the sensor.

I am not able to understand where i am facing the issue

Bruce_Pi
Posts: 20
Joined: Tue Feb 21, 2017 5:09 pm

Re: Xbee Connection with 4-20 MA with RASPBERRY PI interfacing

Fri Apr 06, 2018 3:21 pm

If you want to use a resistor to read 4-20mA you will need an analog to digital converter as well.
as you know raspberry pi doesn't have any ADC inputs. You can get an i2c ADC board.
Once you have these all you will need to do is install resistor in the shut position and read the ADC values. If you want to send these values wirelessly you can use XBee with the same setup. All you will need do is read the values over i2c and send them over over.
or you can get a board which connectes directly with pi and reds 4-20mA like this one
https://store.ncd.io/product/4-channel- ... ni-module/
and a raspberry pi xbee shield
https://store.ncd.io/product/i2c-shield ... xbee-port/

danjperron
Posts: 3511
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Xbee Connection with 4-20 MA with RASPBERRY PI interfacing

Fri Apr 06, 2018 3:45 pm

can read correct values of sensors with raspberry pi using a 250 ohm resistor to convert 4-20ma to 1-5V and applying +12V to the sensor with and external power supply.
Obviously you have already a A/D converter to the Raspberry Pi
But when i connect the sensor to Xbee AIO Adapter in 4-20ma mode, its reads always the same value . This value read by sensor is not changing the value when i apply heat to the sensor.
Now it is a little bit more complicated. Which Xbee do you have. Xbee series1?
If I remember well, the analog input from the first Xbee is transfered to a PWM output of the other Xbee. What did you do to convert the PWM to analog and then read it from the Raspberry Pi.

Could you provide a schema, picture and settings of your Xbees.
Also which mode are you using for your Xbee communication.

Return to “Beginners”