Week 14 – Networking & Communication – You can not not communicate!

Weekly Summary

The week was all about communication. Communication between devices, between boards, how to send and receive data and messages. It was surprising to find out, that I2C devices don't have an agreed upon pin layout, almost all the I2C devices I got have different pin layouts.

I got around it by making a bespoke breakout board, as the idea of a universal, stackable I2C bus did not work.

I2C Bus

Assignments

Individual Assignment

The individual assignment is to design, build, and connect wired or wireless node(s) with network or bus addresses. Assignment exegesis is slowly becoming a field on its own - what exactly needs to be done to fulfill the requirements of the assignment? Design and build refer clearly to design a board in Eagle, mill & stuff, then connect wired or wireless node(s) with addresses. The addresses is the important bit: Connecting devices to the A/D pins is not enough. With a view to the final project, I plan to explore the I2C and OneWire Protocols, to interface with Temperature Sensors, Displays and ToF Sensors.

Group Assignment

The group assignment is to send a message between two projects. We interfaced our respective 3216 boards with I2C, and send data from one board to the other.

If the temperature is over 24ยบC, send an ON signal, if it is under 24ยบC, send an OFF signal.

  if (tempsensor.readTempC() > 24.0) {
    Wire.beginTransmission(0x09);
    Wire.write(1);
    Wire.endTransmission();
  } else {
    Wire.beginTransmission(0x09);
    Wire.write(0);
    Wire.endTransmission();
  }
Addressing the target board with ID 0x09. Full code in the files.
Communication in Action. 10s, 3.4MB

More code and details on the Networking & Communication Group Page.

Assignment Work Plan

This week feel into the so-called Golden Week holidays in Japan, which meant we could also use the lab on Tuesday and Wednesday. Here is the extended work-plan for this week:

Milling a Barduino 2.2 for developing the Final Project

I used a Barduino 2.0 ESP32 Dev Board that Jun made previously during the Electronics Week.

I wanted to start experimenting with my own board, and got the millable files from the Barduino 2.2. The difference from 2.0 to 2.2 is, that the 2.2 has a Micro USB connector on board (and the corresponding FT230 chipset), which means it can be programmed with a standard USB cable - a FDTI cable is not needed.

I downloaded the fabbable PNG files, and made some graphical changes that would remind me which position of the switch was for programming and running a program.

After that the mods dance.

The board has a mill-out for an antenna, which require slightly different settings:

Jun's suggestion was this:

trace anntena
endmill: 1/32
cut depth: 0.01 inch (0.254 mm)
max depth: 0.01 inch (0.254 mm)
offset number: -1 traceใฎๅ†…ๅดใ‚’ใ™ในใฆๅˆ‡ๅ‰Šใ™ใ‚‹ๅ ดๅˆใฏ-1ใ‚’่จญๅฎšใ€‚(set to -1 to cut the entire inside of.)

The test-cut of the antenna worked fine, but when I milled the board #1, an emergency stop happened at the SRM-20. I reduced the cut-depth - and doubled the amount of passed needed for cutting out the antenna rectangle.

cut depth: 0.005 inch (0.127 mm)
max depth: 0.01 inch (0.254 mm)
offset number: 0 (0=fill)

ESP32 Board: Attempt #1

Here is the first attempt:

Looks fine on the first view, but closer inspection shows missing pads.
Intermission
Lunch break at Akari (ใ‚ขใ‚ซใƒชใƒ€ใ‚คใƒ‹ใƒณใ‚ฐ) in Kamakura.

ESP32 Board: Attempt #2

The original Barduino 2.2 mill files are too delicate for our standard SRM-20/mods process.
I enlarged the pad areas for the FT230 chip and USB connector.
Pads are looking fine now. BUT. Some traces are merged.

Not wanting to discard the board, I am attempting to use the sonic knife to sever the trace connection:

Kind of worked, but it's not pretty. But it passed the multimeter connection test.

ESP32 Board: Attempt #3

Merged traces in mods
Re-drawing the traces.
Looking better now.

Another round of milling:

Looking good, looking good.
The text also came out nice.

Next step. Stuffing and Testing. And running out of time to do this extra work this week. ๐Ÿคจ Back to the week's assignment.

Communicating with I2C

I2C Work Plan

I2C Device Line-Up

Name, Type Voltage Price* Address Pull-Up? Pin Order Link & Datasheet
LCD Module, 16x2 Display 3.3-5V ยฅ645 ? ? Multiple Pins, Backlight, etc Akizuki, How To
0.96 OLED, 128x64 P-1580 3 - 5.5V ยฅ580 0x78 (0x7A), found: 0x3C Internal GND, VCC, SCL, SDA Akizuki
0.96 OLED, 128x64 P-12031 3.3 - 5.5V ยฅ580 0x78 (0x7A) Internal GND, VCC, SCL, SDA Akizuki
ADT7410 Temperature Sensor 2.7 - 5.5V ยฅ500 0x48 (0x49, 0x4A, 0x4B) Internal, jumper not soldered VDD, SCL, SDA, GND Akizuki
VL53L1X Laser Time-of-Flight 2.3 - 5.0V ยฅ1320 0x52 ? V+, GND, SDA, SCL Akizuki
OLED Module with re-solderable resistor to switch I2C Address, default is 0x78.
ADT7410 Temperature Sensor with solderable jumpers (A0, A1) for selecting I2C Address. Default is 0x48.
ADT7410 Temperature Sensor with solderable jumpers (J3, J4) for enabling Pull-Up Resistor. Not enabled by default.
I2C Pin Order Permutations. Tragic or funny? See Device Lineup for details.

Making Connectors for the I2C Devices

Chronologically I did this before looking closely at the I2C data sheets. The connectors did not work - well, they worked - but because each I2C device had a different pin assignment, they were not really useful. But I believe the animations are too nice to not include them here.

Animated Connectors.

Pull-up Resistors? Why are they needed?

Understanding the concept behind pull-up resistors took me a little while, the explanations from this tutorial helped immensely, especially these illustrations:

Source: https://www.bluedot.space/tutorials/how-many-devices-can-you-connect-on-i2c-bus/

Testing I2C with Arduino

Ok, that's working!

Testing I2C with my ATTiny 3216

I made a bespoke board to fit the different pin configuration for the temp sensor and the OLED display. First time I had to cheat and use a 0K resistor.

Sch
Not pretty, but working. Pull-up Resistors on the left, 0K bridge on the right.
Both devices get recognized.
My board and a holy mess of wires that is connecting to I2C.

The board in Action:

I2C Addresses: 7bit and 8bit

hex: 0x78, binary 8bit 0111 1000

When the last bit is ignored, the address becomes a 7bit address:

hex: 0x3C, binary 7bit 011 1100

References

Files