Dear GHI Community,
I would like to have your opinion and help. I want to use an inclination sensor for my project. I am using the FEZ Spider main-board and want to make sure that the sensor I want to buy will be compatible with this main-board, I want to make sure that I am going to be able to read the sensor’s outputs! I took some time to study the available information on the forum here and on other websites. Here, I just want to ask for your opinion, approval.
The manufacturer (http://www.balluff.com/balluff/MUS/en/home.jsp) offers sensors with two types of output:
[ul]Analog output: 4-20 mA (datasheet: https://dl.dropboxusercontent.com/u/4319292/BSI0004%20(Analog%204..20mA)%20EN.pdf)[/ul]
[ul]Modbus RTU RS-485 (datasheet: https://dl.dropboxusercontent.com/u/4319292/BSI0003%20(Modbus%20RTU%20RS-485)%20EN.pdf)[/ul]
Which output signal type should I choose? What do you think?
Let me quickly describe my understanding of the two possibilities.
I know that the FEZ Spider mainboard has analog inputs that can read a voltage value between 0V DC and 3.3V DC. So, If I choose the 4-20 mA current loop output type of the sensor then I would have to convert this current to voltage, so that the Spider’s analog input can read it. What I think is that I would have to use a 165 Ohm resistor (0.1%, ±15ppm/°C, 250mW) so that the voltage drop across the resistor would be Uhigh = IhighR = (20 mA)(165 Ohm) = 3.3V! The voltage drop when the current is 4 mA would be Ulow = IlowR = (4 mA)(165 Ohm) = 0.66V! So, whenever I read a value of 0.66V then I know that I have 0° inclination angle and whenever I read 3.3V I know that the inclination is equal to 360°. Am I right? Is it really so easy, just use an external resistor and that’s it? Is the measurement going to be precise enough? I really do not need a 0.01° accuracy but 1° is desired, even 2° would be OK. Am I going to achieve this accuracy? My understanding is that I will have a voltage range between 0.66V and 3.3V which makes 2.64V for the measurements. According to a formula presented here (http://www.dataq.com/applicat/articles/adc-resolution.html) I get a resolution of about 0.44° with the 10-bit ADC of the FEZ Spider. Am I right? Can I be sure that I will have an accuracy of 0.5° or let’s say less then 1°? If not, could you please recommend me a better ADC and tell me how to wire it to the FEZ spider? I used the following document that helped me understand the 4-20 mA current loop: http://www.bapihvac.com/content/uploads/2010/07/Understanding-4-20-mA-Current_Loops.pdf
The second option (Modbus RTU RS-485) looks a little bit more difficult/complicated to implement. First of all, the FEZ Spider mainboard does not have any port that can directly read RS-485 signals. So, as I already read in a few topics, I would have to use an RS-232 / RS-485 converter and then use the RS-232 module from GHI. But then I would also have to use some software to read the signals and convert them to inclination angles. One of the possibilities (as discussed in this topic: http://www.ghielectronics.com/community/forum/topic?id=6563) I see here is to use the following library (from Mario Vernari): http://highfieldtales.wordpress.com/2012/04/09/modbus-rtu-added-to-the-cet-open-toolbox/
If I use the library from Mario and a 10€ RS-232 / RS-485 converter, am I going to be able to read the signals and calculate the inclination angle? Another thing I want to ask you if it would be possible to use a RS-485 / USB converter (http://www.amazon.de/Digitus-seriell-Adapter-Verlängerungskabel-Einsetzbar/dp/B00823K7F0/ref=sr_1_8?ie=UTF8&qid=1367998497&sr=8-8&keywords=rs485+rs232+converter) and then use the USB module from GHI to connect it to the FEZ Spider mainboard. Would I still need some external library then?
After my description of the above options, which one should I opt for? What do you think? Should I choose the 4-20 mA analog signal or the Modbus RTU RS-485 digital signal?
If I have to be honest, if the only thing I need for the 4-20 mA analog signal type is a 165 Ohm resistor, then I would choose this option.
Looking forward to receiving your tips and hints for this issue! THANK YOU!