Sensor Network

I'm building a sensor network for a varsity project. I need to read parameters for temperature, power consumption, speed at various nodes and send them back to a central point (Master) where they will be transferred to an interface. The sensor part is easy. I'm battling with the interlink.

So far I have identified LIN CAN and serial for this. CAN looks to be the hardest so it's between serial and LIN.

How difficult would LIN or serial be to implement with multiple arduino's? I came across one successful project with a google search for LIN and Arduino --> http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1247972192 but I'm not if he took it further or not.

I also found http://www.arduino.cc/playground/Code/SerialControl which looks promising. If I went for the serial route, could I daisy chain devices?

Thanks.

Edit: I am also reading the LIN documentation (191 pages :/)

Why not use wireless nodes?

How many arduinos are you talking about?

It looks like your actual data needs are tiny, so a slow, inefficient, but no extra hardware system will work just fine.

If you have the ‘master arduino’ connected to the PC with the USB connection, then you can daisy chain the rest through digital IO pins and the use of the SoftwareSerial library. A total of 4 digital IO pins per arduino would be needed (2 to the upstream arduino and 2 to the downstream arduino.)

The master requests data from the first arduino in line, and it either responds with the data or passes the request on to the next arduino.

SoftwareSerial looks to be no rocket, and I’ve never used it. But it might be fast enough for your project.

If I went for the serial route, could I daisy chain devices?

Yes, the simplest way is probably to have the nodes in a ring,

MASTER TX--->RX NODE TX--->RX NODE TX--->RX NODE TX ---> RX MASTER

You send a packet to the first node, it echoes all bytes to node 2 and adds information to the end, the process repeats until the data is received back at the master.

Or you can multidrop using LIN or RS485, master asks for data from node 1, gets response, asks node 2 etc.

Note that you don't have to use the LIN protocol, just use the driver chips and talk serial.

The above is the easy part, if you want a permanent reliable network writing the protocol will be 98% of the work, hooking up some hardware is simple. If this is just a theoretical exercise or "just get something working to pass exams" then it should be simple.

FWIW I am designing such a network at present, the protocol spec is currently at about 100 pages and I'm sure I haven't thought of a lot of things yet :)


Rob

maniacbug: Why not use wireless nodes?

I can do wireless but I have still got to route power to every board - regulations on batteries don't permit the use of separate batteries for instruments.

TeslaFan: How many arduinos are you talking about?

It looks like your actual data needs are tiny, so a slow, inefficient, but no extra hardware system will work just fine.

If you have the 'master arduino' connected to the PC with the USB connection, then you can daisy chain the rest through digital IO pins and the use of the SoftwareSerial library. A total of 4 digital IO pins per arduino would be needed (2 to the upstream arduino and 2 to the downstream arduino.)

The master requests data from the first arduino in line, and it either responds with the data or passes the request on to the next arduino.

SoftwareSerial looks to be no rocket, and I've never used it. But it might be fast enough for your project.

Maybe 4 arduinos. 1 Master and 3 slaves.

Thanks, I'll check this out.

Graynomad:

If I went for the serial route, could I daisy chain devices?

Yes, the simplest way is probably to have the nodes in a ring,

MASTER TX--->RX NODE TX--->RX NODE TX--->RX NODE TX ---> RX MASTER

You send a packet to the first node, it echoes all bytes to node 2 and adds information to the end, the process repeats until the data is received back at the master.

Or you can multidrop using LIN or RS485, master asks for data from node 1, gets response, asks node 2 etc.

Note that you don't have to use the LIN protocol, just use the driver chips and talk serial.

The above is the easy part, if you want a permanent reliable network writing the protocol will be 98% of the work, hooking up some hardware is simple. If this is just a theoretical exercise or "just get something working to pass exams" then it should be simple.

FWIW I am designing such a network at present, the protocol spec is currently at about 100 pages and I'm sure I haven't thought of a lot of things yet :)


Rob

Was thinking more of a multidrop system or token passing. I don't want to write a protocol as this is part on an undergrad project and that's going to add alot more work on. :lol:

I'll do some research into RS485 and LIN transcievers

I don't want to write a protocol

As soon as you decide what bytes to send and receive you've designed a protocol, the only question how complex will it be :)


Rob

Graynomad:

I don’t want to write a protocol

As soon as you decide what bytes to send and receive you’ve designed a protocol, the only question how complex will it be :slight_smile:


Rob

:lol: I see your point. lets leave it at writing a simple protocol.

So based on what I’ve picked up here and on the avr freaks forums, I have 3 (4 if i go wireless) methods to do this and all work around transceiver chips. LIN, RS485 and CAN. I need to research what’s required to accomplish each now.