Tong’s Final Project

When you want to build a habit or achieve a goal, you can use this box I designed to help! Our box has 7 switches, and each day you complete a task, you can flip one switch. After successfully completing tasks for 7 consecutive days, the box will release colorful confetti to celebrate! It encourages you to cultivate your habits in 7-day cycles.

Video

Mode

Here’s how the circuit works:

7 Switches: Each switch corresponds to an LED. When a switch is toggled, it lights up the respective LED, indicating that the task for the day is completed.

UNO Board: All switches and LEDs are connected to an Arduino UNO board, which monitors the status of the switches. The Arduino ensures the logic for tracking task completion across the 7-day cycle.

Electromagnet: The electromagnet is also connected to the Arduino. When all 7 switches are toggled (indicating the completion of the 7-day cycle), the UNO board cuts power to the electromagnet, causing it to lose its magnetic hold and release the iron piece attached to a balloon. This action releases colorful confetti to celebrate the achievement.

Here is my code:

int celebrationState = false;
int previousCelebrationState = false;

void setup()
{
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
pinMode(11, INPUT_PULLUP);
pinMode(12, INPUT_PULLUP);

pinMode(4, OUTPUT); // 控制EG的引脚

digitalWrite(4, HIGH); // 默认保持EG通电

Serial.begin(9600);
}

void loop()
{
bool sunday = digitalRead(12);
bool monday = digitalRead(11);
bool tuesday = digitalRead(10);
bool wednesday = digitalRead(8);
bool thursday = digitalRead(7);
bool friday = digitalRead(6);
bool saturday = digitalRead(5);

// 检查所有灯是否亮了(所有输入为LOW)
if (sunday == LOW && monday == LOW && tuesday == LOW && wednesday == LOW && thursday == LOW && friday == LOW && saturday == LOW) {
celebrationState = true;

if (celebrationState == true && previousCelebrationState == false) {

  // 切断EG电源
  digitalWrite(4, LOW);
}

} else {
celebrationState = false;

digitalWrite(4, HIGH);

}

previousCelebrationState = celebrationState;
}

Instructables Link

https://www.instructables.com/HabitSpark-7

Tong’s Weekly Check-In Calculator

Weekly Check-In Calculator

This is a physical check-in device placed at home. When you set a goal and start acting on it, you press the button to check in each time you complete a task. When you reach your check-in goal, the calculator will shoot out confetti to congratulate you.

I had two big problems with the model this week, the first was how the confetti could be sprayed and used multiple times. The second was how to implement the idea that the user must clock in 7 times in a row to trigger the confetti.

Model

Regarding the colored confetti , I took your feedback this week into consideration and looked for many ways to make simple ribbon cones, and finally decided to use the prototype below.

This video inspired me about how to do a continuous clocking

Oh, and as far as how to pull this leash, I think an eccentric wheel ➕ rotator (I’d prefer a servo) could do it.

So now I have my prototype model.

Next I am going to use 3D modeling and printing for all mechanical parts except for circuits, motors, lights, switches, etc.

Circuit diagram

My main question is: which one of the servos or the DC motor can actually drive my leash setup. I first tried to build the circuit diagram for the DC motor, I chose to connect 7 switches in series, each responsible for one LED. This was to make sure that the switches were pressed one after the other to get the confetti going. Then add another DC motor in parallel with the LED on the last switch. This makes it possible to press the switch 7 times in a row to start the confetti (after 7 consecutive punches, the reward is given directly). This was a tough design and it took me about 3 hours to connect it.

The other option is to use servos, luckily I only had to make a few modifications to the last schematic and all the necessities were taken care of by the way the circuit was connected, I just had to set up how the motor would turn in the code section !!!!!!

https://www.tinkercad.com/things/5lMZJcvQAXR-spectacular-jaagub-migelo?sharecode=iTnPKJLV1yxjRMc6lsGPtdOhXR0Uciwbhw4CyJ37h7Y

What I’m going to do next:

Model and print the 3’s

Solder the circuit and test

Assemble

Items that need to be purchased:

