Week 8: Electronics Design

March 16, 2024

Electronic Design

This week was dedicated to electronics design, focusing on components, circuits, and designing with KiCad. I can divide the explanation into two stages. First, for my ToGo project, I attempted to develop a prototype in KiCad that would allow RGB LEDs to light up inside each cube, thanks to the ATTiny412 microcontroller. The second stage involved my opportunity to be at Aalto. As a remote student, I’m affiliated with this location. I had the chance to experience working here for two weeks. Under Kris’s leadership, we had the opportunity to engage in group work. Specifically, this week, Kris demonstrated the use of a Logic Analyzer and Oscilloscope.

Group Assigment Page

Our group assignment involved a deep dive into using Logic Analyzers, Oscilloscopes, and honing our debugging skills in electronic design. The experience was invaluable in understanding the intricacies of electronic diagnostics and troubleshooting. group assignment link 🚀

Greeting KiCad

For the ToGo project, I intended to enable data and power entry with magnetic properties through 4 Pin Pogo Contacts connected to RX, TX, VCC, GND outputs, thus allowing changes in the WS2812B RGB LED with commands received from these contacts.

Alt Text

Alt Text

You can see the parts list here. I wanted to add to the existing ATTiny412 library in Fab Academy, starting by designing with the WS2812B RGB LED in mind. I designed the work according to KiCad rules.

Alt Text Alt Text Alt Text

Alt Text Alt Text

Here’s your text revised and translated into English, maintaining the markdown structure and including the links you’ve provided. I made sure to keep the essential details and structure intact, focusing on clarity and readability for an English-speaking audience.

Fail Time

I conducted tests on the PCB. Kris specifically mentioned the importance of the channels, suggesting the error might stem from a 0.25 discrepancy. When I checked the KiCad rules, the PCB design complied and showed no errors. I also tested all soldering paths but couldn’t find the error. Unfortunately, the circuit did not work in the end.

Alt Text Alt Text

change the resistor 1k to 0 Alt Text

change the resistor 1k to 0 Alt Text change the resistor 1k to 0 Alt Text

check issues Alt Text

debugging time

Kris helped me identify the problem. There was a short circuit under the RGB on my PCB. I learned that before proceeding with the PCB, I should probably check for such issues.

Code

#include <Adafruit_NeoPixel.h>

#define LED 3 // Defines the pin for the LED
#define PIX_PIN 4 // Pin where the NeoPixel strip is connected
#define PIX_NUM 1 // Number of LEDs on the NeoPixel strip

// Creates an object for the NeoPixel strip
Adafruit_NeoPixel pixels(PIX_NUM, PIX_PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  pinMode(LED, OUTPUT); // Sets the LED pin as output
  pixels.begin(); // Initializes the NeoPixel strip
}

void loop() {
  pixels.clear(); // Clears all pixels on the strip

  byte r = 0;
  byte g = 0;
  byte b = 0;

  // Creates color transitions for each pixel
  for (int i = 0; i < PIX_NUM; i++) {
    for (int j = 0; j < 256; ++j) {
      r = j;
      g = j + 75;
      b = j + 150;
      pixels.setPixelColor(i, pixels.Color(r, g, b)); // Sets the color of the pixel
      pixels.show(); // Applies the updates
      delay(3); // Adds a short delay
    }
    delay(500); // Delay after the color transition
  }

  // Increases the brightness of the LED
  for (int i = 0; i < 256; ++i) {
    analogWrite(LED, i);
    delay(3);
  }

  // Decreases the brightness of the LED
  for (int i = 255; i > -1; --i) {
    analogWrite(LED, i);
    delay(3);
  }
  delay(500); // Delay before the loop restarts
}

It’s works

Source Files

Source Folder