Categories
Homemade Hardware

Final Project Development #2 – Final In-class Prototype

TEMPORARY PRESENTATION LINK HERE.

Overview

Give an overview of your project idea (what it does, what it looks like, etc).

Originally, I wanted to make a cube shaped pocket-sized artifact which displays an animation over it’s surface. The animation changes according to the data it has accumulated over a period of time, making each artifact contain a unique visual pattern. It is possible to connect two artifacts to change and “breed” their content.

The idea evolved into a device which uses light to create a dialogue between users in different places. Each device dialogues over the internet with another device. Whenever a user taps or moves the first device, it affects the animation on the second device in real-time. My purpose with this is to explore what types of interaction can evolve from a conversation with light.

For the prototype, I made a single-panel device connected to an ESP32 which communicates through Websockets with another Arduino with a sensor. If you tap the accelerometer connected to the Arduino, it triggers a different animation on the panel. I also made a website which can trigger the animation too. In the future, I would like to have more control over the sensor and communication protocol, but for now it was enough proof of concept.

Include any drawings, images, or reference materials that are helpful for us to understand your idea

ESP32 WROOM

I decided to go for an ESP32 Huzzah breakout board made by Adafruit in order to make the project. The board includes an ESP32-WROOM-32, and the board itself only adds a regulator, some protection diodes, two buttons, and an LED. You can see the board below.

According to the description page, “That module in the middle of the breakout contains a dual-core ESP32 chip, 4 MB of SPI Flash, tuned antenna, and all the passives you need to take advantage of this powerful new processor. The ESP32 has both WiFi and Bluetooth Classic/LE support. That means it’s perfect for just about any wireless or Internet-connected project.” The ESP32 itself is made by Expressif, based in China. And the datasheet for the ESP32 can be found here.

I also found Adafruit made a detailed guide on how to set it up using the Arduino IDE, which you can follow here. Below are closer images of the microcontroller.

Adafruit ESP32 Breakout HUZZAH board.
Adafruit ESP32 Breakout HUZZAH board.
The ESP32 up close.
The ESP32 up close.
Esp32WROOM Peripheral Schematics
Esp32 WROOM Peripheral Schematics
The esp32 schematic in Eagle.
The ESP32 schematic in Eagle. Component was taken from the HH Eagle library.

LIS3DH Accelerometer

LIS3DH Accelerometer.
LIS3DH Accelerometer.

Here I found the .sch and .brd files made by Arduino for the LIS3DH triple-axis accelerometer.

LIS3DH Schematic.
LIS3DH Schematic.

Adafruit Neopixels

PCB files for Adafruit NeoPixel 8×8 Matrix can be found here .

NeoPixel DataSheet
NeoPixel DataSheet
Adafruit Neopixel RGB 8x8 Matrix Schematic.
Adafruit Neopixel RGB 8×8 Matrix Schematic.

Bringing it all together

Schematics

First I had to connect everything, and then go to the .brd file and make the board design. I went ahead and removed any unnecesary components and making sure every GND and power inputs were correctly addressed. Since I had already made the connections with the prototype made last week, it didn’t take me much time.

My ESP connections.
My ESP32 connections.
My LIS3DH and MIC5225-3.3 connections.
My LIS3DH and MIC5225-3.3 connections.
My Neopixels connections.
My Neopixels connections.

Board Design

Looking over the process, I might say what took more time was to make it ‘pretty’. Making dimension guides are extremely useful, even more when you’re handling many components in a small space. Below is the predetermined way in which Eagle organized the elements of my board in the sketching area.

First approach to Eagle organization.
First approach to Eagle organization.

I must say, looking over the design made by Adafruit for their own RGB matrix 8×8 LED display I was impressed and overwhelmed. So I decided to sketch out the lines from DATA in of one LED to the next in order to see how to organize mine. After looking it over, however, they used vias for every LED. This would not serve my purpose since I wanted to keep my LEDs on one side and the main components on the other.

