4-20mA sensor simulator is connected to A0 pin of Portenta H7.
When i use map function to scale the signal between 0V and 5V i get the following result
I need urgent support in deciphering what could be wrong. The values are randomly changing without actually turning the knob on the simulator.
For an input value of 1023 i get different values ranges between 0v and 5V.
Hi, many thanks for the reply. I have appended my code and have noticed that one of my issues (multiple analogRead values having multiple results) have been resolved.
My issue is that without the simulator stimulating any value (its at 3.95mA) I get analogRead counts between 0 and 1023. I have about 27000 data points and the screen shot is attached below.
void setup() {
Serial.begin(250000);//initialize the serial port with baud rate
}
void loop() {
int value, result;
value = analogRead(A0);
result = map(value, 0, 1023, 0,5);
Serial.print(value); Serial.write('\t'); Serial.println(result);
}
The Arduino Portenta H7 board follows the MKR form factor, but is enhanced by the addition of two 80 pin high density connectors at the bottom of the board. This ensures scalability for a wide range of applications by simply upgrading your Portenta H7 board to the one suiting your needs!
I am stimulating a 4-20mA sensor using SM1.
SC1 converts the signal from SM1 and gives to Portenta H7 pin A0.
My query is as follows
Without varying SM1 the analogRead(A0) reads between 0 and 1023.
In other words the output mA from SM1 is 4mA but the Portenta pin A0 depicts variation between 0V and 5V.
Could this be a wiring issue some earthing, etc?
The SC1 is tested with a multimeter and the results are as expected when a variation in SM1 then a corresponding variation in SC1 but on the Portenta without a variation in SM1 the read out varies on its own.
You mean the Portenta H7 board power supply?
I have not connected any power supply to the Portenta H7 since it draws its power from the USB C connector when connected to the laptop.
Ran into a new issue. The SM1 is able to stimulate between 4mA and 20mA.
Portenta H7 reads 1023 at 13.5mA therefore from my scaling it's 5V from 13.5mA which is not correct. When i check with a multimeter its perfect.
Any suggestions or configurations will be most welcome.
yes gcjr many thanks i was doing some R&D and found the same.
I was able to adjust the jumpers in SC1 so that 3V is the max that is supplied to the board.
Many many thanks for the support.