Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
34 changes: 34 additions & 0 deletions submissions/skateboardLights/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: "@checkers"
slack_id: "U04J8RCP4RW"
github_handle: "@YashasSingh"
tutorial: # Link to the tutorial if you used one, including the default guide
wokwi: # Link to the Wokwi project
---

# Skateboard Backlight

No wowki link, too complex


This project is a skateboard backlight system that uses a photoresistor to adjust the brightness of the lights based on ambient light and an accelerometer to detect motion or tilt for dynamic lighting effects. The system is powered by a XIAO microcontroller and includes addressable LEDs for customizable lighting patterns.

A simplified BOM table
(pls include rough pricing of any extra components you're using)

| Comment | Footprint | Quantity | LCSC | Cost |
|-------------------|------------------------------------------------|----------|----------|--------|
| 4.7kΩ | C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | 1 | C15008 | 0.0682$|
| WS2812B-5050 | LED_WS2812B_PLCC4_5.0x5.0mm_P3.2mm | 35 | |
| XIAO ESP32C3 | XIAO ESP32C3 | 1 | |
| Photoresistor | GL5516 | 1 | C125626 | 0.049$ |
| Accelerometer | ACCELEROMETER MPU6050 | 1 | |will get myself

Tell us a little bit about your design process. What were some challenges? What helped?

The design process involved integrating a photoresistor and an accelerometer with the XIAO microcontroller to create a responsive lighting system. One challenge was calibrating the photoresistor to ensure accurate brightness adjustments in varying light conditions. The accelerometer required careful tuning to detect motion and tilt without false triggers. Using simulation tools like Wokwi and referencing datasheets helped streamline the process.

Some images of your design (make sure to include both the PCB and Schematic!):
![alt text](image.png)
![alt text](imagecopy.png)
![alt text](image-1.png)
Binary file added submissions/skateboardLights/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/skateboardLights/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/skateboardLights/imagecopy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
72 changes: 72 additions & 0 deletions submissions/skateboardLights/production/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#include <Wire.h>
#include <Adafruit_LIS3DH.h>
#include <Adafruit_Sensor.h>
#include <LiquidCrystal.h>

// Photoresistor on A0
#define LDR_PIN A0

// LCD pins: RS, EN, D4
LiquidCrystal lcd(2, 3, 4); // GPIO2, GPIO3, GPIO4

// Accelerometer
Adafruit_LIS3DH lis = Adafruit_LIS3DH();

void setup() {
Serial.begin(115200);

// LCD init
lcd.begin(16, 2); // Assuming a 16x2 LCD
lcd.print("Init...");

// Accelerometer init
if (!lis.begin(0x18)) { // Default I2C address
Serial.println("No LIS3DH found");
lcd.setCursor(0, 1);
lcd.print("Accel fail");
while (1);
}
lis.setRange(LIS3DH_RANGE_2_G); // +-2g

lcd.clear();
lcd.print("System Ready");
delay(1000);
lcd.clear();
}

void loop() {
// 1. Read photoresistor
int lightValue = analogRead(LDR_PIN);
float voltage = lightValue * (3.3 / 4095.0);

// 2. Read accelerometer
lis.read();
float x = lis.x_g;
float y = lis.y_g;
float z = lis.z_g;

// 3. Display on Serial Monitor
Serial.print("Light: ");
Serial.print(lightValue);
Serial.print(" | Voltage: ");
Serial.print(voltage, 2);
Serial.print(" V | Accel: ");
Serial.print(x, 2); Serial.print(", ");
Serial.print(y, 2); Serial.print(", ");
Serial.println(z, 2);

// 4. Display on LCD
lcd.setCursor(0, 0);
lcd.print("L:");
lcd.print(lightValue);
lcd.print(" V:");
lcd.print(voltage, 1);

lcd.setCursor(0, 1);
lcd.print("X:");
lcd.print(x, 1);
lcd.print(" Y:");
lcd.print(y, 1);

delay(500);
}