Arduino Bluetooth Hand Flame 3.0
Previously on...
?t=NodeMCU_BT_Wrist_Hand_Flame_Flash_IDK

Having now had access to LiPo batteries, we (me) has developed an amorousness towards the reduction of the size of projects... and as our (my) original NodeMCU bluetooth wrist fire project has been utilized by a friend for teaching technology, an upgrade was inevitable.


Ingredients
Arduino Nano
HC-06 Bluetooth Module
N-Channel 30V MOSFET
10K Resistor
10uf Capacitor
220 Resistor
3.7V 720mAh LiPo
CR2 3V
Glow Plug
PLA Filament (Natural)
(12) Neopixels
Molex (Female)



Notation(s)
1. Rechargeable!
2. Components will remain mostly exposed for teaching purposes. Ease of wear also a significant alteration for the teaching user who often permits others to demonstrate the device.
3. Elon Musk is not Iron Man. He is more of a poor man's Lex Luthor... for clarity, MSM.
4. Did you know? 150$?! https://www.amazon.com/Ellusionist-Fireshooter-Device-Shoots-Fireballs/dp/B078YFVQSB
5. TIP120 vs N-Channel MOSFET - TIP120 apparently has such a high resistance that it can often drop 2V while the MOSFET is more similar to a relay permitting a higher current -which- is suitable for glowing the plug. This was /tried/ before -however- the 10K pin to gnd was not handled thus it did not work. Lesson, learned. https://bildr.org/2012/03/rfp30n06le-arduino/
6. Once again as per the previous version, the glow plug (grounding resistor) buggers the circuit and my knowledge of electrical engineering struggles to comprehend how to isolate w/o another battery entirely. The solution? Another battery for fucks sake! Resistance is futile... as it were.
7. Settled due to teacher's deadline.
8. Send "1" thru any bluetooth application to trigger.



Code Red
// Bluetooth Hand Flame 3.0
// Vije Miller

#include "FastLED.h"
#define NUM_LEDS 12
CRGB leds[NUM_LEDS];
#define PIN 3

// button
int button = 7;
int state = 0;

// mosfet
int mosfet = 5;
int burn = 1250;

void setup()
{
Serial.begin(9600);
FastLED.addLeds<WS2812B, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
pinMode(button, INPUT);
pinMode(mosfet, OUTPUT);
digitalWrite(mosfet, LOW);
fire();
setAll(0, 0, 0);
showStrip();
}

void loop() {
if (Serial.available()) {
char data;
data = Serial.read();
if (data == '1') {
huzzah();
}
}
state = digitalRead(button);
if (state == LOW) {
delay(1000);
huzzah();
} else {
digitalWrite(mosfet, LOW);
}
}

void huzzah() {
fire();
digitalWrite(mosfet, HIGH);
delay(burn);
digitalWrite(mosfet, LOW);
setAll(0, 0, 0);
showStrip();
}

void fire() {
for (int k = 0; k < 255; k++) {
setPixel(0, 0, 0, k);
showStrip();
k = k + 3;
}
for (int k = 0; k < 255; k++) {
setPixel(11, 0, 0, k);
setPixel(1, 0, 0, k);
showStrip();
k = k + 3;
}
for (int k = 0; k < 255; k++) {
setPixel(10, 0, 0, k);
setPixel(2, 0, 0, k);
showStrip();
k = k + 3;
}
for (int k = 0; k < 255; k++) {
setPixel(9, 0, 0, k);
setPixel(3, 0, 0, k);
showStrip();
k = k + 3;
}
for (int k = 0; k < 255; k++) {
setPixel(8, 0, 0, k);
setPixel(4, 0, 0, k);
showStrip();
k = k + 3;
}
for (int k = 0; k < 255; k++) {
setPixel(7, 0, 0, k);
setPixel(6, 0, 0, k);
setPixel(5, 0, 0, k);
showStrip();
k = k + 3;
}
}

void showStrip() {
#ifdef ADAFRUIT_NEOPIXEL_H
// NeoPixel
strip.show();
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
// FastLED
FastLED.show();
#endif
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
#ifdef ADAFRUIT_NEOPIXEL_H
// NeoPixel
strip.setPixelColor(Pixel, strip.Color(red, green, blue));
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
// FastLED
leds[Pixel].r = red;
leds[Pixel].g = green;
leds[Pixel].b = blue;
#endif
}

void setAll(byte red, byte green, byte blue) {
for (int i = 0; i < NUM_LEDS; i++ ) {
setPixel(i, red, green, blue);
}
showStrip();
}

Archive
https://hackaday.io/project/167784-arduino-bluetooth-hand-flame-idk-3

@pkvi
"...may not meet professional standards."
12,138 miters
5 miters today
202 tenons
Subscribe