Home About Me Assignments Final Project

Week 15: Networking and Communications


Individual project:
Design and build a wired &/or wireless network connecting at least two processors.

Group project:
Send a message between two projects.

Individual

For networking I wanted to use my old boards, so I decided to design a rx/tx hub connector.

Hub design and board with names on it.

From milling to soldering, no problems at all.

Hub Board with 4 times 2x3 pins + FTDI

After some wiring, my setup looked like this.

Old boards and hub connector

One thing to note at this point. I was using Arduino IDE, so I just needed to set baud rate to 9600 and it took care of the rest. So no clock issues.

So, building a network. From hand drawn picture how things work(courtesy of neil and his lecture) and from the hello.bus.c code I see basicly two things to note: shut down Rx channel in nodes by turning it to input while not sending, and naming the nodes.

High quality graphics from lecture

Thinking about how to name things... just go with 1,2,3 and 4

const char node = '1'; // network address

And to take that into concideration in loop section.

if (incomingByte == node) // node check

Default all boards with Rx to be input.

pinMode(Rx, INPUT);

And when writing response, make it output for a while.

pinMode(Rx, OUTPUT);
mySerial.print("node ");
mySerial.println(node);
pinMode(Rx, INPUT);

Rest is the same from previous weeks. Full codes for all nodes can be found in the end of this page.

When I put node's number in Arduino IDE's terminal, it responds by flashing led and printing it's name.


I also made a version of this where any traffic in serial line makes all boards blink once, and when a node is addressed, it blinks second time and prints its name.

Bluetooth testing

Good reading about the Bluetooth device I was trying out

BC417 datasheet

great guide

I just added HC-06 slave buetooth device as part of my network, downloaded software called Sena Bterm for my phone, scanned devices with it and connected to the one in the network. After that, it worked like terminal in PC.

Notes

Two Bluetooth slave devices cannot initiate connection, do not try that.

SoftwareSerial cannot listen two instances simultaneously(if for whatever reason you want to try it out).

Group project

Group efforts can be found here.

Files

ATtiny44A board(20Mhz) - Node 1
ATtiny44A board(20Mhz) - Node 2
ATtiny44A (week 7) .sch .brd
Atmega328P board(16Mhz) - Node 3
Atmega328P (week 14) .sch .brd
ATtiny44A board(8Mhz) - Node 4
ATtiny44A (week 12) .sch .brd
Hub files: .sch .brd trace.png outline.png trace.rml outline.rml