Commit 5d78f6b7 authored by Philip Hozier's avatar Philip Hozier
Browse files

week13 update 5/5 #1

parent ba695102
Pipeline #228828 passed with stages
in 23 seconds
---
title: Week 13
description: Week 13 - Networking & Communication
description: Week 13 - Networking & Communications
author: Philip Hozier
type: docs
label: FAB ACADEMY
......@@ -10,14 +10,21 @@ publishdate: "2021-04-29"
draft: false
---
# Principles & Practices / Project Management
# Networking & Communications
![Workflow - Sketch](../week1/workflow-800px67.jpg "Workflow - Sketch")
{{< rawhtml >}}
<figure class="video_container">
<video controls="true" width="100%" allowfullscreen="true" poster="../week13/wk13-hero-thumbnail.jpg">
<source src="../week13/wk13-hero.mp4" type="video/mp4">
</video>
</figure>
{{< /rawhtml >}}
---
## Summary
---
My electronics' swiss cheese brain is slowly plugging the gaps in my knowledge.
My electronics' swiss cheese brain is slowly plugging the gaps in my knowledge. I managed to design 2 different boards (with nearly ;) 100% success (see below) from 'scratch'. And they can (at the moment) communicate in one direction. This system can be replicated with up to 1008 nodes! (with a long enough cable).
---
## What I thought I knew before
......@@ -38,6 +45,8 @@ Theory and use of things i learnt from this assignment:
## Lessons to take away
---
Double check the values / part numbers of components before soldering on to a board.
---
## Theory
---
......@@ -212,7 +221,7 @@ I2C protocol (Inter-Integrated Circuit), only uses two wires for communication (
Multiple masters can be connected to a single slave or multiple slaves. The problem with multiple masters in the same system comes when two masters try to send or receive data at the same time over the SDA line. To solve this problem, each master needs to detect if the SDA line is low or high before transmitting a message. If the SDA line is low, this means that another master has control of the bus, and the master should wait to send the message. If the SDA line is high, then it’s safe to transmit the message. Multiple controllers with multiple peripherals systems need 4.7K Ohm pull-up resistors connecting the SDA and SCL lines to Vcc.
- **Programming**
-
Wire Library allows you to communicate with I2C / TWI devices. On the Arduino boards with the R3 layout (1.0 pinout), the SDA (data line) and SCL (clock line) are on the pin headers close to the AREF pin.
'SoftWire' is a software I2C implementation for Arduino and other Wiring-type environments. It utilises the pinMode(), digitalWrite() and digitalRead() functions. The pins to be used for the serial data (SDA) and serial clock (SCL) control lines can be defined at run-time. Alternatively it is possible to pass references to functions which read and control the SDA and SCL lines, thereby allowing direct port manipulation to be used if preferred. Multiple objects (for multiple software I2C buses) and clock-stretching by peripheral devices are supported. A timeout feature is included to prevent lockups by faulty or missing hardware. The microcontroller must function as the controller device, multiple controllers are not supported.
......@@ -254,7 +263,7 @@ For more detailed information: [I2C](https://www.circuitbasics.com/basics-of-the
---
## Group Assignment
![Individual Assignment](../week4/individual-assignment.jpg "my FDTI")
![GroupAssignment](../week13/wk13-group.jpg "Group assignment")
- Send a message between two projects
......@@ -262,18 +271,22 @@ For more detailed information: [I2C](https://www.circuitbasics.com/basics-of-the
### What we did
---
The task was to link 2 LCD screens on the same I2C bus.
The task was to link 2 LCD screens on the same I2C bus. As a group we decided to form one large group, where those individuals with more knowledge of communications and networks could teach us all. We set up a power bank, two Arduinos with screens attached (OLED and LCD) and a laptop to program and debug.
Once that was all arranged, very few hands were needed to operate them. So my role was to listen and try to understand what was going on. That role i did very well and what i learnt was of a deeper level and more quickly than had we been in a smaller group with less initial combined knowledge of the subject.
See the [Group Page](https://fabacademy.org/2021/labs/waag/NC/ "group page") for further details.
---
### Mistakes & Issues
---
See the [Group Page](https://fabacademy.org/2021/labs/waag/NC/ "group page") for further details.
---
## Individual Assignment
![Individual Assignment](../week4/individual-assignment.jpg "my FDTI")
![Individual Assignment](../week13/wk13-hero1.jpg "my network")
- Design, build, and connect wired or wireless node(s) with network or bus addresses.
......@@ -283,13 +296,13 @@ The task was to link 2 LCD screens on the same I2C bus.
At first look at the individual assignment I thought we were meant to join our projects with others as the network. So I came up with the idea to make a 'breakout board' that could talk both SPI and I2C, that way i could be sure that it could talk to anything.
I had noticed from last week that the ATtiny1614 had separate pins for each of the parts of the different protocols, so this would be pretty straight forward. Add an output and an input to the IC and i would have a development board that I could use in the future with any sensor that spoke SPI or I2C (my 3 axis accelerometer for instance).
I had noticed from last week that the ATtiny1614 had separate pins for each of the parts of the different protocols, so this would be pretty straight forward (in my inexperience mind at least). Add an output and an input to the IC and i would have a development board that I could use in the future with any sensor that spoke SPI or I2C (e.g. my 3 axis accelerometer for instance).
---
## What I did
---
I took a bit of inspiration from the [Adrianino](http://fabacademy.org/2020/labs/leon/students/adrian-torres/adrianino.html "Adrianino"). The way it breaks out all the pins of the ATtiny1614 for various communications and functions. This would be the 'Controller' board, being able to communicated on different protocols. And for the secondary boards i'd take inspiration from the LED boards of the previous weeks as the simplest circuits to make to be controlled. Using
I took a bit of inspiration from the [Adrianino](http://fabacademy.org/2020/labs/leon/students/adrian-torres/adrianino.html "Adrianino"). The way it breaks out all the pins of the ATtiny1614 for various communications and functions. This would be the 'Controller' board, being able to communicated on different protocols. And for the secondary boards i'd take inspiration from the LED boards of the previous weeks as the simplest circuits to make to be controlled. Using I2C as the communication protocol I could gain an understanding of how to program with it and use that form my 3 axis accelerometer in the future.
**Design criteria**
......@@ -365,30 +378,44 @@ I felt confident enough in the boards I've previously produced to design these b
**What i think the circuits do.**
- Controller
For the controller board, power comes in through the FTDI or UPDI sets of pins depending on whether i'm programming or debugging with the serial port. This is then either regulated down to 3.3v or stays at 5v, depending on the setting of the switch.
The capacitor smooths out that power and delivers it around the board, and to the power pins fo the SPI and I2C headers. That way any networked IC boards or attached sensors can be also draw power.
The button input and LED outputs can be programmed to activate or give visual feedback on either the control board or other networked boards.
- Peripherals
The peripheral should be able to be programmed with the first line of pins (UPDI+VCC) of the header. The second line includes the SDA and SCL lines for I2C protocol communication. The ATtiny412 then controls the RGB LED. Simple as that. Whilst connected with the 'network' cable, it should take the VCC and GND from the controller board along with the SDA and SCL lines. The headers on all boards will have matching header pin assignments.
**Board Production**
AS the controller board was my biggest board so far (no need to minimise space used this time) it took a a lot longer than expected to mill. I combined two images of the smaller board in Photoshop and milled these separately from the main controller. The smaller baby boards took less time with fewer traces to mill.
As the controller board was my biggest board so far (no need to minimise space used this time) it took a a lot longer than expected to mill. I combined two images of the smaller board in Photoshop and milled these separately from the main controller. The smaller baby boards took less time with fewer traces to mill.
I learnt previously that i should leave a bit more space between the edge of the board and the circuit, as with small boards its easy to forget that measurements are in reality very small compared to what you see on a big computer screen. This negated the possibility of cutting circuit traces when the board was cut out at the end.
**Soldering the board**
As usual, positioning these small components with small connection points was the most difficult. Tinning these and the pads where they would go with the minimum amount of solder was important. Flux was my friend here, as it ensured that the small amount of solder on both surfaces was enough to make a firm connection.
Apart from the usual trickiness of soldering such small components, the biggest frustrations were making sure that the LEDs (also the RGB LED) were positioned in the right configuration to work. I didn't want to have to unsolder and swap them around later. Which is something i did have to do when I found out i had put on the wrong 'pullup' resistors (see below for more detail).
**Board Testing**
![Individual Assignment](../week12/errors.jpg "Unhelpful Error messages")
Continuity testing 'sounded' like there were no missed or extra connections in the wrong places.
- Continuity testing
This 'sounded' like there were no missed or extra connections in the wrong places. Adding VCC and GND connections to the baby boards showed that the RGB LEDs were connected in the right way. I had confidence that any following problems were more than likely going to be programming ones and not hardware.
**Programming**
![Individual Assignment](../week12/strange-results.jpg "strange results")
---
## What I should’ve done
---
......@@ -410,10 +437,36 @@ Another board with the Rx+ Tx around the wrong way. I purposely designed this th
Upon designing the baby boards, I read that 'pullup' resistors were needed with the SDA and SCL lines which connect to VCC. It wasn't really possible to save the control board by adding the extra resistors, so I redesigned the control board with the extra resistors and also the Rx + Tx around the right way this time.
**One track not seperated**
Even though the design rule check didn't high light any problems, one trace was not separated completely from the rest. I fixed with with a steady hand and a Stanley knife!
![Individual Assignment](../week13/tracks.jpg "joined tracks")
**Wrong resistors**
Whilst trying to program a 'broadcast' message that would send a message to the nodes, the 'Serial.endTransmission' command would freeze. A search on the internet produced a few results, but no solution that was relevant. But a second pair of Eagle eyes (Nadieh) noticed that the resistors had a strange value. I had picked out resistors that had fallen (or were recycled) from the bottom of the box and not from the packaging. It turns out that someone had placed 4.9 Ohm resistors in the 4.9k Ohm box. Replacing these with the correct ones on the board made everything work! Serial.endTransmission completed its command and i could move on with programming.
**Only RED RGB turned on**
When testing the RGB LED nodes, only the Red LED would turn on. Commenting things out to debug, the result showed that it was the 'Serial.begin(9600)' command that was stopping all the LEDs turn on. I checked the program and tried different things to directly manipulate the LEDs, but with no solution. Then I remembered our old friend 'Serial.swap(1)' from the previous weeks. I wondered if changing the serial pin mapping would solve the problem - And it did!! :) A lot of time saved from debugging that problem.
**Ran out of memory on ATtiny412**
Part of designing a board with an RGB LED would mean i could re-use previous code from other weeks. IN the process of trying to load this code onto the board I began to get 'compile' problems when i tried to upload to the board. Debugging the code by commenting out code helped, but an internet search lead me to believe that my program was too much for the chip. It gave the impression that it was in the region of 80% of the memory quota, however what this code included this time from previous weeks was the Wire Library. This must have a memory overhead before the programming is written. Further investigation into the program wasn't possible (see next).
**UPDI failed to initialise**
I then had trouble uploading the programs, with the error 'UPDI failed to initialise'. I swapped USB ports, changed connecting wires, and even restarted the computer. Only thing left to do now is to use another UPDI to check if my UPDI works.
---
## CONCLUSION
---
---
## FILES
---
\ No newline at end of file
---
| **FILE** | **DESCRIPTION** |
|---|----|
| [Traces](../week10/3-axis-accelerometer-F_Cu_500.png "Traces") | The traces for milling. |
| [Interior](../week10/3-axis-accelerometer-Edge_Cuts_500.png "Interior") | The interior for milling. |
\ No newline at end of file
......@@ -11,23 +11,26 @@ publishdate: "2021-05-03"
draft: false
---
# USER CASES
---
To better illustrate the functionality and uses of this final project concept in various configurations.
---
## USER CASE 1 - Individual with emotional dysregulation challenges
---
![User Case 1](../user-cases/Angry_girl.jpg "emotional dysregulation challenges")
Image: [Wikipedia](https://en.wikipedia.org/wiki/File:Angry_girl.jpg "Angry_girl")
**Scenario**
An individual with multiple challenges has the added obstacle of emotional dysregulation, which hinders them from dealing with their other challenges. The device would help them recognise when they're in a state high emotional and (hopefully) bring them back down to a point where they can regulate their emotions and move on.
---
## USER CASE 2 - Therapist / Rehabilitation use
---
![User Case 2](../user-cases/rehabilitation.jpg "Therapy / rehabilitation")
......@@ -37,7 +40,9 @@ Image: [Flintrehab.com](https://www.flintrehab.com/stroke-rehab-equipment/ "reha
A physical therapist uses the device to aid in the rehabilitation of stroke patients or those with fine motor skills problems. As part of a playful set of exercises or tasks, maintaining a constant or targetted feedback from the device would promote smooth movements or goals in the level to reach.
---
## USER CASE 3 - Dancer / Recreational use
---
![User Case 3](../user-cases/dancer.jpg " Dancer / Recreational use ")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment