Skip to content

Week 14. Networking and Communications

This week I learnt about networking and communications, how to connect things to networks.
This week’s assignments include:
- Individual assignment: design, build and connect wired/wireless node(s) with network or bus addresses.
- Group assignment: send a message between two projects.

Knowledge

Projects

I decided to follow this Fab Academy tutorial to build serial bus projects that talk between the bridge and nodes.

First of all, I design the bridge with Eagle.
Here are the components needed.

Item Component Name Quantity
1 ATtiny 45 IC 1
2 2x3pin AVR ISP 1
3 10K resistor 1
4 1k resistor 1
5 LED 1
6 2x2pin header 1
7 6-pin FTDI 1
8 1uF capacitor 1

I followed the skills learnt in the previous week to use Eagle in designing the board.

(the bridge - parts are added)


(the bridge - schematics)


(the bridge - ready for routing)


(the bridge - design ready for milling)


(added my name to prove it’s made by me :D)

And now I will design two nodes with Eagle.
For each node, I will need the following components.

Item Component Name Quantity
1 ATtiny45 IC 1
2 2x3pin AVR ISP 1
3 10k resistor 1
4 LED 1
5 1k resistor 1
6 1uF capacitor 1
7 2x2pin header 1

Similarly, I used skills learnt previously in designing the board on Eagle.


(the node - parts added)


(the node - schematics)


(the node - parts to be routed)


(the node - reading for milling)

Here are the links to the schematics, traces and outlines of the bridge and node.
(files to be updated)

Now I have both the bridge and the node design ready, I use Fab Modules to create .rml files for milling the PCB board on Roland-SRM20. Here are the links to the files.
bridge traces
bridge outline
node traces
node outline

And now I have the board ready. I begin to search for all the components I need for the bridge and two nodes.

(boards & components)

I soldered the components onto the board and here they are!


(bridge)


(node 1)


(node 2)

After the boards were soldered, I connected them to my MacBook respectively to check whether the board is good. I was able to burn bootloader for the bridge, but not the nodes. After checking the circuits again and again, I realized there was one main design fault in my PCB design, I marked the VCC pin of the ATtiny45 as GND, which means I had two GND pins on the chip.

So I updated the design, and the following is the correct one.


(updated node design)

However, before going to SZOIL to fabricate another two nodes with the CNC, I decided to fixed the current ones. I managed to fixed it, please see the following image, there were three fixes:

    1. read circle: cut off the trace so that the two pins won’t be connected.
    1. blue circle: solder these two traces together for them to be connected.
    1. the red jumper wire: to connect two pins together.


(temporarily fixed node)

Testing the Boards

And I connected it to my MacBook to check whether it’s functional. It worked fine!! (And later I updated the soldering to make the fixed cable more stable.)

Now double check to test whether these three boards are working.

I connected the bridge to the USBTiny and then my MacBook Air.
Open Arduino IDE, chose the right settings on Tools (Board: ATtiny25/45/85; Processor: ATtiny45; Clock: Internal 1MHz; Programmer: USBTinyISP); and then click “Burn Bootloader”, it showed “done burning Bootloader”!
And then I used the blink example to test whether the board was functional with LED blinking. Since the LED is connected to pin PB0, I changed the Arduino example code a little bit, as the followings:

void setup() {
  pinMode(PB0, OUTPUT);
}

void loop() {
  digitalWrite(PB0, HIGH);
  delay(1000);                       
  digitalWrite(PB0, LOW);    
  delay(1000);                      
}

It worked!! See the video below.

I used the same method to test Node1 and Node 2, they all worked. See the videos below.

With the boards ready, it’s time for flashing the board.

Flashing the boards

First of all, download the hello.bus.45.c and hello.bus.45.make on to your computer, for mine, I downloaded them onto my desktop.

Modify the code to set the ID for each board, I decided to use 0, 1, 2 for bridge, node 1 and node 2 respectively.

  • (1) Flash the bridge

I open the [hello.bus.45.c] code with Visual Studio Code, and search for the node ID, it was one Line 42, with the default ID as “0”, as shown in the following code line.

#define node_id '0'

Since the default ID is the same as my expected ID for bridge, I used the default code directly.

Opened Terminal, enter the following code, and press “enter”.

make -f hello.bus.45.make program-usbtiny

It was successfully flashed.

  • (2) Flash node 1

Use the same method as the above, change #define node_id ‘0’ to #define node_id ‘1’, put the same command line into the terminal, and press enter. Succeeded!

  • (3). Flash node 2

connect bridge, boards with computer

Since we did not have the 4-pin 2x2 cable to connect the brdige and nodes, I used breadboard to connect them, and then connect the bridge with the PL2303 USB to Serial (TTL) Module & Adaptor, and then connected to the USB port of my computer.

Here are some notes to be taken when wiring up the pins. I made a mistake in the first attempt for mixing the pins and it did not work.

USBTTL - bridge - node 1 - node 2
RX-------TX ------ RX ------ RX
TX-------RX ------ TX ------ TX
VCC-----VCC ------ VCC ------VCC
GND ---- GND ----- GND------GND

Here you can see my wiring (it might look messy with so many jumper wire and breadboard, but it did work :D )

After correctly wiring up, I opened the Arduino IDE and then click the upper right corner to open the serial monitor window. I entered the following numbers (0, 1, 2) respectively and clicked the “enter” key to see the results. You can see from the videos below.

From the above videos, you can see when entering different numbers, the system sends different signals and commands between the boards.

Since the interval between blinks are very short, it might be different to tell the different. I have a video with combinations of different numbers (0,1,2, 0 0, 1 1, 2 2) below, which might be easier to tell the differences.

I’d like to give my huge gratitude to Salman Faris, my friend, Seeed Ranger as well as the Fab Academy Instructor at Fab Lab Kochi for giving me remote guidance and instruction with patience and kindness!! <3

Files for downloading: