Remote transmission of I2C Data

Asked about this in Products forum, but that seems to have little activity. In any case, I haven’t received a reply so I thought I’d post here.

Products referenced in this post:

  1. BME280 Digital Humidity ±3%RH Pressure and Temperature Sensor I2C Mini Module SKU: PR4-14
  2. I2C Shield for Particle Photon SKU: PR1-21
  3. 1-Channel 4-20mA Current Loop Transmitter I2C Mini Module SKU: PR33-26
  4. RS-485 Node Serial Network Communications Module SN65HVD12D SKU: PR37-9

I plan to connect the BME280 sensor here to a Particle Photon using this shield. The input from the three measured values (relative humidity, temperature and pressure) will then be used to calculate the associated dew point temperature on the Particle Photon.

I wish to then transmit that calculated value as an analog 4-20ma current signal to a remote Arduino-based PLC which accepts this as an input using this module. Is this feasible?

I would also like to enable RS485 Modbus RTU communication from the Photon to the PLC whilst leaving USB communication from the Photon to the PC intact. Would this module do the trick or do I need something else?

Also, are libraries available for these products?

Any guidance would be greatly appreciated and would assist me in making a purchase.

Hi,

I believe most of what you are intending to do should be possible. Is RS485 communication between the Photon and the Arduino PLC a necessary complication? It seems the data would already be communicated via the 4-20mA signal.

In any case here is a library for controlling the 4-20mA from the Photon:


Here is some sample code for monitoring the Temperature/Humidity/Pressure sensor:

Thanks for the reply Travis. The RS485 communication is to pass other data the Proton will be receiving on its GPIO which is separate from the sensor data.

In any case, I would like the two microcontrollers to have serial communication between each other. Since the PLC has a dedicated half duplex RS485 transceiver this seemed like the most straightforward route. Would the module I linked do what I want or do I need something else?

I’m honestly not sure. I’ve never attempted to use RS485 on a Particle Photon module. The module you linked is an XBee footprint RS232 Serial to RS485 converter. I have never personally used it but you’re going to need some sort of library I would think to run on the Photon. Maybe you don’t, I just honestly have 0 experience with RS 485. Perhaps @Bhaskar could shed some light on this.

hi,
this RS485 module can be used


it will connect to particle through serial.

There are few modbus lib available for particle which can be modified to use with this module

Thanks for the responses guys.I suspected the RS485 module Bhaskar linked might actually be one I need, but was not sure given that the Proton was not listed amongst the compatible devices.

But, I now realise the EC3 commands spoken of in the description are just for convenient interfacing with the industrial devices listed (Fusion, Taralist, ProXR, ProXR Lite).

In any case, I realise some modification of existing ModBus libraries will be required to make this work.

Thanks.

You’ll need this XBee Overlay module which would plug into the board over the top of the Photon:


The RS485 module could plug into that XBee Overlay so it would be a stack of RS485->XBO->Photon->main board.

Thanks Travis. I thought the RS485 module Bhaskar linked had an XBee footprint.

Actually, if by mainboard you mean the PLC, then the stack will just be RS485->XBO->Photon. The PLC will be located some distance (but within the same building) from where the Photon and its peripherals will be gathering data. Hence the requirement for 4-20ma analog signalling of the dew point data and serial communication over RS485 for the other data. This will be used to trigger events in the PLC related to other hardware.

You’ll need some sort of main board for the Photon to plug into. Like the screw terminal break out board for the Photon here:


You’ll see two rows of double pins. The Photon plugs into the center rows and the XBO board will plug into the outer row of pins.

Gotcha! Forgot the Particle boards were a bit different to Arduino in that regard.

Was going to power the Photon directly by wiring up Vin, but the screw terminal board makes things much more convenient. That’s going to be quite the sandwich. Anyway, thanks a bunch.

No problem.

Let us know if you need anything else.

Will do. Actually, I just realised the mainboard you linked above means I can dispense with the I2C shield I mentioned in my OP. Plus I get the convenience of easy powering and screw terminal breakouts for the GPIOs. So, thanks.

By the way, how are you embedding those neat little product descriptions in your posts?

Yeah, I’m a big fan of those screw terminal breakout boards. They are sort of like little Swiss army knives.

We use discourse as our forum software and it automatically pulls in meta data from links so if the pages being linked to have proper meta data it automatically builds the “teaser”. Pretty cool. You’ll see discourse everywhere these days, it’s really popular.

Yeah, I’ve heard of discourse from gamer vloggers but I’ve never used it myself. Posting from a phone so I guess I’ll have to make do with hypertext. Anyway, thanks for all the help.