In the images above, I show the normal dataline in white. While the red and blue view is set to be red for the surface airwires and blue for the bottom ones. Since I would be making a plane for my GND, I could focus on just managing the DATA and power connections. The result is seen below, and in order to accomplish it I flipped every second LED to make the connections as fluid as possible.

My Neopixel connection scheme.
My Neopixel connection scheme.
My NeoPixel array
My NeoPixel array with dimension markers.

After feeling good about the LED array, it was time to move on to the ESP32 and the other components on the bottom. The only limitation I had as to keep the ESP32’s antenna as close to the edge ofo the board as possible. And also, to take into account I cannot put the power connection jack beneath anything since it required holes.

My first approach to the Backside.
My first approach to the Backside.

Eagle Files

Github Repository

Categories
Homemade Hardware

Final Project Development #2 – Eagle Design

The main idea of designing the circuit for my device is having my own control of the dimensions and arrangement of my component across my board. However, due to the circumstances, I might have to adapt my design while I can get access to the hardware I require to build my circuit. Fortunately though, companies like Adafruit offer high-quality breakout boards with most everything you might need, as well as a a datasheet. I also used Digikey as a provider for my components.

I will go through each of the components I used, and at the end I will show how I implemented each of them into my design in Eagle.

ESP32 WROOM

I decided to go for an ESP32 Huzzah breakout board made by Adafruit in order to make the project. The board includes an ESP32-WROOM-32, and the board itself only adds a regulator, some protection diodes, two buttons, and an LED. You can see the board below.

According to the description page, “That module in the middle of the breakout contains a dual-core ESP32 chip, 4 MB of SPI Flash, tuned antenna, and all the passives you need to take advantage of this powerful new processor. The ESP32 has both WiFi and Bluetooth Classic/LE support. That means it’s perfect for just about any wireless or Internet-connected project.” The ESP32 itself is made by Expressif, based in China. And the datasheet for the ESP32 can be found here.

I also found Adafruit made a detailed guide on how to set it up using the Arduino IDE, which you can follow here. Below are closer images of the microcontroller.

Adafruit ESP32 Breakout HUZZAH board.
Adafruit ESP32 Breakout HUZZAH board.
The ESP32 up close.
The ESP32 up close.
Esp32WROOM Peripheral Schematics
Esp32 WROOM Peripheral Schematics
The esp32 schematic in Eagle.
The ESP32 schematic in Eagle. Component was taken from the HH Eagle library.

LIS3DH Accelerometer

LIS3DH Accelerometer.
LIS3DH Accelerometer.

Here I found the .sch and .brd files made by Arduino for the LIS3DH triple-axis accelerometer.

LIS3DH Schematic.
LIS3DH Schematic.

Adafruit Neopixels

PCB files for Adafruit NeoPixel 8×8 Matrix can be found here .

NeoPixel DataSheet
NeoPixel DataSheet
Adafruit Neopixel RGB 8x8 Matrix Schematic.
Adafruit Neopixel RGB 8×8 Matrix Schematic.

Bringing it all together

Schematics

First I had to connect everything, and then go to the .brd file and make the board design. I went ahead and removed any unnecesary components and making sure every GND and power inputs were correctly addressed. Since I had already made the connections with the prototype made last week, it didn’t take me much time.

My ESP connections.
My ESP32 connections.
My LIS3DH and MIC5225-3.3 connections.
My LIS3DH and MIC5225-3.3 connections.
My Neopixels connections.
My Neopixels connections.

Board Design

Looking over the process, I might say what took more time was to make it ‘pretty’. Making dimension guides are extremely useful, even more when you’re handling many components in a small space. Below is the predetermined way in which Eagle organized the elements of my board in the sketching area.

First approach to Eagle organization.
First approach to Eagle organization.

