I am new to the forum so I apologize if I am incomplete in my problem statement.
I am currently trying to read values from a pressure sensor in real time. I have a pressure transducer, an ADS1115 chip, an I2C shield and an Arduino uno.
I followed the tutorial from ncd.io for the setup of the Arduino script. The url is listed below.
I copied that file and ran the script in the ide.
So here are where the problems begin....
According to the website, The raw analog values I am supposed to be seeing are 6430 for 4 ma and 32154 for 20 ma. I am not seeing those values at all. The attached png file shows what I am seeing on the serial monitor. Channel 0 immediately shows a real high analog value when the sensor is connected. The sensor is also attached to a power source.
I am honestly not sure what I am doing wrong here.
Additionally, when there is nothing plugged in to the current receiver the analog output for channel 0 is around 212.
The printouts in the png do not match the printout format of the example on the website. Please post the code you are running in tags in addition to a schematic
The script that I am using is shown below. It is similar to the one on the website I linked but I wanted to see all the channel outputs.
As for the schematic, I am not sure how to really draw it. I mean the Arduino is attached to the i2c shield. The i2c shield is attached to the current receiver (The ADS1115) and the current receiver has the output wire and the ground wire from the sensor. I can draw a crude graphical picture of the layout if that is alright.
The crude graphic is added as an attachment. I am sorry but I am not an electrical engineer by trade so schematics are not my strong suit.
I've not used the ADS1115 so I'll leave the code to others. I did notice A0 is at max for a a signed int 16 (aka int16_t)
For basic troubleshooting you might disconnect the inputs to the ADS1115 and ground A0. It should read 0 or a very low number. If not you should work with the code and the ADS1115 board. If it is OK then add piece by piece until you find something that is not working the way you think.
Do you have a multimeter? If not you should get one. Even a cheap one will help you in these cases. You could measure the voltage at A0 and see what it is.
In general its helpful to build your system piece by piece testing at each stage. It makes getting your project going easier and can save a few damages parts along the way.
The ADS1115 is an absolute/voltage A/D, and can't measure currents directly.
You need a resistor of specific value to first convert current to voltage.
And some more parts to protect the input of the ADS.
In your post I didn't see any links to parts, circuit diagram, pictures, or correctly posted code.
If you don't post according to the forum guidelines it's unlikely that you will end up with a proper answer.
Go read them. They are on top of every main page.
Leo..
The parts I purchased were from the url on my initial post. I purchased the current loop receiver and i2c shield from there. The code was also added as an attachment but I can post it again in the tags. The diagram is also an attachment as well. Like i said before I am not an electrical engineer by trade so I am not the best with circuit diagrams.
Many types of sensors on that page, I guess (bad) that you actually have the 4-20mA version.
And I still have to guess from the blurry pictures how you have connected this.
Where did you get the information for the sensor wires (colours). Can't find it on that useless website.
Good idea to measure the voltage between INPUT/GND of the ADS module.
Should be about 0.4volt without pressure.
Leo..
Sorry about the pictures. I was trying to resize them so that I could share them with you. I will resend the physical setup picture as soon as I can.
The way the wires are setup is as follows.
The white wire is the 4-20 ma output, the blue wire was labeled NC on the transducer. The black wire is power and brown is the other NC wire which I assume means ground.
I don't have a multimeter. Is it not possible to read values with the Wire library?
Jon12453:
The white wire is the 4-20 ma output, the blue wire was labeled NC on the transducer. The black wire is power and brown is the other NC wire which I assume means ground.
Sensors with a 4-20mA current output normally only use two wires.
One for power and one to the receiver input.
Sensor power ground normally only goes to ground of the receiver.
Better email the shop that you got the wire harnass from, and ask them for clarification.
Put a $20.00 DMM on your Christmas wishlist.
Leo..
Thank you for the responses. You might be right in that I needed to find a cable that has only two wires. I am going to do some more research into this. If I find out anything else, I will let you know. I am also going to put in an order for a multimeter.
"NC" probably means "NoConnection".
The spare wires in that harnass are likely for sensors with a voltage output (need three wires for that).
Just leave the NC labled wires unconnected.
I would make sure before connecting things like that.
Don't know how well the sensor and that ADS board are protected against wiring mistakes.
Leo..
I have a couple of questions after doing some additional research.
So i was looking at the ADS1115 specs and saw that it has an onboard 16v supply. Would i connect the power wire there? If so, i am not seeing an obvious place to put the supply voltage wire.
I also managed to get a multimeter at work. With nothing connected and chip powered on the pins are reading 16v on ads1115. I dont think that should be happening.
There was a poster who suggested grounding A0 for basic troubleshooting. When I try to ground A0 (I am assuming this is the "IN" pin at the front of the board next to ground). The analog values skyrocket.
Didn't that module come with instructions.
It seems that that module already has a sensor supply buildin.
If so, then you just have to connect the two wires of the sensor (power and output) directly to the module.
Nothing else needed, no external supply.
Labling is confusing/backwards. IN seems to be power out (in for the sensor), and GND seems to be input for the ADS1115 (ground/return for the sensor).
The resources tab for this module links to a Github page with a different module.
Not helpful either.
Leo..