Devices & Components
Arduino Nano
Resistor 220 ohm
Jumper wires (generic)
Rotary potentiometer (generic)
Capacitor 1000 µF
Toggle Switch, Toggle
9V battery (generic)
Axial Fan, 5 V
Battery Holder, 9V
RGB Diffused Common Cathode
LM393 Digital Audio Sensor
Hardware & Tools
Hot glue gun (generic)
Soldering iron (generic)
Project description
Code
Blinking Tali's helmet
arduino
The software for Arduino Nano controlling the voice-activated blinking for Tali's helmet. Together with the wiring diagram it's quite self explanatory and simple.
1// Tali helmet - voice detection LED control by bzqp (2021) https://www.youtube.com/user/Beezqp 2//https://www.thingiverse.com/bzqp/designs 3// 4//A0 5 - potentiometer 6//D13 - microphone 7//D3 - red 8//D5 - green 9//D6 - blue 10int 11 brightness = 0; 12int brightnesscache=0; 13int loudness = 0; 14const unsigned 15 long timeout=100; // voice sampling time in ms 16unsigned long timestamp=0; // 17 first sample timestamp 18void setup() { 19 pinMode(13, INPUT); //D13 - microphone 20 21 pinMode(A0, INPUT); //A0 - potentiometer 22 pinMode(3, OUTPUT); //D3 - red 23 24 pinMode(5, OUTPUT); //D5 - green 25 pinMode(6, OUTPUT); //D6 - blue 26 Serial.begin(9600); 27 // Serial for debugging, not really needed normally 28} 29void loop() { 30brightness 31 = floor(analogRead(A0)/4); 32loudness = digitalRead(13); 33Serial.println(brightness); 34 35if(brightness<8){ 36 37 // if brightness below 5 turn off the lights to prevent unbalanced RGB color 38 flickering 39 analogWrite(3, 0); 40 analogWrite(5, 0); 41 analogWrite(6, 42 0); 43 delay(1); 44} 45else{ 46unsigned int dl=(floor(float((float(1)/(float(brightness)+2))*float(100000)))); 47 //delay in microseconds, the same total delay for every brightness setting 48//Serial.println(brightness); 49if(loudness==LOW){ 50 51 // if a sound is detected by a microphone, mark a timestamp 52 timestamp=millis(); 53} 54if(millis()-timestamp<timeout){ 55 56 // if within the timeout period, gradually lower the brightness to zero 57 while(brightnesscache>0){ 58 59 brightnesscache--; 60 analogWrite(3, brightnesscache/2); 61 analogWrite(5, 62 brightnesscache/3); 63 analogWrite(6, brightnesscache); 64 delayMicroseconds(dl); 65 66 } 67 } 68else{ 69 // if no sound is detected, gradually rise the brightness 70 to the value determined by the potentiometer 71 while(brightnesscache<brightness){ 72 73 brightnesscache++; 74 analogWrite(3, brightnesscache/2); 75 analogWrite(5, 76 brightnesscache/3); 77 analogWrite(6, brightnesscache); 78 delayMicroseconds(dl); 79 80 } 81 // just to be sure it goes all the way up to brightness 82 analogWrite(3, 83 brightness/2); 84 analogWrite(5, brightness/3); 85 analogWrite(6, brightness); 86} 87} 88} 89
Blinking Tali's helmet
arduino
The software for Arduino Nano controlling the voice-activated blinking for Tali's helmet. Together with the wiring diagram it's quite self explanatory and simple.
1// Tali helmet - voice detection LED control by bzqp (2021) https://www.youtube.com/user/Beezqp 2//https://www.thingiverse.com/bzqp/designs 3// 4//A0 - potentiometer 5//D13 - microphone 6//D3 - red 7//D5 - green 8//D6 - blue 9int brightness = 0; 10int brightnesscache=0; 11int loudness = 0; 12const unsigned long timeout=100; // voice sampling time in ms 13unsigned long timestamp=0; // first sample timestamp 14void setup() { 15 pinMode(13, INPUT); //D13 - microphone 16 pinMode(A0, INPUT); //A0 - potentiometer 17 pinMode(3, OUTPUT); //D3 - red 18 pinMode(5, OUTPUT); //D5 - green 19 pinMode(6, OUTPUT); //D6 - blue 20 Serial.begin(9600); // Serial for debugging, not really needed normally 21} 22void loop() { 23brightness = floor(analogRead(A0)/4); 24loudness = digitalRead(13); 25Serial.println(brightness); 26 27if(brightness<8){ 28 // if brightness below 5 turn off the lights to prevent unbalanced RGB color flickering 29 analogWrite(3, 0); 30 analogWrite(5, 0); 31 analogWrite(6, 0); 32 delay(1); 33} 34else{ 35unsigned int dl=(floor(float((float(1)/(float(brightness)+2))*float(100000)))); //delay in microseconds, the same total delay for every brightness setting 36//Serial.println(brightness); 37if(loudness==LOW){ 38 // if a sound is detected by a microphone, mark a timestamp 39 timestamp=millis(); 40} 41if(millis()-timestamp<timeout){ 42 // if within the timeout period, gradually lower the brightness to zero 43 while(brightnesscache>0){ 44 brightnesscache--; 45 analogWrite(3, brightnesscache/2); 46 analogWrite(5, brightnesscache/3); 47 analogWrite(6, brightnesscache); 48 delayMicroseconds(dl); 49 } 50 } 51else{ 52 // if no sound is detected, gradually rise the brightness to the value determined by the potentiometer 53 while(brightnesscache<brightness){ 54 brightnesscache++; 55 analogWrite(3, brightnesscache/2); 56 analogWrite(5, brightnesscache/3); 57 analogWrite(6, brightnesscache); 58 delayMicroseconds(dl); 59 } 60 // just to be sure it goes all the way up to brightness 61 analogWrite(3, brightness/2); 62 analogWrite(5, brightness/3); 63 analogWrite(6, brightness); 64} 65} 66} 67
Downloadable files
Wiring diagram
The wiring for the blinking Tali's helmet
Wiring diagram

Wiring diagram
The wiring for the blinking Tali's helmet
Wiring diagram

Documentation
3D printing and vacuum forming files
The 3D printing and vacuum forming files are available on my Thingiverse. The model was based on Rainyfire's original helmet and an in-game Tali model extracted from Mass Effect 3.
https://www.thingiverse.com/thing:4983479
Comments
Only logged in users can leave comments