I2C! I2C! JUMPERS!? digital and analog inputs to cloud

I’ve got 2- 8 channel 4-20mA Current Receivers daisy chained to particle electron shield with screw terminals and 2 amp power supply, I’m using it with a photon device. Is there a schematic somewhere describing how to setup the jumpers? and someone mentioned to me i’d need a jumper for the pullup/down resistor on the last i2c analog card. I was also told that i cant use D0 or D1 on my digital terminals? That is unacceptable being that i have 8 digital inputs to send to the cloud. Any chance i cant change anything without needing to get additional cards??

I’ve got 120vac, 24vdc and 12vdc readily available in the panel if that helps…

What exact shield are you refering to? There are no jumpers on the Photon.
If these are ControlEverything Shields you should check there for schematics or at least state the exact shield type/name/specifier

Since D0/D1 are already used for I2C you can’t really use them for anything else, but you have 10 more GPIOs on the other side of the Photon. Together with D2~D7 that makes 16 GPIOs, hence I don’t find the “loss” of two pins unacceptable.

Yes control everything. Their website is not very helpful unless you know what you’re looking for. I dont. So far these things don’t seem like toys you just plug in and play with like I have read and heard multiple times. You need to have a certain degree of knowledge about computer programming/ software engineering. I do not have that knowledge… obviously. But I’m trying to learn so any information is helpful and appreciated. I do not know a THING about these so where’s a good place to start. If i type in GPIO on Control Everything.com I get 0 results. That website is not helpful for those who dont know what it is they are looking for. That’s why i asked if there was anywhere else. There is firmware on my photon. I locked and flashed it, but i have no idea what the firmware says or means so i dont know how to hookup my digital an analog inputs. I dont know how to send it to the cloud or which cloud or anything. There were 3 different versions and i picked one. I program PLC’s, VFD’s and HMI’s for a living So im not completely ignorant, but this stuff is just foreign to me.

PPESCREW is the shield i believe.

When you look at each of the CE boards you’ll see a 2x2 jumper block with I2C PULL-UP printed next to it.
On only one of the boards you’d “short” these jumpers to attach the required set of pull-up resistors.

For further info @IOTrav would be the best to contact.
And browsing the community might also be a source of valuable info
http://forum.controleverything.com/

1 Like

Thank you for the tag @ScruffR

@andyb23,
I’ll be more than happy to help you get your setup going. You are right though. These are not toys that you just plug in and they just work on their own. A product capable of plug and play connectivity like that would set you back several hundred dollars like a PLC would. These products are meant to be a cost effective hardware solution for developers. It is completely understandable how you might be frustrated using products like this if you don’t have experience with code development.

I would say the first step is going to be getting all of your hardware connected up properly.

As ScruffR mentioned D0 and D1 are used for I2C communication which is required for communicating with the Current Loop receiver boards you have so you cannot use those for your digital inputs, but as he also mentioned you have A0-A5 on the other side of the module which can be used as digital inputs(you could of course also use the DAC,WKP,RX,and TX pins as well). That should give you more than enough digital I/Os.

On the PPEScrew install the D0/D1 jumpers, this connects Particle’s D0 and D1 lines to the I2C connector at the end of the board. It also pulls the lines high for I2C communication which means you do not need to install the pull up jumpers on the Current Loop Receiver boards.

Each of the Current Loop Receiver boards have two sets of address jumpers, this is because each board has 2 I2C chips(MCP3428). The MCP3428 has a default starting address of 0x68. The address jumpers can be used to change that address. You need to use the jumpers to set each of the 4 chips on the two boards to unique addresses. On the first board leave the jumpers on the first set of address jumpers off, install the 0 Lo jumper on the second set of address jumpers. On the second board install the 0 Hi jumper on the first set of address jumpers and the 1 Lo jumper on the second set of address jumpers. This means you will have 4 I2C bus addresses which will be 0x68, 0x69, 0x6A, and 0x6B. Then you can individually interact with all 16 channels of 4-20mA inputs in your code.

Once you do all of this your hardware is ready and you can begin developing the code or hire the code development out if you do not have time to learn from the ground up.

3 Likes

Thank you both!

I now have my photon connected to the internet and jumpers seem to properly installed. Out of 13 inputs. I’m only sending a signal to one. I have a raw number that is changing on particle.io console that im watching as i change the analog signal. (4-20ma). All other variables on io website (data01(int32)= xxx, they are showing up as like 128; 96; 212; really random numbers even though there is no inputs to them. Is this caused by noise? What should i do to fix this as my understanding is that if there are no inputs the variable should be 0. This is further than i’ve gotten in the last 2 weeks so thanks!

Now I am going to change which input im sending signal to to make sure it isnt a fluke.

Once i’ve established that all of the analog inputs are working accurately, I’m assuming i need to come up with firmware to tell me what that number means which, what do you guys think, should I try to tackle this myself or would it be more cost effective to hire it out?

Is there ANYTHING else i should do?

Hi @andyb23

The MCP3428 is simply an analog to digital converter input. As with most ADCs the channels will float if not pulled high/low or no signal is applied. This is why you are seeing fluctuated readings, this is completely normal. When you apply a signal to the inputs you will see that the input no longer fluctuates and will change depending on the signal change applied.

You can go ahead and test all the inputs and let us know how that goes.

At that point you are right, the raw ADC readings will need to be converted to real world values(0-20mA in this case).

1 Like

i do not have any digital inputs hooked up but for some reason one of the variables (data17) does not change no matter what i do but its in a high position, (i believe 65535 or something close to that). Is that more than likely a wiring issue? I haven’t noticed any wiring mistakes so far but that’s not to say they dont exist. or is it normal and just is? doesnt seem to me that it should be as such.