Micro servo motor

7 Thumb switches

confetti: colored plastic strips

Tutorial Outline Google Doc:

https://docs.google.com/document/d/1ch30k8iBucDNol0SyI1oBi6YFl1yrAllQNIEkyu97m0/edit?usp=sharing

Instructables Account:

https://www.instructables.com/member/Tong88

Tong’s final idea

Sunrise Wake-Up Light

I love sunrises, but I can’t see them every day. So I want to design a lamp that can project a sunrise effect at home, allowing me to see it anytime. It can be an alarm clock that wakes people up with a “sunrise” every morning.

Current desired functions: Ability to set time. Ability to change light to mimic the sunrise effect as closely as possible.

Challenges encountered: How to wake people up? How to achieve the sunrise effect?

Weekly Check-In Calculator

This is a physical check-in device placed at home. When you set a goal and start acting on it, you press the button to check in each time you complete a task. When you reach your check-in goal, the calculator will shoot out confetti to congratulate you.

Kitty No-Go Zone!

This is a rain curtain! You can place it at the doorway of rooms you don’t want your cat to enter. When you turn it on, it detects if the cat is approaching. If the cat gets close, water will continuously fall, forming a rain curtain. This way, you won’t be disturbed by your cat scratching at the door at night, and you can also keep the door wide open for air circulation anytime.

Tong’s Halloween Costume Final

My final costume is a self-created half-deity, half-demon with Chinese traditional elements (quite a long title)

I cut a circular board with a diameter of 32 centimeters from an acrylic sheet, then used laser engraving to carve traditional Chinese cloud patterns and concentric circles mimicking a halo. Then, using a glue gun, I attached LED light strips to the edge of the circular board, so when the lights are on, this disc looks like a halo floating behind my head.

My concept is that when the halo is yellow, he is a merciful god, and when the halo turns red, he becomes a demon. However, on Halloween, his halo constantly shifts between yellow and red, as if the red demon is trying to break out, but the yellow god is trying to suppress him, and they are in a struggle.

This is my circuit diagram, it’s very simple.

This is my code,

#include <Adafruit_NeoPixel.h>

#define PIN         1    // 灯带引脚
#define NUMPIXELS   75   // 灯带灯珠数
#define STATIC_R    242  // 静态颜色 R
#define STATIC_G    163  // 静态颜色 G
#define STATIC_B    0    // 静态颜色 B
#define METEOR_R    224  // 流星颜色 R
#define METEOR_G    163  // 流星颜色 G
#define METEOR_B    22   // 流星颜色 B

Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  pixels.begin();  // 初始化灯带
  pixels.clear();  // 确保开始时灯带关闭
}

void loop() {
  // 1. 从两端向中间依次点亮
  lightUpFromEnds(STATIC_R, STATIC_G, STATIC_B);
  delay(500);  // 短暂停留后进入褪色效果

  // 2. 进入初始褪色效果,单次5秒,共循环20秒
  for (int i = 0; i < 4; i++) {  // 循环4次,20秒
    fadeEffect(STATIC_R, STATIC_G, STATIC_B, 5000);
  }

  // 3. 从中间向两端光点流星效果
  meteorEffect(METEOR_R, METEOR_G, METEOR_B, STATIC_R, STATIC_G, STATIC_B);
  
  // 4. 黄色光点从两端向中间流星效果
  meteorToCenter(METEOR_R, METEOR_G, METEOR_B);

  // 5. 光点分散到第19颗和第56颗并分两段同时环绕点亮
  disperseAndRing(STATIC_R, STATIC_G, STATIC_B);

// 7. 新增褪色效果,单次5秒,共循环20秒
  for (int i = 0; i < 4; i++) {  // 循环4次,20秒
    fadeEffect(STATIC_R, STATIC_G, STATIC_B, 5000);
  }

// 黄色呼吸灯逐渐加快到红色频闪灯效果
  acceleratingBreatheToStrobe(2000, 200, 5000);  // 初始周期2秒,最终周期0.2秒,红色频闪持续5秒

// 黄色常亮2秒
  setAllPixels(242, 163, 0);  // 黄色
  pixels.show();
  delay(6000);  // 常亮2秒

  

  // 6. 从第1颗开始缓慢长拖尾流星效果跑5秒
  runSingleMeteorAroundRing(METEOR_R, METEOR_G, METEOR_B, 3);

  // 7. 进行褪色渐变颜色效果
  fadeCycle();

  // 8. 所有灯常亮2秒后,进行5秒褪色效果,持续30秒
  staticLightAndFade(STATIC_R, STATIC_G, STATIC_B);
}

