Don’t Be Noisy Broomstick

Hello, for Halloween project I decided to make a witch’s broomstick. This broomstick is for the witches who do not like noisy places, and witches use this to scare off the people who are being loud. The broomstick will change the colors of the leds according to the noise level of surroundings.

This week I started making my broomstick and gathered materials for the lights. Last week we talked about buying the broomstick that’s already been made, but I thought it would be easier for me to make changes to the broomstick(when I am putting lights and so on) if I make it by myself. (and definitely more fun!) I am using a dowel and raffias for the broomstick.


(I forgot to take the last photo, but my broomstick is not this messy now:) )

Below are my codes in progress.


	1.	#define SAMPLE_WINDOW 33 // Sample window width in mS (33 mS = 
                ~30 Hz)
	2.	#define LED_PIN        0 // DIGITAL pin # where LEDs are connected
	3.	#define MIC_PIN       A1 // ANALOG pin # where microphone "OUT" is connected
	4.	 uint32_t color1 = strip.Color(0, 255, 0, 0); //Green
                 uint32_t color2 = strip.Color(173, 255, 0, 0); //Yellow
                 uint32_t color3 = strip.Color(255, 0, 0); //Red

	5.	void setup() {
	6.       pinMode(MIC_PIN, INPUT); 
                 pinMode(LED_PIN, OUTPUT);
	7.	}
	9.	void loop() {
	10.	  // Listen to mic for short interval, recording min & max signal
	11.	  unsigned int signalMin = 1023, signalMax = 0;
	12.	  unsigned long startTime = millis();
	13.	  while((millis() - startTime) < SAMPLE_WINDOW) {
	14.	    int sample = analogRead(MIC_PIN);
	15.	    if(sample < signalMin) signalMin = sample; 	
        16.	    if(sample > signalMax) signalMax = sample;
	17.	  }

For the circuit, I got Mic Amplifier, arduino gemma, RGBW neopixel jewel, 3xAAA battery pack.

This week I will finish my broomstick, build my circuit and finish writing the code.



%d bloggers like this: