quite possible, since the RS485 signal has nothing to do with I2C.PIR sensor 1 ---> RS485 transmitter -----> long cable -----> RS485 receiver ----> I2C port extender ----> NodeMCU
Here I2C is not involved at all.PIR sensor 2 ---> RS485 transmitter -----> long cable -----> RS485 receiver ----------- ------> LCD Panel
my diagram was not clear. i have updated it using tool. please refer it once again.Hi,
quite possible, since the RS485 signal has nothing to do with I2C.
I2C just runs between NodeMCU and port extender as usual.
Here I2C is not involved at all.
And it misses any description how the LCD panel handles any logic input.
???
Klaus
so what would be best and easiest for me. I was made to choose rs485 because of long distance requirement between sensor and nodemcu. and now i have to accommodate multiple sensors with same nodemcu/arduino. one possibility is to change the board and replace it with Arduino mega and drop the idea of multiplexing. what else?I'm not so sure. It think it can be done but you might have trouble with the bus direction control if you do it with a single transmitter and receiver. Remember I2C uses two wires and the data line is bi-directional. You might be able to do it with two independent Rs485 connections, one for clock and one for data but you might need some additional logic to set the direction of the data line. Don't forget I2C normally uses open drain data drivers to allow more than one device to communicate and Rs485 is actively driven.
Brian.
Hi,
the description isn´t clear at all.
My assumption is that the port extender has
* one I2C interface to the uC and
* single ended TTL/CMOS interface from the PIR sensors via RS485.
But guessing is not a good way to give good assistence.
Thus:
* give a link to the port extender datasheet, or at least it´s exact part name
* your I2C port extender in the picture has 4 black lines. We don´t know which one carries what signal...wich one is I2C or a single TTL/CMOS signal
* tell us what interface is used by the LCD panel. Maybe additionally: exact part name and link to the datasheet
************
RS485 is no protocol. It´s just an (hardware) interface standard and mainly defines the voltage levels, polarities, characteristic impedances...
I2C is a complete interface definition including hardware, voltage levels, timing and protocol...
Klaus
It is also worth considering that if the PIR just produces a high or low pulse when triggered, there isn't much advantage in using ANY protocol unless you are talking about very long distances. As pointed out already, RS485 is just an electrical specification, normally it is used for carrying high speed data over long distances but for a slow signal and less than about 100m it doesn't really offer any advantages. You can probably just use the ground and output wire to connect directly to the NodeMCU. The supply to the PIR can be run along a third wire or produced locally wherever it is located.
I should also caution you that the most RS485 interfaces run from a 5V supply and produce 0V/5V levels at their output pins. The nodeMCU will be damaged if you connect 5V to any of its pins other than the regulator input.
Brian.
lt seems I am going too fast. Will start from basic queries.Really confusing informations.
Less clear than before.
Klaus
You originally implied the I2C was to be extended over a long distance using RS458 and for the reasons I gave it would be very difficult to do that. Later you imply only the connections to the sensors would use RS485 and the I2C expander would be located close to the nodeMCU.
I will try to clarify the two scenarios:
1. if you want to extend the I2C signals you can't easily use RS485. The reason is simple, I2C needs two wires and one of them is bi-directional. Although RS485 itself can be bi-directional there is no mechanism to reverse the data direction when it is needed. It can only send or receive but not both simultaneously and I2C protocols require rapid direction changes to carry ACK bits and return data. The I2C data and clock connections are normally open drain driven so that several devices can be connected to the same pair of line but RS485 would not allow for that. It isn't impossible to do but it needs additional logic circuits.
2. If you want to keep the extender close to the nodeMCU and just extend the PIR sensor connections it is much easier. The PIR doesn't send data per se, it just sends a high or low signal to say it has detected movement. It is a single wire carrying a relatively slow changing logic level so for relatively short distances it doesn't need any special drivers. All you need to do is connect the ground to ground and the output to the I2C expander input. How you power the PIR is up to you, it can be powered from the nodeMCU end or have its own locally generated supply voltage.
Brian.
I agree that the discussion is useless. But because of missing and confusing infirmations.Whole this discussion is useless.
RS485 is physical layer for communication, not for transferring signals that occurs "from time to time".
The whole concept is wrong.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?