Re: analog inputs using 4-20mA current

175 views
Skip to first unread message

Ytai Ben-Tsvi

unread,
Oct 5, 2012, 12:54:44 AM10/5/12
to ioio-...@googlegroups.com
Just connect the resistor from the sensor output to GND. Also connect the sensor output to the IOIO pin. A 150 ohm resistor would scale 20mA to 3V, which is the right range for the IOIO's analog input. The voltage is sampled between the analog pin to GND. Not sure what you mean by floating ground exactly, but in case you want to isolate the IOIO GND from the sensor GND, there are chips that do that. It really depends on what your design goals are here (protection? different levels?). This IOIO inputs take negligible current compared to what you're talking about.
I would help if you give more info on your application (which sensor, what requirements).

On Thu, Oct 4, 2012 at 9:37 AM, Amiram Barimboim <amir...@gmail.com> wrote:
Hi Itai

I'm new to the development world and will be happy if you can assist me
i just bought 2 ioio (probabley will burn one :) ) and try to understand how to work with it
i would like to connect a signal from sensor which as an mA output ( 4mA = 0 ; 20mA = Full scale exp: low temp = 0 (4mA) ; Full scale = 50ºC (20mA)

each sensor have power supply and for that case i believe i need to connect shunt resistor in order the analog signal as voltage
1. Where shuold i connect the shunt resistor?
2. how the analog input is sampling the voltage +/-?
3. what to do if the sensors has floating ground?
i hope it is not too much but i could use a drawing  how to sample. also what is the max current to the input? to be able to choose correct resistor
thanks
Amiram

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ioio-users/-/REY-Te2sOwUJ.
To post to this group, send email to ioio-...@googlegroups.com.
To unsubscribe from this group, send email to ioio-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ioio-users?hl=en.

Amiram Barimboim

unread,
Oct 6, 2012, 3:33:42 AM10/6/12
to ioio-...@googlegroups.com
thanks a lot Ytai
I'm using 22V sensor and it has only 2 wires, which power the sensor. The current changes according the sample envoirment changes (for exp: pressure)
It has to get 22V and i have sample the resistor i believe after dividing the voltage, because of power input limitati
sorry if I'm not that clear. is there a way to contact you directly?
thanks again
Amiram
Message has been deleted

ingdarciac

unread,
Oct 7, 2012, 1:07:45 PM10/7/12
to ioio-...@googlegroups.com
Hi again, check this post in the first case.


Ok, the supply voltage you tell us is 22V, at 20mA the voltage that you need in the shunt resistor is 3.3V in the worst case for measuring in the A/D.

Rshunt = 3.3V/20mA = 165 Ohms, comercially you find a resistor of 160 Ohm giving 3.2V at 20 mA.

In the other case Vshunt= 160Ohms*4mA = 0.64V

You must connect an A/D pin of the IOIO in the positive terminal of the shunt Resistor, I recommend you measure this circuit with a multimeter before you connect to the IOIO.

Making the Software in eclipse when you read the A/D pin, You need to do a conversion from Voltage to the variable that you need.

For Example at 3.2V-3.3V indicates 50°C and 0.64V indicates 0°C, the function could be T(°C)= 18.797x-12.03 

Where x is the reading in the A/D.  

Amiram Barimboim

unread,
Oct 11, 2012, 12:45:57 PM10/11/12
to ioio-...@googlegroups.com
thanks a lot for your reply
from what you have posted, I beleive it is okay to connect the 22V external votage and connect the GND together with the IOIO GND
thanks again for your help
4-20mA connection.png

Ytai Ben-Tsvi

unread,
Oct 11, 2012, 1:21:56 PM10/11/12
to ioio-...@googlegroups.com

Should be fine as long as your shunt is spec'd correctly and the current is indeed within the said range.

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ioio-users/-/fmA4I_rOYQ8J.

Amiram Barimboim

unread,
Oct 13, 2012, 4:02:15 AM10/13/12
to ioio-...@googlegroups.com
Hi again,
well unfrtunalty, i burd one card :(, but it was due to bad conection :)
I'm using a new baord (more carefully now), I connected as suggested and downloaded a ready sw by Michael http://mitchtech.net/android-ioio-dual-analog-input 
As soon as i operate it, the values on x ; y flickers! and i see no changed in the reading values 4.0 mA and 4.65mA which should give me a valid value.
i tested the sw with 2 rotary potentiometers--> saw the changes but always the values flickes. since 4.0 and 4.1mA should be recodnized as different value.
I'll be happy to get some feedback how to get a steady readings maybe hw (diode) or sw average?
thanks for helping
Amiram
p.s what if i used 10 inputs and 4 relays driven outputs at the same time? will the board operate correctly? or there are some limitation?

Ytai Ben-Tsvi

unread,
Oct 14, 2012, 1:46:29 AM10/14/12
to ioio-...@googlegroups.com
On Sat, Oct 13, 2012 at 1:02 AM, Amiram Barimboim <amir...@gmail.com> wrote:
Hi again,
well unfrtunalty, i burd one card :(, but it was due to bad conection :)
I'm using a new baord (more carefully now), I connected as suggested and downloaded a ready sw by Michael http://mitchtech.net/android-ioio-dual-analog-input 
As soon as i operate it, the values on x ; y flickers! and i see no changed in the reading values 4.0 mA and 4.65mA which should give me a valid value. 
i tested the sw with 2 rotary potentiometers--> saw the changes but always the values flickes. since 4.0 and 4.1mA should be recodnized as different value.

It is normal for the analog input to be a little noisy, but only by a few mV. How much variation are you seeing?
 
I'll be happy to get some feedback how to get a steady readings maybe hw (diode) or sw average?

You can certainly average or put a small capacitor on the input, but first it is recommended to understand why you have the noise in the first place...
 
thanks for helping
Amiram
p.s what if i used 10 inputs and 4 relays driven outputs at the same time? will the board operate correctly? or there are some limitation?

Should be good.
 

On Thursday, October 11, 2012 7:21:58 PM UTC+2, Ytai wrote:

Should be fine as long as your shunt is spec'd correctly and the current is indeed within the said range.

On Oct 11, 2012 9:45 AM, "Amiram Barimboim" <amir...@gmail.com> wrote:
thanks a lot for your reply
from what you have posted, I beleive it is okay to connect the 22V external votage and connect the GND together with the IOIO GND
thanks again for your help

On Sunday, October 7, 2012 7:07:45 PM UTC+2, ingdarciac wrote:
Hi again, check this post in the first case.


Ok, the supply voltage you tell us is 22V, at 20mA the voltage that you need in the shunt resistor is 3.3V in the worst case for measuring in the A/D.

Rshunt = 3.3V/20mA = 165 Ohms, comercially you find a resistor of 160 Ohm giving 3.2V at 20 mA.

In the other case Vshunt= 160Ohms*4mA = 0.64V

You must connect an A/D pin of the IOIO in the positive terminal of the shunt Resistor, I recommend you measure this circuit with a multimeter before you connect to the IOIO.

Making the Software in eclipse when you read the A/D pin, You need to do a conversion from Voltage to the variable that you need.

For Example at 3.2V-3.3V indicates 50°C and 0.64V indicates 0°C, the function could be T(°C)= 18.797x-12.03 

Where x is the reading in the A/D.  

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ioio-users/-/fmA4I_rOYQ8J.
To post to this group, send email to ioio-...@googlegroups.com.
To unsubscribe from this group, send email to ioio-users+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/ioio-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ioio-users/-/u-SeqZKUfLgJ.
Reply all
Reply to author
Forward
0 new messages