Week 15 - networking and communications

This week the assigment is mill and program a network between at least two processors.

Design the networking circuits


**NOTE: I want to make a networking with a stepper bipolar node but doesn't works for me. I have work on this aprox 3 weeks at the same time of my Final project. I decided made a simple network.

In past weeks assigments I designed a hello light board, and stepper bipolar boards (with a sensor and a light). I want to modify them and make a network with three boards. One Bridge with a led, to control the others, and two light nodes. They're based on Neils boards, and pin must be modified so that they can communicate with each other. For the three boards I will use an ATtiny45. To do this I have datasheet Arduino:


I designed the light node circuit based on Neil’s boards. The bridge is the same. The comunication between the circuits will be serial protocol.

BRIDGE NODE

I used the same of Neil.

 

LIGHT NODE

COMPONENTS:

For the light node I have the RX and TX pin free. There are the PB3 and PB4 pin of the Attiny45 microcontroler. Also I connected them to a pinhead to comunicate with the other boards. To connect with the FTDI iI will connect the RX of the board with the TX of the FTDI cable.

`

 

PROGRAMMING

 

I will program them with Arduino. I want to turn on and turn off one led with a button (1,2,3), turn on all (0) and turn off all (4). This is the code:


#include <SoftwareSerial.h>

SoftwareSerial mySerial(3, 4); // RX, TX

int encendido;

void setup()
{
// Open serial communications and wait for port to open:
mySerial.begin(9600);
pinMode(0, OUTPUT);
encendido = 1; // 1 bridge, 2 node1, 3 node 3
digitalWrite(0, HIGH);
}

void loop() // run over and over
{
char c;
if (mySerial.available()){
c = mySerial.read();
if(c=='1'){
if(encendido){
digitalWrite(0, LOW);
encendido = 0;
}else{
digitalWrite(0, HIGH);
encendido = 1;
}
}
if(c=='0'){ // 0 para el bridge y 1 para el nodo
digitalWrite(0, LOW);
encendido = 0;
}
if(c=='4'){ // 0 para el bridge y 1 para el nodo
digitalWrite(0, HIGH);
encendido = 0;
}
}
}

TEST

 

 

 

FILES

hello light board + sch

arduino

EMBEDDED NETWORKING AND COMMUNICATIONS
Described your design and fabrication process using words/images/screenshots
x
Explained the programming process/es you used
x
Outlined problems and how you fixed them
x
Included original design files and code
x
fablabueMIT