I must say, looking over the design made by Adafruit for their own RGB matrix 8×8 LED display I was impressed and overwhelmed. So I decided to sketch out the lines from DATA in of one LED to the next in order to see how to organize mine. After looking it over, however, they used vias for every LED. This would not serve my purpose since I wanted to keep my LEDs on one side and the main components on the other.

In the images above, I show the normal dataline in white. While the red and blue view is set to be red for the surface airwires and blue for the bottom ones. Since I would be making a plane for my GND, I could focus on just managing the DATA and power connections. The result is seen below, and in order to accomplish it I flipped every second LED to make the connections as fluid as possible.

My Neopixel connection scheme.
My Neopixel connection scheme.
My NeoPixel array
My NeoPixel array with dimension markers.

After feeling good about the LED array, it was time to move on to the ESP32 and the other components on the bottom. The only limitation I had as to keep the ESP32’s antenna as close to the edge ofo the board as possible. And also, to take into account I cannot put the power connection jack beneath anything since it required holes.

My first approach to the Backside.
My first approach to the Backside.

Eagle Files

Github Repository

Categories
Homemade Hardware

Final Project Development #1

Neopixel control with accelerometer

Speed change according to device rotation.
Speed change according to device rotation.
Changing brightness Y axis
Changing brightness Y axis.

For the first stage of my project development, I decided to test the Neopixels attached to some kind of input. I wanted to get a sense of how they behaved, what was their limits and possibilities. I found the Neopixels to be absolutely mesmerizing, bright as hell, and made me fall in love with light again in the process. Though I am mostly concerned about being able to perform my original idea due to the planet’s current situation, working through this process will clear up a lot of things in terms of power usage, communication, timing, and generative pattern creation in general.

Accelerometer

I decided to implement an accelerometer to have some kind of control over the lights in realtime. Fortunately, I had an Adafruit LIS3DH laying around and the documentation for it is good.

To use it you require the Adafruit LIS3DH and Adafruit Unified Sensor from the Arduino Library Manager. I decided to use I2C wiring since it required fewer cables than through SPA.

I2C Wiring

Use this wiring if you want to connect via I2C interface ( Taken from the documentation website)

  • Connect Vin to the power supply, 3-5V is fine. Use the same voltage that the microcontroller logic is based off of.
  • Connect GND to common power/data ground
  • Connect the SCL pin to the I2C clock SCL pin on your Arduino. On an UNO & ‘328 based Arduino, this is also known as A5,.
  • Connect the SDA pin to the I2C data SDA pin on your Arduino. On an UNO & ‘328 based Arduino, this is also known as A4.
LIS3DH Accelerometer.
LIS3DH Accelerometer.

The accelerometer’s main components seem to be the chip in the center of the breakout board made by Adafruit, which also takes care of things like regulating voltage and logic level-shifting. I did find the LIS3DH online datasheet in order to attach it later by itself.

Readings

The Adafruit LIS3DH library has an example called `acceldemo’ which has a clean code with raw readings and normalized values in an m/s^2 format. After taking away the clutter I got the values I needed. The minimum value is -9.8~-10 and the max value is 9.8~10 for each axis, with 0 being the value when the sensor is parallel to the direction of the axis. I later applied the values from the X axis as the animation speed for the Rainbow Cycle.

Accelerometer Readings
Accelerometer Readings

IMC

For testing purposes I used an Arduino UNO, which has an ATMega328 IMC. For my purposes, which would be to control 300+ LEDs, it seems the ATTiny can’t handle that much according to some forum posts. In this repository, for example, the user gets ~80 pixels at 3 bytes for LED. However I also found this article where the developer uses 1k RAM to handle 1000 Neopixels…so maybe with the ATTiny’s 1/2K RAM I can handle 500? Testing, testing, and testing. In any case, I decided if the ATTiny85 is not enough the ATMega328 might be a good choice as it is 4 times more powerful. This video by Adafruit in which they describe their Trinket product was helpful for me to understand this difference.

ATTiny85

  • 8k flash
  • 1/2k ram

ATMega328

  • 32k flash
  • 2k flash

Animations

I believe the way to proceed with the animations is to think of them as generative systems. Storing images or gifs into the microcontroller would be memory- draining unless I attach an SD card to it and convert each of the images into byte arrays to later on load into it. However, this seems counter-intuitive with my main idea of having the sensors I attach control the parameters in the animation. So generative systems seems like the approach there.

What I’m thinking about now

  • Well, even though I liked the neopixels, the 8×8 grid made by Adafruit is too big, and the LEDs are a bit too far apart. I would love to fabricate my own when it’s possible. I also bought the strip but the strip is still too thick, it doesn’t make much of a difference.
  • I made some experiments with a magnifying glass and the pixels and it looked amazing. Maybe somewhere to branch off? Maybe a portable VJ System?
  • I still think power is going to be an issue. If I want this to be portable it’s going to need a bigger power source for each pixel I add. I want to test how much they would last with a Lithium-Ion battery. or a small powerbank?
  • I’m still confused about what I want it to do. Do I want to play with it? Do I think of it as a data viz device?
  • Maybe consider making it a screen? Not so much a cube but probably more of a frame which can update it’s animations using my wifi network? Example, if it’s night time dim it a bit and make soothing patterns vs morning bright patterns?
  • The tap feature in the accelerometer had me thinking. What if each of the people who have the device can sense when someone else tapped with intent? I could imagine sitting in my desk and having the cube having some calm pattern, and suddenly ripples come off of it. I would know the person who has the other cube sent a tap that changed the pattern and is communicating with me. This idea occured to me when people started calling me more often when all of this covid situation started, and I wanted to let them know everything was ok without having to actually answer my phone/ message them.

Code

Github Repository

The code below is the one called “lightingAccelerometer”. I have several other scripts I made in order to understand each library correctly.

// Neopixels
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif

// ACCELEROMTER LIS3DH
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_LIS3DH.h>
#include <Adafruit_Sensor.h>

#define PIN 6
#define NUMPIXELS 64
#define PIXELTYPE NEO_GRB + NEO_KHZ800

#define CLICKTHRESHHOLD 80


//define the neopixels as pixels
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, PIXELTYPE);

// define the Accelerometer 12C as lis
Adafruit_LIS3DH lis = Adafruit_LIS3DH();

void setup() {

  Serial.begin(9600);

  // NEOPIXELS
  pixels.begin(); // Initialize the pixels
  pixels.setBrightness(10); // Set brightness. Max is 255
  pixels.show(); // Initialize all pixels to 'off'

  // ACCELEROMETER
  lis.begin(0x18); // begins the accelerometer
  lis.setClick(4, CLICKTHRESHHOLD); // this sets up the Accelerometer to read taps
  lis.setRange(LIS3DH_RANGE_4_G);   // 2, 4, 8 or 16 G!
}

void loop() {
  //Get a new accelerometer event, normalized 
  sensors_event_t event;
  lis.getEvent(&event);

  // Run the animation
  animation_rainbow(2, event.acceleration.x, event.acceleration.z);
}


void tapBrightness() {

}
// Fill the dots in a sequence one by one
void colorWipe(uint32_t c, uint8_t wait) {
  for (uint16_t i = 0; i < pixels.numPixels(); i++) {
    pixels.setPixelColor(i, c);
    pixels.show();
    delay(wait);
  }
}

void animation_rainbow(int wait, int accX, int accZ) {
  uint16_t i, j;
  int speedVal = abs(int(accX) + 1);
  int brightVal = abs(accZ * 20) + 10;
  speedVal = map(speedVal, 0, 10, 0, 7);
  pixels.setBrightness(brightVal); // Set brightness. Max is 255
  for (j = 0; j < 255; j++) {
    for (i = 0; i < pixels.numPixels(); i++) {
      pixels.setPixelColor(i, Wheel(((i + j)*speedVal) & 255));
    }
    pixels.show();
    delay(wait);//this delay makes it work a bit better
  }
}


// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if (WheelPos < 85) {
    //The lower the number, the more red it is
    // When it gets higher, Blue starts going upwards and Red goes down
    // When Wheelpos is 0, (255,0,0), when it's 85, (0,0,255)
    //RED TO BLUE
    return pixels.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  }
  if (WheelPos < 170) {
    WheelPos -= 85;
    //BLUE TO GREEN
    //0, (0,0,255) // 170, (0,255,0)
    return pixels.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
  //GREEN TO RED
  WheelPos -= 170;
  return pixels.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
Categories
Homemade Hardware

Final Project Proposal

Homemade Hardware Final Project

VIDEO LINK : https://www.youtube.com/watch?v=GiNsy1wCurY.

The Idea

I want to make a cube shaped pocket-sized artifact which displays an animation over it’s surface. The animation changes according to the data it has accumulated over a period of time, making each artifact contain a unique visual pattern. It is possible to connect two artifacts to change and “breed” their content.

Things to consider:

  • I would love for the cube artifact to have every side with a screen. However, I know this might be very difficult due to power and size constraints.
  • Since I am using LEDs I am thinking about using geometric animations and changing the rhythm and variations of each of them.
  • In practical terms, I would like for each input in the artifact to affect the parameters which determine how the animations look.

Inspiration

Gameboy + Link cable Game Sharing

The Gameboy was one of the first handheld videogame devices (Handy-boy was the first, no idea). It had hundreds of games, and while it provided a lot of entertainment for individuals it also allowed for people to play between each other. Since there was no internet at the time, people used a cable called “Link cable” to connect their devices together and play. Looking a bit into the subject I found the connector was called a DMG-04.

2 GameBoys connected with Link cable.
2 GameBoys connected with Link cable.
Link cable closeup
Link cable closeup

I enjoy thinking about how this type of tangible connection allowed people to play between each other with a cable connecting them. I remember playing games like Pokemon, where you had to connect with another player and trade your character with the other person’s character to have even better things inside the game.

  • In general, I think having this idea of each person having something unique which can be shared with some else. This connection has to be physical, with intention.

Electric Sheep

  • https://electricsheep.org/

  • Crowdsourced evolving art.
  • What interests me about this project is it makes me wonder about the idea each user has a “unique” animation which evolves after a few iterations.
  • “Electric Sheep is a collaborative abstract artwork founded by Scott Draves. It’s run by thousands of people all over the world, and can be installed on almost anything. When these computers “sleep”, the Electric Sheep comes on and the computers communicate with each other by the internet to share the work of creating morphing abstract animations known as “sheep”. Anyone watching one of these computers may vote for their favorite animations using the keyboard. The more popular sheep live longer and reproduce according to a genetic algorithm with mutation and cross-over. Hence the flock evolves to please its global audience.”

Electric Sheep visuals

Cube LED display

  • I enjoy the idea of a continuous animation throughout the surface of an object. It makes the whole object seem like an entity.
LED cube
LED cube

Components

Form

How is my device going to look?

  • Shaking Arduino Dice project link
  • I Like the size, the encasing works well with the screen, it seems like something I could carry with me all day. I like how it looks with one screen, though I would like to see every side as a screen.
Shaking arduino dice.
Shaking arduino dice.

Microcontroller

How am I going to control my device?

ATMega128

Datasheet.

ATMega128

Microcontroller

How am I going to show my animation and content on my device?

  • They can’t be too power consuming
  • I want them to be RGB.

DOT Matrix

  • 64 LEDS, 8×8 matrix.
  • I can attach several of these together.
LED Matrix 8x8
LED Matrix 8×8

RGB LED Matrix

Beautiful 8×8 Matrix (ADAFRUIT DOTSTAR HIGH DENSITY 8X8 GRID – 64 RGB LED PIXEL MATRIX)

  • 25 dollars each
  • Looks amazing
  • The size seems perfect
8x8matrix
8×8 matrix taken from the Adafruit website.
Adafruit dotstar 8x8 from behind
Adafruit dotstar 8×8 from behind

Connection

How to make my cubes speak to each other? Change animations between them?

Wired – Serial Port?

  • I would have some kind of RX and TX in a physical format on the artifact. Probably some kind of fixed connection like the one depicted below?
Drawing 1
Drawing 1
Drawing 2
Drawing 2

Battery

How is my device going to have power

  • Small and effective
  • Something like this:
    • Depends on amount of screens/sensors.
Lithium Ion Polymer Battery.
Lithium Ion Polymer Battery.
Categories
Homemade Hardware

Assignment 1: Bootloading Jig

Assignment 1: Bootloader Jig

The Idea

The project consists of developing a shield for an Arduino UNO which makes bootloading brand new microcontrollers easily.  In this specific case I will be flashing an ATTiny85 microcontroller. To make this procedure I followed Andrew Sigler’s Programming an ATTiny85 Guide.

The Result

Bootloading Jig.
Result GIF.

Bill of Materials

– 1 Arduino Uno
– 1 ATTiny85 microcontroller
– 1 470 uF Capacitor
– 1 0.1 uF Capacitor
– 1 PCB Board of choice
– 1 LED
– 40 cms 22auw wire

ATTiny85.
ATTiny85.
PCBs.
PCBs.

Process

Mainly, the process consists of flashing the code onto the ATTiny85 microcontroller using an Arduino Nano.

Setup: Arduino UNO connected to ATtiny.
Setup: Arduino UNO connected to ATtiny.

Following the guide, now that I could see the LED blinking it meant the code was uploaded!

After checking the whole circuit worked on the breadboard, I soldered the whole setup onto the PCB board.

Soldering!
Soldering!

Finally, after a bit of flux and a couple of minutes of soldering, I made the Jig!

Bootloading Jig.
Bootloading Jig.

Thanks for reading!

Categories
Homemade Hardware

Assignment 2: ATTiny85 Neopixels Control

Assignment 1: ATTiny85 and Neopixels Control

The Idea

The project consists of developing some kind of interactive project with an ATTiny85 microcontroller. I decided to control a NeoPixels ring I had laying around with a potentiometer to control the speed of the flashing lights around the ring.

The Result

Final pcb mount.
Result GIF.

Bill of Materials

– 1 Neopixels ring
– 1 ATTiny85 microntroller
– 1 LM7805 Voltage Regulator
– 1 10K resistance
– 1 potentiometer
– 1 9V Battery
– 1 PCB Board of choice

 

Materials
Materials
My PCB.
My PCB.

Process

As I showed in the last post, the process started by flashing the code onto the ATTiny85 microcontroller using my custom bootloading jig. The code itself was adapted from the Adafruit Neopixel library “Simple” example sketch. It would have to be modified to receive an analog sensor value incoming from the potentiometer.

Bootloading Jig.
Bootloading Jig.

At first I just tried the Neopixels Sample example without the sensor control. I wanted to test if the library would work with the ATTiny. Once I confirmed the library worked I proceeded to add the potentiometer in order to control the speed in which the lights would spin around the ring.

Testing the Neopixels on the breadboard.
Testing the Neopixels on the breadboard.
ATTiny85 with Neopixels control on breadboard
ATTiny85 with Neopixels control on breadboard

After checking the hole circuit worked on the breadboard, I soldered the whole setup onto the PCB board.

Soldering the components onto the PCB board.
Soldering the components onto the PCB board.

Finally, after a bit of flux and a couple soldering, I completed a circuit I’m completely satisfied with.

Final setup.
Final setup.

The Code

Code Repository : https://github.com/lacouture100/ATTiny85-NeoPixel

Circuit Diagram

Circuit Diagram
Circuit Diagram

Thanks for reading!