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:
BME280 Digital Humidity ±3%RH Pressure and Temperature Sensor I2C Mini Module SKU: PR4-14
I2C Shield for Particle Photon SKU: PR1-21
1-Channel 4-20mA Current Loop Transmitter I2C Mini Module SKU: PR33-26
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.
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 @Anil_Bhaskar could shed some light on this.
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.
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.