// 从两端向中间依次点亮的函数
void lightUpFromEnds(int r, int g, int b) {
  int left = 0;
  int right = NUMPIXELS - 1;
  while (left <= right) {
    pixels.setPixelColor(left, pixels.Color(r, g, b));
    pixels.setPixelColor(right, pixels.Color(r, g, b));
    pixels.show();
    delay(50);
    left++;
    right--;
  }
}

// 初始褪色效果函数
void fadeEffect(int r, int g, int b, int cycleTime) {
  int fadeSteps = 255;
  int stepDelay = cycleTime / (2 * fadeSteps);

  // 渐亮
  for (int i = 0; i <= fadeSteps; i++) {
    setAllPixels(r * i / fadeSteps, g * i / fadeSteps, b * i / fadeSteps);
    delay(stepDelay);
  }

  // 渐暗
  for (int i = fadeSteps; i >= 0; i--) {
    setAllPixels(r * i / fadeSteps, g * i / fadeSteps, b * i / fadeSteps);
    delay(stepDelay);
  }
}

// 从中间向两端光点流星效果并变色
void meteorEffect(int midR, int midG, int midB, int finalR, int finalG, int finalB) {
  int left = (NUMPIXELS - 1) / 2;
  int right = left + 1;

  while (left >= 0 || right < NUMPIXELS) {
    for (int i = 0; i < NUMPIXELS; i++) {
      if (i == left || i == right) {
        pixels.setPixelColor(i, pixels.Color(midR, midG, midB));
      } else {
        uint32_t currentColor = pixels.getPixelColor(i);
        int r = (currentColor >> 16) & 0xFF;
        int g = (currentColor >> 8) & 0xFF;
        int b = currentColor & 0xFF;
        pixels.setPixelColor(i, pixels.Color(r * 0.8, g * 0.8, b * 0.8));
      }
    }
    pixels.show();
    delay(50);

    if (left >= 0) left--;
    if (right < NUMPIXELS) right++;
  }

  for (int i = 0; i < NUMPIXELS; i++) {
    pixels.setPixelColor(i, pixels.Color(finalR, finalG, finalB));
  }
  pixels.show();
}

// 黄色光点从两端向中间流星效果
// 长拖尾流星效果从两端向中间
void meteorToCenter(int r, int g, int b) {
  int left = 0;
  int right = NUMPIXELS - 1;

  while (left <= right) {
    pixels.clear();

    // 设置左侧和右侧的流星头部光点
    pixels.setPixelColor(left, pixels.Color(r, g, b));
    pixels.setPixelColor(right, pixels.Color(r, g, b));

    // 为左右流星创建长拖尾效果
    for (int j = 1; j <= 15; j++) {  // 拖尾长度为15
      int leftPos = (left - j + NUMPIXELS) % NUMPIXELS;
      int rightPos = (right + j - NUMPIXELS) % NUMPIXELS;

      // 计算拖尾的亮度,越靠近头部亮度越高
      int tailBrightness = 255 * (15 - j) / 15;  // 逐渐减少亮度
      pixels.setPixelColor(leftPos, pixels.Color(r * tailBrightness / 255, g * tailBrightness / 255, b * tailBrightness / 255));
      pixels.setPixelColor(rightPos, pixels.Color(r * tailBrightness / 255, g * tailBrightness / 255, b * tailBrightness / 255));
    }

    pixels.show();
    delay(50);  // 控制流星移动速度

    // 向中间移动
    left++;
    right--;
  }
}

