added files

This commit is contained in:
Jonas_Jones 2024-11-07 23:42:54 +01:00
commit 75fcc3a492
23 changed files with 158 additions and 0 deletions

BIN
3d-files/Block Base.stl Normal file

Binary file not shown.

BIN
3d-files/Block Side.stl Normal file

Binary file not shown.

BIN
3d-files/Block Top.stl Normal file

Binary file not shown.

Binary file not shown.

BIN
3d-files/Handle Base.stl Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
3d-files/Neo_City.stl Normal file

Binary file not shown.

BIN
3d-files/Power Button.stl Normal file

Binary file not shown.

Binary file not shown.

BIN
3d-files/shiny_c.stl Normal file

Binary file not shown.

BIN
3d-files/shiny_c_thick.stl Normal file

Binary file not shown.

BIN
3d-files/shiny_n.stl Normal file

Binary file not shown.

BIN
3d-files/shiny_n_thick.stl Normal file

Binary file not shown.

BIN
3d-files/shiny_t.stl Normal file

Binary file not shown.

BIN
3d-files/shiny_t_thick.stl Normal file

Binary file not shown.

68
README.md Normal file
View file

@ -0,0 +1,68 @@
# K-Pop Lightstick
This Repo features the software of an Arduino Lightstick as well as the 3D Files for a custom **NCT DREAM** Lightstick
![Alt text](/pictures/lightstick_top3d.png)
## 3D-Print
The Lightstick was printed in 3 different colors.
The `Block Top.stl` file can be modified to not come with holes for the `Neo_City.stl` cubes rising out of the top to match the official lightstick more accurately.
*Be aware, that this 3D Build is slightly larger than the Official NCT DREAM Lightstick and you may not be allowed into concerts with it. I had no issues at the NCT DREAM Tour 2024 in Rotterdam but the security checks at the entrance were cursory, lacking the thoroughness you would usually have at different concerts.*
**WHITE:**
- `Block Base.stl`
- `Block Side.stl`
- `Block Top.stl`
- `Handle Base Bottom.stl`
- `Handle Base.stl`
**BLACK:**
- `Handle Ring Bottom`
- `Handle Ring Top`
- `Power Button`
**TRANSPARENT NEON GREEN:**
- `Neo_City.stl`
- `shiny_c_thicker.stl`
- `shiny_c.stl`
- `shiny_n_thicker.stl`
- `shiny_n.stl`
- `shiny_t_thicker.stl`
- `shiny_t.stl`
## Assembly
The Assembly of the Prints is pretty self-explanatory. Take a look at the pictures in the `/picture` folder of the repo.
I chose to not glue the `Block Base.stl` and the `Handle Base.stl` pieces together to be able to troubleshoot/replace the electronics inside at any time.
## Electronics
The `arduino.ino` file contains the Arduino code I used for the lightstick.
An **Arduino Nano** was used with the following Pin-Out:
```cpp
const int buttonPin = 2; // Pin for the button
const int redPin = 11; // Pin for the red channel of RGB LED
const int greenPin = 10; // Pin for the green channel of RGB LED
const int bluePin = 9; // Pin for the blue channel of RGB LED
const int motorPin = 8; // Pin to control the motor
```
*Note: These are the Digital Pins on the Arduino Nano*
### Features of the Program
- The `buttonPin` is for the Power Button on the `Handle Base.stl` and is used for controlling the Light.
- The `redPin`, `greenPin` and `bluePin` are used for controlling the LED. IMPORTANT: These are **ANODE RGB LEDs**. If You plan on using *Kathode LEDs*, simply remove `255 - ` from the `setRGB` function at the bottom of the Program, to invert the values. (This is only a fix based on logic, I have no LEDs to test it)
- The `motorPin` is used for controlling a simple Vibration Motor that runs for 1 second when turning on the Lightstick. This is inspired from the *VIXX Official Lightstick* that has similar behaviour. It is completely irrelevant to the general functionality of the Lightstick which is, well, to have Light.
### Instructions
1. Connect a Power button to the Arduino `buttonPin` and groud
2. Connect the Vibration Motor (A simple motor with some weight glued of axis to make it vibrate when rotating) to the `motorPin` and ground
3. Connect the RGB LEDs to the 3 color pins and 3.3V
4. Glue together 3 AAA Batteries, solder them together and connect them to the Voltage In` and ground
5. Flash the Arduino Nano with the program and you're done.
6. Insert the electronics into the Arduino and close it up.
## Usage
Hold the Power Button for approx. 1 second and release it. The Lightstick should vibrate for a second and then the lights turn on, defaulting to a neon green.
Press the button to cycle between colors and hold it for a second to turn it off again.

90
arduino.ino Normal file
View file

@ -0,0 +1,90 @@
const int buttonPin = 2; // Pin for the button
const int redPin = 11; // Pin for the red channel of RGB LED
const int greenPin = 10; // Pin for the green channel of RGB LED
const int bluePin = 9; // Pin for the blue channel of RGB LED
const int motorPin = 8; // Pin to control the motor
bool ledState = false; // State of the onboard LED
unsigned long buttonPressStartTime = 0; // Time when the button press starts
bool buttonPressed = false; // Current button pressed state
unsigned long lastButtonPress = 0; // Last time the button was pressed
int colorIndex = 0; // Index for cycling colors
// Define colors to cycle through (RGB format)
const int colors[][3] = {
{127,255,0}, // Neon Green
{255, 0, 0}, // Red
{0, 255, 0}, // Green
{0, 0, 255}, // Blue
{255, 255, 0}, // Yellow
{0, 255, 255}, // Cyan
{255, 0, 255} // Magenta
};
const int numColors = sizeof(colors) / sizeof(colors[0]);
void setup() {
pinMode(buttonPin, INPUT_PULLUP); // Set the button pin as input with pull-up resistor
pinMode(ledPin, OUTPUT); // Set the LED pin as output
pinMode(redPin, OUTPUT); // Set the red pin as output
pinMode(greenPin, OUTPUT); // Set the green pin as output
pinMode(bluePin, OUTPUT); // Set the blue pin as output
pinMode(motorPin, OUTPUT); // Set the motor control pin as output
// Initialize RGB LED to off and motor off
setRGB(0, 0, 0);
digitalWrite(motorPin, LOW); // Ensure motor is off
pinMode(LED_BUILTIN, OUTPUT); // Set the onboard LED pin as an output
digitalWrite(LED_BUILTIN, LOW); // Turn the LED off
}
void loop() {
// Read the button state
bool currentButtonState = digitalRead(buttonPin) == LOW;
if (currentButtonState && !buttonPressed) {
// Button just pressed
buttonPressed = true;
buttonPressStartTime = millis(); // Record the time of the button press
} else if (!currentButtonState && buttonPressed) {
// Button just released
buttonPressed = false;
// Check duration of button press
unsigned long pressDuration = millis() - buttonPressStartTime;
if (pressDuration >= 500) {
// Long press: Toggle onboard LED and motor
ledState = !ledState;
digitalWrite(ledPin, ledState ? HIGH : LOW);
if (ledState) {
// Turn motor on
digitalWrite(motorPin, HIGH);
delay(1000); // Keep motor on for 1 second
digitalWrite(motorPin, LOW); // Turn motor off
setRGB(0, 255, 0); // Start with green
colorIndex = 0; // Reset color index
} else {
// Turn off RGB LED
setRGB(0, 0, 0);
}
} else {
// Short press: Cycle colors
if (ledState) {
colorIndex = (colorIndex + 1) % numColors; // Cycle through colors
setRGB(colors[colorIndex][0], colors[colorIndex][1], colors[colorIndex][2]);
}
}
// Wait until the button is released before proceeding
while (digitalRead(buttonPin) == LOW);
}
}
// Function to set RGB LED color
void setRGB(int red, int green, int blue) {
analogWrite(redPin, 255 - red);
analogWrite(greenPin, 255 - green);
analogWrite(bluePin, 255 - blue);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
pictures/lightstick_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB