Connect and program esp8266 with arduino

The readings were received with both the pressure sensor and the SIM-ALP2 attached. In both cases, the values should have changed. When the pressure sensor was attached, I varied pressure in the air tank and when I had the current simulator attached, I varied the value between 4 and 20mA.

I could order 1 or 2 of the 4-channel current receivers today if we can figure out the 8-channel. I need to measure both pressure and temperature. I planned to use a temperature transmitter to convert rtd signal to 4-20mA, but I am contemplating instead to use your mcp9600. Now, the manager on the project is getting anxious, so Iā€™m not sure what will happen. It should be the first of many orders as we are taking technology proved out in a pilot plant and building a first commercial unit for sale with potential orders ready to go once they see it working. Iā€™m really sorry for the trouble. I hoped it would just work, but I am not a new born.

Are you providing loop voltage via the SIM-ALP2 generator? I do not think that 8 channel current receiver provides loop voltage so that must be done on the generator.

I was able to solve the problem with the serial port. Now I can read both of the addresses with each ESP8266 board, but Iā€™m still not getting expected output for reading of current.

Yes, 12v is applied in the loop. I have attached an image of the circuit with the pressure sensor. The lines coming in from the left are 12V. I put a voltmeter inline for this image. Its presence does not affect the output I am receiving. The voltmeter is showing 5.14mA. From the code, with 12-bit conversion, the first byte received = 0 and the second byte = 1.

I just ordered a 4-channel ADS1115 receiver and a 4-channel MCP3428. I hope you will continue to work with me to get the 8-channel MCP3428 working. Thank you.

Hi,

Can you share the code you are running on the ESP8266? Perhaps post it to Github, then send a link to it?

It is the code from the included link above that is already on github that Bhaskar recommended and as far as I can tell, submitted. The link to the code on github is included below.

I am running under win7 using arduino IDE v1.8.16.

I utilized both the ā€˜Adafruit Feather HUZZAH ESP8266ā€™ and ā€˜Generic ESP8266 Moduleā€™ under ā€œTools->Boardā€ in the IDE with the same result

I am using the file named MCP3428_OneShot_Conversion.ino as the main file for the project along with the MCP3428.cpp and MCP3428.h files.

I made minor changes, including:

1.) renaming the .h file to .hh
2.) changing the line in both the .ino file and the .cpp file
from #include <MCP3428.h> to #include ā€œMCP3428.hhā€
3.) added #include cstdio with <> around it to the .cpp file so I could add printf statement in the .cpp file
4.) Changed line 21 in .cpp file from wire.begin() to wire.begin(12, 14)
5.) modified line 44 in the above named .ino file to vary the channel, one shot toggle, gain, and/or bit conversion

Here is a link to the code on github:

Best Regards

leave your code as it is and connect your sensor to channel 5

Hi Bhaskar,

Now I am getting numbers. I moved sensor to physical channel 5, left address at 0x68 and specified channel in software as 1. I also changed to GAIN=2.

I am getting numbers slightly higher than what I would expect using the 5813 - 29390 range mentioned on the product page (shown in the third column below), but they seem to be relatively consistent and perhaps a matter of calibration.

The one somewhat troubling issue I am seeing is that a range of values comes from the software, while my voltmeter shows a steady reading in the circuit. (underscore used to format spaces between columns). Following is a table of results:

Voltmeter Reading _____ Sensor Return Value Range _____ Expected Value
5.22 ______________________ 7536 - 8063 ________________ 7561
8.40 _____________________ 10014 - 10592 ______________ 12296
10.2 _____________________ 11650 - 12470 ______________ 14944
12.7 _____________________ 13740 - 14900 ______________ 18000
15.0 _____________________ 16430 - 17300 ______________ 22000

Anyway, we have some discovery. Thank you. I will do some further testing and analysis and report what I see.

everything is working as it Should. PLEASE checkout the wiring diagram on the product page to lear more about addressing.