Setting up a Raspberry Pi Zero W

I decided to try setting up a Raspberry Pi Zero W from the shop.

IMG_8767.JPG

Materials

  • Raspberry Pi Zero W

  • 64 GB microSD card

  • SparkFun Serial Basic Breakout - CH340G

  • 5V, 2A power adapter

  • Two micro USB cords

  • Jumper cables

I hit a few roadblocks along the way because I couldn’t reach the login screen in both CoolTerm and Terminal. Did I incorrectly edit the config.txt file? Or perhaps it was an error in the way I installed the USB to Serial drivers? I verified that it was installed and working correctly by following this SparkFun guide for the CH340G.

I asked Arnab to verify my setup - of course it helps to have a second set of eyes. Turned out that the 5V power adapter that I borrowed from the shop was 1.5A, and not 2A. This resulted in the following error to appear in CoolTerm:

Screen Shot 2020-03-02 at 8.31.10 PM.png

I switched out the power adapter and finally got to the login screen. This is how it looks within CoolTerm:

Screen Shot 2020-03-02 at 8.44.44 PM.png

I successfully changed the password, but then I tried to access the other options via the raspi-config screen. In CoolTerm, there were several scrambled ASCII letters, but I could not change how this was viewed to resemble closer how it would in Terminal. I wanted to select Network Options which appeared to be the second option, but it would always return the prompt to change the password despite whatever I entered.

Screen Shot 2020-03-02 at 9.37.58 PM.png
raspi-config.png

After this, I thought I’d try connecting via ethernet-over-USB another shot. I realized the first time I tried this and could not get the login screen to show, I still had the microUSB connected to the Serial breakout, along with the external 5V power source. I removed all connections except the one to the USB connector, typed in “ssh pi@raspberrypi.local” then “sudo raspi-config” and got to the config menu successfully. I proceeded with the rest of the instructions:

Screen Shot 2020-03-02 at 10.27.15 PM.png
Screen Shot 2020-03-02 at 10.31.39 PM.png
Screen Shot 2020-03-02 at 10.35.25 PM.png

Hue Light: Cassette Controller

I transformed an old cassette tape from a thrift store into a Hue Light controller. I embedded a rotary encoder and a push button through the cassette spools, and an OLED screen through which you would see the tape. I included a red LED at the bottom of the cassette to confirm the WiFi connection.

Materials

  • Hue Light system

  • Arduino NANO 33 IoT

  • Rotary encoder

  • Push button

  • OLED Screen

  • Cassette Tape from thrift store


Code

My code can be found on my Github here.
I modified Tom’s “HueBlinkWithJsonEncoder.ino” file, which can be found here.

Because my controller has an OLED screen, I put together a unit test so that I could adjust the sizing and positioning of the text.
The screen will show when it is attempting to connect, when it finally makes the connection, what settings / values are being changed, when the request is sent, and the response code.
I made sure to modify the default “on” state to “true”, brightness to 255, hue to 0 (red), and saturation to 255.
I increased the stepping for the hue values so that picking another color would be quicker.

Assembly

Hue Light: Interface

This week, I was able to successfully control the Hue Lights that were set up on the ITP floor using Terminal. Here is a video turning the Hue lamp on and off with the following Terminal commands:

On:
curl -X PUT -d'{"on": true, "hue":42900, "effect": "colorloop"}' http://172.22.151.181/api/YQWwzjYDMcgI4WlYHbl-ITkV2F17nXqcjkWusDMy/lights/1/state

Off:
curl -X PUT -d'{"on": false}' http://172.22.151.181/api/YQWwzjYDMcgI4WlYHbl-ITkV2F17nXqcjkWusDMy/lights/1/state

After successfully using Terminal to control the Hue lamps, I attempted both Arduino and p5js to make changes.

I used the Arduino HTTP client example sketch, but was unable to turn the Hue light on and off. The Serial monitor only showed that the Arduino was attempting to connect to sandbox370, but did not complete the connection.

Game Client: Plushy Controller

This week in Connected Devices, we were tasked to create a hardware client for the ball drop game. I decided to “hack” a stuffed animal my partner had made me, with its limbs and nose as the controller buttons.

IMG_8197.jpg

Bill of Materials

  • (1/2) yard of fuzzy yellow fabric - $45/yard. Purchased in Garment District

  • (5) large push buttons - $12.10 for 5. Amazon.

  • (5) white LEDs - provided by ITP.

  • Arduino Nano IOT 33

  • Micro USB cable

  • Solid core wire

Code

For the code, I had referenced this thread as a refresher for arrays and state changes.
Here is the code posted on GitHub.

Documentation

Here are the controller buttons on the breadboard, each illuminating their corresponding LED. The buttons are controlling the Left, Up, Right, Down functions of the ball game.

IMG_0463.JPG

Here is a time-lapse of me soldering the buttons and LEDs:

Here is a video demonstrating the LEDs that turn on when the button is pressed.

Here is the video of the plushy controller being used to play the Ball Drop Game: