Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I2C Bus communication for more than a few meters question

Status
Not open for further replies.

typografos

Newbie level 2
Joined
Jun 20, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Greece
Activity points
1,299
i2c communication

After my house been stolen i decided to design an alarm system with a main, MCU driven board. Signals will come from "smart sensors".

Well i have allready a pre-design of my system with a PIC MCU a keyboard, a graphic LCD e.t.c. and smart sensors with a small pic MCU.

My problem is the communication between "smart sensors" and the main unit.
The question is: "What do you think about I²C bus ?"
Is it suitable for this type of communication ? or should i use another protocol ?

Cable runs will be between six to twenty (and maybe 30) meters.

Thanks in advance.
 

i2c is which type of communication?

Your whole house was stolen?

IMO use 1wire sensors, they can be networked and support long range upto 300m.
 

    typografos

    Points: 2
    Helpful Answer Positive Rating
i2c longer distance

blueroomelectronics said:
Your whole house was stolen?
lol :D
Ohh yea you are right ! Lets state it precisely "After a Burglary in my house ..... "
Sorry i'm not native english speaker - writer ...

blueroomelectronics said:
IMO use 1wire sensors, they can be networked and support long range upto 300m.

Ok. I'll search about it. My concern is if 1wire is fast sufficiently for my application.

Thanks blueroomelectronics!
 

i2c long distance

I think it will be fast enough. Even if you check all sensors in 5s, it's still fast; I don't believe that someone could be so fast to enter, steal and leave from your house in a few seconds.
 

long distance i2c

Forget I2C, its really just for interboard connections. You can get extender ICs, but still fairly limited. I did make a long distance transceiver once using RS485, but this needed 6 wires plus direction control. You could of course use standard serial data via RS485 on twisted pair. Depends if you are using an mcu in your sensors or not. Any reason why you do not want to use commercially available alarms, they are not expensive.

Added after 34 minutes:

Further thoughts.

If you are using MCUs with serial ports at both ends, I suggest you use RS485 at low speed, 300 baud should be fine for this application.
Sensors (up to 32) can be in listen (receive) mode wait for a command. If they are activated, they should latch the event until interrogated. All sensors should respond to the same reset code, perhaps FF. Also they should have a unique ID No in flash memory.

Protocol
Master (Control Panel) sends out number 1 and then switches to receive to await an answer. The sensor should respond after short delay, with 0 for no alarm or its own ID for alarm status. This then can be processed as required. Switch back to transmit and repeat this in a loop for all rest of sensors, 1,2,3 etc. Terminate each end of the loop with a 120R resistor. Recommend just one cat 5 loop with no branches. Single pair for data, rest can be power etc.
 

i2c interboard

I2C could be a good choice for the data bus, because of the abundance of peripherals that support I2C (A/D and D/A converters, digital I/O expanders, memories, accelerometers, uCs that can work as I2C slaves, etc). If you boost the I2C and slow down the data rate, you can run it through long cables.
App note describing how to run I2C through long cables: **broken link removed**
Me bragging about a curious case of I2C bus: https://www.ccsinfo.com/forum/viewtopic.php?t=38463
 

maybe Rs232 or RS485 (or ethernet and stuff like that) I2C isn't suitable to work for long distances... you will sacriffice timing for lenght, while other buses (like RS485) would do the job. (the job of communication yuoe devices...) Sorry about your house... or your stuff...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top