// 从黄色呼吸灯逐渐加快到红色频闪灯的效果
void acceleratingBreatheToStrobe(int initialCycleTime, int finalCycleTime, int strobeDuration) {
  int yellowR = 242, yellowG = 163, yellowB = 0;  // 黄色
  int redR = 255, redG = 0, redB = 0;             // 红色
  int currentCycleTime = initialCycleTime;
  
  // 循环控制呼吸灯逐渐加快
  while (currentCycleTime > finalCycleTime) {
    // 黄色呼吸效果:先亮后暗
    for (int i = 0; i <= 100; i++) {
      setAllPixels(yellowR * i / 100, yellowG * i / 100, yellowB * i / 100);
      delay(currentCycleTime / 200);  // 每次呼吸的亮起延迟
    }
    for (int i = 100; i >= 0; i--) {
      setAllPixels(yellowR * i / 100, yellowG * i / 100, yellowB * i / 100);
      delay(currentCycleTime / 200);  // 每次呼吸的暗下延迟
    }

    // 减少循环时间,使呼吸速度加快
    currentCycleTime = max(currentCycleTime - 100, finalCycleTime);
  }

  // 红色频闪效果
  unsigned long startTime = millis();
  while (millis() - startTime < strobeDuration) {
    setAllPixels(redR, redG, redB);  // 红色亮起
    delay(50);                       // 频闪亮的时间
    setAllPixels(0, 0, 0);           // 灭
    delay(50);                       // 频闪灭的时间
  }
}



// // 光点分散到第19颗和第56颗并分两段环绕点亮
void disperseAndRing(int r, int g, int b) {
  int leftTarget = 18;  // 第19颗灯珠(从0计数)
  int rightTarget = 55; // 第56颗灯珠(从0计数)

  pixels.clear();
  
  // 设置光点在第19颗和第56颗位置
  pixels.setPixelColor(leftTarget, pixels.Color(r, g, b));
  pixels.setPixelColor(rightTarget, pixels.Color(r, g, b));
  pixels.show();
  delay(500);

  // 环绕点亮:第19颗到第55颗
  for (int i = leftTarget; i <= rightTarget; i++) {
    pixels.setPixelColor(i, pixels.Color(r, g, b));
    pixels.show();
    delay(50);
  }

  // 环绕点亮:第56颗到第75颗
  for (int i = rightTarget + 1; i < NUMPIXELS; i++) {
    pixels.setPixelColor(i, pixels.Color(r, g, b));
    pixels.show();
    delay(50);
  }

  // 环绕点亮:第1颗到第18颗
  for (int i = 0; i < leftTarget; i++) {
    pixels.setPixelColor(i, pixels.Color(r, g, b));
    pixels.show();
    delay(50);
  }
}


// 单颗光点从第1颗开始缓慢长拖尾流星效果跑6圈,最后一圈结束后从第一颗依次点亮整条灯带
void runSingleMeteorAroundRing(int r, int g, int b, int numCircuits) {
  for (int circuit = 0; circuit < numCircuits; circuit++) {
    for (int i = 0; i < NUMPIXELS; i++) {
      pixels.clear();
      
      // 当前光点设置为亮度最大
      pixels.setPixelColor(i, pixels.Color(r, g, b));
      
      // 创建长拖尾效果
      for (int j = 1; j <= 15; j++) {  // 拖尾长度为10
        int pos = (i - j + NUMPIXELS) % NUMPIXELS;
        int tailBrightness = 255 * (10 - j) / 10;  // 逐渐减少亮度
        pixels.setPixelColor(pos, pixels.Color(r * tailBrightness / 255, g * tailBrightness / 255, b * tailBrightness / 255));
      }
      
      pixels.show();
      delay(50);  // 控制光点移动速度
    }
  }

  // 结束后从第一颗依次点亮整条灯带
  for (int i = 0; i < NUMPIXELS; i++) {
    pixels.setPixelColor(i, pixels.Color(r, g, b));
    pixels.show();
    delay(50);  // 控制每颗灯依次点亮的速度
  }
}

