Indo Analogue_In does not work with our sensor
Hi,
We have an issue when reading values from our vibration sensor, we are using a transformer to pass 24V to the sensor, when we put our sensor on CH1 and use Industrino INDO library example Analogue_In it gives us ‘read failed’ error with constant value of 35.050 mA_p that displays without the sensor and if we test with use Industrino INDO library example Indio_Analogue Calibration it also gives us ‘read failed’ error with measured 2047 (raw). Below is a sample of our code:
#include <Indio.h>
#include <Wire.h>
float sensorVal1;
void setup()
{
Serial.begin(9600);
while (!Serial)
{
// wait for serial port to connect. Needed for Leonardo only
}
Indio.setADCResolution(18); // Set the ADC resolution to 18bit@3.75SPS.
Indio.analogReadMode(1, mA_p); // Set Analog-In CH4 to % mA mode (4-20mA -> 0-100%)
}
void loop()
{
sensorVal1=Indio.analogRead(1); //Read Analog-In CH1 (output depending on selected mode)
Serial.print("CH1: "); //Print "CH" for human readability
Serial.print(sensorVal1, 3); //Print data in 3 decimal places
Serial.print(" "); //Add some " " space
Serial.print("\r\n"); // Print a new line to serial.
}
We are powering the sensor from 24V transformer and also the INDIO from the same. Connecting the 2 grounds make no difference.
Please assist us with the solution, thank you.
The same sensor works in another arduino environment with 4-20 ma input. We tried all modes in Indio but nothing. I can send you specs on Monday. Thanks.
I'm having a similar problem. I tried to read a 5V signal, and didn't succed. 24V input is active. I set Analog Out to 5 V and it's ok. Then, to test, I connected Analog Output 5V to Analog Input 5V and bridged both gorunds, tested 5 V at the exit and having no reading in Analog Input.
Any sugestion?
Hi Joaquin, can you try with the INDIO demo code https://github.com/Industruino/democode/tree/master/IndustruinoDemoCode_D21G and let us know if that works. If not, send a picture of your wiring (by email please)
Can you please confirm that the Ind/IO Industruino is powered using 24v. I have had similar read failed errors when I have only connected the IND I/O board using USB and not powered it.
Hi,
mA_p has a bad reputation. We rather use mA_raw then translate from the multiples of 2 generated (in your case your top of scale would be 2^18).
Keep in mind reading at 18 bits is much slower than, say, 14 bits.
Hope this helps
Didier, eControls
Oops wait ! I just read the return of your input will be 4096 anyway, as a float, and the precision will be enhanced through decimals.
The error message we were getting was Measured 2047 raw and the values with and without the sensor were:
CH1: 5.548 read failed
CH2: 55.360 read failed
CH3: 11.006 read failed
CH4: 35.030 read failed
Thanks
Hi,
did you try to initialize the 4 IN channels with function analogReadMode. I've faced to a similar issue solved with this full initialization (example libraries\Indio\examples\Indio_AnalogIn)
Best Regards
Olivier
Sadly it does not work. Data always the same and says read failed CH1: 5.548 read failed CH2: 55.360 read failed CH3: 11.006 read failed CH4: 35.030 read failed CH1: 5.548 read failed CH2: 55.360 read failed CH3: 11.006 read failed CH4: 35.030 read failed CH1: 5.548 read failed CH2: 55.360 read failed CH3: 11.006 read failed CH4: 35.030 read failed CH1: 5.548 read failed CH2: 55.360 read failed CH3: 11.006 read failed CH4: 35.030 read failed CH1: 5.548 read failed CH2: 55.360 read failed CH3: 11.006 read failed CH4: 35.030 read failed .... Thanks
No luck. The sensor is working in another environment so its not the sensor. Is as if the INDIO does not want to take any data from Analog Channels.
Your answer
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
Keep Informed
About This Forum
This community is for professionals and enthusiasts of our products and services.
Read GuidelinesQuestion tools
Stats
Asked: 1/19/17, 7:28 AM |
Seen: 3711 times |
Last updated: 4/13/18, 11:00 AM |
Please give brand and model of sensor. Also check your analog is not faulty by reading in other modes.