Week 9 - Wired Connections (and more networking!)

This week I worked on connecting my Huzzah and Metro M0 Express boards using a wired connection in order to control a TFT board using a WiFi connection!

Here’s the final product:

I went through a few tutorials to do this. I would recommend checking out and understanding these links if you want to replicate my project for this week:

  1. Wiring and Programming a TFT Board on an Arduino Metro M0 Express Board
  2. Wiring and Programming a Huzzah and LED
  3. Building a Remote Server Using Firebase


Connecting the Boards Using a Wired Connection

This tutorial shows that it is pretty simple to make two boards communicate with one another. It did take me a little longer than expected though, as I was trying to figure out the best way to connect the boards, how to make sure they shared the same ground, and how to power both boards.

Here is how I decided to connect my boards:

  1. I had to figure out which board was the receiving board and which one was the transmitting board. Since the remote server is sending the signal to the Huzzah which sends an output signal to the Metro M0 Express Board to change the TFT display, I realized that the Huzzah is the transmitting board and the Metro M0 Express is the receiving board.
  2. Now I had to make sure that the correct output pin on the Huzzah corresponded with the input pin on the Metro and that the code shows the correct pins. On the Huzzah, I made the output pin A5/4 and connected this to the input pin 12 on the Metro board. See this link for the pinouts on the Huzzah.
  3. In order to connect the two grounds, I added a wire between the second GND pin on the Metro board and the negative terminal on the breadboard connecting to GND on the Huzzah.
  4. Finally, I used the DC Jack on the Metro board to connect the board to power and used my laptop and USB to power the Huzzah.


Writing the Arduino Scripts for Both Boards

Working from the same link, I was able to write code for the transmitting board (Huzzah) and the receiving board (Metro) based on the pins I came up with and previously working with the TFT display board, a Huzzah, and the remote Firebase server. I decided to use the same server that I created in class used to control an LED remotely, except now when the LED turns on, I also want to turn on the TFT display as well.

Code for the transmitting board (Huzzah):

Code for the receiving board (Metro):

I used a hotspot on my iPhone in order to connect to the remote server, so you can input any home or public WiFi or hotspot that your computer or device is also connected to as the WIFI_SSID and WIFI_PASSWORD input. See this Firebase tutorial for more information on obtaining your FIREBASE_HOST and FIREBASE_AUTH names.


Remote Server

Access my remote server here! Now when my Huzzah, Metro, LED and TFT display are all powered and connected to my iPhone's hotspot, you will be able to control my devices from anywhere using the remote server!


Future Work

The inspiration for this project was to be able to have someone write words over the remote server to print on the board, but since I was dealing with digitalRead() and digitalWrite() functions with only deal with HIGH and LOW inputs and outputs, I was not able to explore how to get past this binary constraint this week. However, it would be really cool to keep working more with these devices in the future to eventually allow someone to print words on the display remotely! Another idea could be for someone to enter a number on the remote server, and the LED could flash that many times while the display prints the number.