// 褪色渐变颜色效果函数
void fadeCycle() {
  for (int i = 0; i < 5; i++) { // 循环2次
    // 渐变 黄色 (242, 163, 0) -> 白色 (255, 255, 255)
    fadeToColor(242, 163, 0, 255, 0, 0, 2500);

    // 渐变 白色 (255, 255, 255) -> 红色 (255, 0, 0)
    fadeToColor(255, 0, 0, 242, 163, 0, 2500);
  }
}

// 渐变到指定颜色的函数
void fadeToColor(int r1, int g1, int b1, int r2, int g2, int b2, int duration) {
  int steps = 100;  // 渐变的步骤数
  int delayTime = duration / steps;  // 每步的延迟时间

  for (int i = 0; i <= steps; i++) {
    int r = r1 + ((r2 - r1) * i) / steps;
    int g = g1 + ((g2 - g1) * i) / steps;
    int b = b1 + ((b2 - b1) * i) / steps;

    setAllPixels(r, g, b);  // 将颜色设置到所有灯珠
    delay(delayTime);       // 延迟以控制渐变速度
  }
}

// 呼吸效果函数
void breatheEffect(int r, int g, int b, int cycleTime) {
  int fadeSteps = 150;  // 呼吸效果的渐变步骤数
  int stepDelay = cycleTime / (2 * fadeSteps); // 每步的延迟时间

  // 渐亮
  for (int i = 0; i <= fadeSteps; i++) {
    setAllPixels(r * i / fadeSteps, g * i / fadeSteps, b * i / fadeSteps);
    delay(stepDelay);
  }

  // 渐暗
  for (int i = fadeSteps; i >= 0; i--) {
    setAllPixels(r * i / fadeSteps, g * i / fadeSteps, b * i / fadeSteps);
    delay(stepDelay);
  }
}

// 常亮2秒后进行5秒褪色效果,持续30秒
void staticLightAndFade(int r, int g, int b) {
  unsigned long startTime = millis();

  while (millis() - startTime < 15000) { // 持续30秒
    // 常亮2秒
    setAllPixels(r, g, b);
    delay(2000);

    // 5秒的褪色效果
    fadeEffect(r, g, b, 5000);
  }
}

// 设置所有像素为指定颜色
void setAllPixels(int r, int g, int b) {
  for (int i = 0; i < NUMPIXELS; i++) {
    pixels.setPixelColor(i, pixels.Color(r, g, b));
  }
  pixels.show();
}

This is the complete loop video。

More photos:

East meets West in magic.

Shot with FIMO CStill 800T.

World-breaking dimensions

The little kitty also loves today’s god-demon.

Tong’s Halloween presents progress

Shopping list:

✅ LED light strings—for costume decoration

✅ Organza fabric

✅ Metallic paint

Arduino application part

Install fading, flickering, and color-changing LED strips around the circumference of an acrylic disc.

Like this.

To-do list:

🎈Start making facial and clothing decorations after receiving my materials (not important)

🎈Draw the design for the acrylic disc, laser engrave

🎈 Write Arduino code, test LED strip effects

🎈Install LED strips.

🎈Create the headdress frame.

Tong’s three Halloween costume ideas

1️⃣ A ghost bride from China.

Wearing the most horrifying costume on the most joyous day is an important part of Chinese horror culture. For Asian children, a ghost bride in traditional attire is a hundred times scarier than a bride in a blood-stained wedding dress.

Materials: LED lights

Wire

Beaded strings

Red chiffon

A traditional Chinese bridal gown

2️⃣ a fairy carrying clouds.

This is a fairy with a glowing, color-changing rain cloud above its head, wearing a coat woven from raindrops. It can control the rain.

Materials: LED lights

Glue gun

Fiber optic cables

Chiffon

Cotton

3️⃣ a female gunner (Gatling)

Wearing a halo on the head and a glowing mask. Dressed in a qipao, with thigh-high stockings made of lights.

Materials: LED light strings,

Cardstock

Acrylic

3 D printed parts.

Finally,a short video of your Arduino practice.

ZZ-Monster Plush Night Light

The completed form of ZZ!

ZZ’s story

He’s a creative little monster who never has insomnia, and every time he has a new idea, the little hat on his head lights up! I’m making this pillow for myself, hoping that it will both guard my sleep and ensure my inspiration never runs dry .

ZZ’s body

There have been some changes. Initially, there were only two LED lights on ZZ’s head. However, when I put the lights inside the doll’s body, I tried one in the heart 🫀 area. I really liked this feeling, as if it had truly come to life. So, I decided to add another glowing part, and that’s how the circuit ended up looking like in the later version.

The creation process was very immersive. I set up a camera to record the entire process, but unfortunately it went out of focus, so I only have a few screenshots. The middle images can be used.

Tong’s “ZZ”Decompression Light Proposal

I’m planning to make a little monster pillow named “ZZ”. He’s a creative little monster who never has insomnia, and every time he has a new idea, the little hat on his head lights up! I’m making this pillow for myself, hoping that it will both guard my sleep and ensure my inspiration never runs dry 😭.

Materials: fabric, diodes, battery case, resistors, needle and thread.

MACBook Pro (2011, 13”, A1278) tear down work

Hi there, this is TONG’s teardown assignment for the MacBook Pro (2011, 13″, A1278). The serial number of the device is: D92GCBN0DRJ7, which can be easily looked up on Apple’s official website to find its model information.

🌟after teardown⬇️

🌟Tear down tools⬇️

I had previously replaced the fan, speakers, and battery for my 2015 MacBook Pro, so initially I didn’t think I would spend much time on disassembly. However, the screws 🔩 on this old laptop really gave me a hard time, and I did end up forcibly cutting some of the metal washers used for fastening. Everything went relatively smoothly overall. I really enjoyed it and was so focused that I almost forgot to take pictures of my disassembly process, only leaving a video to record it all 😂.

🌟The following are the components I disassembled and can identify.⬇️

1Battery

Model: A1322 10.95V-63.5Wh

Serial Number: 9G1340UV6D3MA

2 Fan

Single fan design (no wonder the 13″ Mac had obvious heat dissipation issues back then)

Model: KSB0505HB

Serial Number: QE1342DER411C

Disassembly level: Can still be further disassembled

3 Motherboard

  • Model: 820-2936-B
  • External components:

  • Main chips:

  • RAM memory

Equipped with two 8GB memory sticks

Model: 8G DDR3L-1333 SODIMM MAC

4 Wi-Fi signal module

Model: BCM94331PCIEBT4

5 Slot-loading CD drive

6 Speaker system

7 Trackpad module

There are three still unknown chips on the Touchpad Trackpad Flex Ribbon Cable Replacement.

Disassembly level: Can be further disassembled

8 Keyboard

I can’t unscrew all furthers, so this is as far as I can disassemble.

9 MagSafe power port

10 SSD cable

11 Screen

12 Structural components

🌟Materials / Manufacturing processes ⬇️

MaterialsManufacturing processes
ChassisAluminum alloyMolding, anodized treatment
Cablesplastic Metal
DisplayLCD panel with IPS (In-Plane Switching) technology
KeyboardPlasticScissor mechanism structure, injection molding process
MotherboardMulti-layer PCB (Printed Circuit Board)
BatteryLithium-ion battery, aluminum shell
TrackpadGlass surface & aluminum base
Speaker System Plastic  & metal
Ports and Connectors Plastic  & metal
Cooling FanPlastic blades & metal bearings

🌟 My feeling ⬇️

My biggest impression from this teardown work is how ingenious the internal structure of a Macbook is. The internal components are all precisely engineered, with a compact and orderly layout. I also really like the modular design in the device, where all the functions I can identify in the hardware appear in a modular form. The immediate feeling when opening the back cover and seeing the internal structure is that it’s beautiful, a very intuitive engineering aesthetic. I think this kind of modularity is beneficial for everyone. I’m also starting to understand why so many Apple enthusiasts like to disassemble MACs 😊.