Introduction: Interactive Glowing Mushrooms
This instructable will show you how to make mushrooms that will glow in the dark. You can turn individual mushrooms off and on again by pressing the top.
I started this project for a school assignment where we had to create something using the Arduino Uno.
I wanted to create something pretty and magical and quickly decided that I wanted to make glowing mushrooms. Initially, I wanted to not only make them glow, but also have them move and play a tune. However, due to the deadline for the project, I had to scrap those ideas.
This project was inspired by DIY perks' video:
Here you will find the process I went through to create these lights, as well as the instructions on how to do it.
For this project, you will need:
- An Arduino Uno;
- A breadboard;
- A perf board;
- 5 LEDs from a neopixel LEDstrip;
- 5 pressure Sensors;
- A light sensor;
- A 470Ω resistor;
- 6 resistors of any value;
- Stiff wire (non-conductive!);
- Transparent silicone sealer;
- Watercolour paint;
- Cling film
- A tree log;
- A drill;
- A chisel and hammer;
- Wires in several colours;
- Electrical tape;
- Other, strong tape;
- Hot glue;
- Shrink tube;
- A heat gun;
- A soldering station;
- Pliers;
- tissue paper;
- A steady hand and a lot of time and patience;
Step 1: Concept Design
I almost immediately knew what I wanted to make for this project. Since I had been wanting to make glowing mushrooms for a while, I figured this was the perfect opportunity to do so. To get a bit of an idea of the technology behind the mushrooms, I sketched out how I would make them. This was an important step in my process, because this way I could actually visualise the hardware and sort things out in my head. Eventually, the design changed a bit (I placed the LED above the pressure sensor, added stiff wire to press down on the sensor and hold up the top of the mushroom and I removed the movement and sound components).
Before starting this project I had no experience with the Arduino and only knew how to code a little bit in Python, so I did some research. I roughly knew what I would need for my project, so I scavenged the internet and started to experiment with code. I quickly ran into problems with my servo's (which I wanted to use to make the mushrooms move), so I decided to drop that idea. Later, when I found I needed more time than I initially thought to figure out how to code what I wanted and to hollow out the tree log, I also decided to drop the music idea and just stick with only the mushrooms.
I also realised that it would probably be a good idea to place the pressure sensor underneath the LED, so no light would be blocked by the sensor.
Step 2: Preparing the Log
One of the most time-consuming tasks of this project was hollowing out the log. I would suggest either getting one from a soft kind of wood that's easily workable (unlike me), or buying an already hollowed out log.
If you want to hollow out your own log, you can either burn the hole in or use the method I used. For my method you will need a drill, a chisel, a hammer, and a lot of patience.
Before you start drilling, you should think about how far down you want to hollow the tree out. Note: If you remove more wood, the project will end up being less heavy, but also less strong.
When you roughly know how deep you want to go, you can start drilling holes. Remove the wood in between the drill holes using the chisel and a hammer. Repeat this process until you are satisfied.
Remember that the side of the log with the hole in it will be the bottom!
Now you should plot out where you want your mushrooms, the light sensor and the power cable to go and drill holes from the outside to the inside of the log at those places. I recommend placing the light sensor far away from the mushrooms, because if it is too close the light from the mushrooms will mess with the values of the sensor.
Step 3: Making the Mushroom Caps
For the mushroom caps you will need transparent silicone sealant, watercolour paints, cling film, something to stir with and round objects (or crumbled up tissue paper).
mix a dollop of silicone with a little bit of watercolour paint. I chose white, so I could still give my mushrooms any colour I wanted using the colour of the LEDs, but if you just want one colour you can make it more intense by making the mushrooms that same colour.
Next, place the silicone on a piece of cling film and fold the cling film over it, so that the silicone is sandwiched in-between. Flatten the silicone using your hands, until it has the preferred thickness. You can hold it up to the light to get an idea of how it will look. Make sure you make the mushroom caps big enough for your LEDs and pressure sensors to fit in!
Place the cling film over a round object and leave it to dry.
When it has fully dried you can take it out of the cling film, remove any access around the edges if needed and your mushroom cap is done.
Step 4: Wiring the LEDs
While your mushroom caps are drying, you can start preparing the hardware components, starting with the LEDs. To prepare the LEDs, you will need to do the following:
- Cut and strip 9 red wires, 9 black wires(I used blue instead with some LEDs due to a lack of black wire) and 9 cables in a colour of your choice(these will be the wires used for the data). Make sure your cables are long enough to go from the bottom of your tree trunk all the way to the top and even stick out quite a bit. It's better to make them too long than too short
- Cut 5 LEDs off your led strip.
- Solder the black cables to the ground pins of the LEDs. One cable on each side of the LED. Repeat with the red cables for the 5-volt pin on the LEDs and with the other cables for the data pin. You will have one LED with wires on just one side, this will be the fifth and last LED and therefore will not need the other three cables. On the LEDs, you will see arrows pointing in one direction. Use a permanent marker to mark the end of the wires on the side the arrows are coming from. This is very important as you will need it later!
- To protect the wires and prevent them from touching each other, cut off pieces of shrink tube, place them over the exposed wires and use a heat gun to shrink them.
- Lastly, twist the cables together as shown in the pictures.
Note: If you want to, you can remove the plastic cover on the LEDs, but I would recommend leaving it on to protect the LED.
Step 5: Adding the Pressure Sensors
Underneath of the LEDs, we will place the pressure sensors.
To prepare them you will need to do the following:
1. Cut off around 15cm of stiff wire (make sure it does NOT conduct electricity!) I used silver wire;
2. Twist the wire into a spiral as shown on the pictures;
3. Glue one side of the spiral to the pressure sensors (I used superglue to do this, but any glue will do);
4. Make sure the pressure sensors fit underneath the LEDs. If they don't, you can bend the wires of the LEDs to make them fit.
5. Place the pressure sensors underneath the LEDs, having the LED in-between the wire spiral. Look at the photos for reference.
6. If we want the pressure sensors to work properly, we will have to make something to hold them down when you press on the wires. To do so, I placed tape between the cables underneath the pressure sensors.
Next, we need to solder wires to the pressure sensors. (You can also do this step before you do all the others, but I did it in this order)
7. Cut off and strip 15 wires: 5 for the ground, 5 for the data and 5 for the 5-volt. I would recommend using different colours for these than you used for the LEDs. I used Orange, green and grey.
8. Solder the wires for the data and 5-volt to the pressure sensors. We will use the ground wire when adding the resistors (in the next step)
NOTE: You may want to add some stiff wire to these wire bundles as well. This will give the mushroom stems a little bit more strength in the end. I didn't do this because I didn't realise how heavy the eventual mushrooms would be.
Step 6: The Light Sensor and Resistors
In this step, we will prepare the light sensor and add the resistors where needed.
We will start with the light sensor:
1. Once again, cut and strip wire for the ground, the data and one for the 5-volt.
2. Solder the wire for the data and 5-volt to the light sensor.
Now, we will add all the resistors.
For the pressure sensors and the light sensor you will need to do the following:
1. Cut the ground wire in half, strip each end of the wire and solder a resistor between the two ends. It doesn't matter what the value of the resistor is. Use shrink tube over the entire resistor so it's protected and firmly secured inside of the wire.
2. Next, either carefully cut off the rubber/plastic the in approximately the middle of the data wire to expose a bit of the actual wire, or cut the data wire in half, once again strip each end and solder them back together.
3. Solder the ground wire with the resistor inside to the exposed wire on the data wire as shown on the pictures. To cover up the exposed wires either use electrical tape or shrink tube (be sure to put some on the wire before soldering!)
For the LEDs, we will only need one resistor.
1. Choose one of the LED wire bundles you just created (I would suggest picking the one with the longest wires, since this one will go the furthest down the tree log) note: do not pick the LED with wires on just one side! This will be the last one of the 5!
2. Add the 470Ω resistor to the data wire of that LED in the same way you did with the pressure sensors and the light sensor.
3. Once again, also use shrink tube to protect and secure the resistor.
Step 7: Making the Stems
To make the stems, we first have to figure out how long we want them to be approximately:
1. Pull the LED cable bundles through the holes you created in the tree log.
2. Play a bit with the lengths of the sticking out cables until you are satisfied with the way it looks. If you want a bit of an idea on how it will look, you can place the silicone mushroom caps over them.
3. Once you are satisfied, mark the place on the wire bundle where it goes into the log using a permanent marker.
4. Take the cable bundles out again and use some tape to make sure the wires stay firmly together.
Now for the part where we actually make the stems:
1. Paint the wires the same colour as your mushrooms. I would suggest painting a little bit further down than where you want your stems to go, just to be sure.
2. Mix together transparent silicone sealer with watercolour paints the same way as you did with the mushroom caps.
3. Place the coloured silicone on a sheet of cling film and lay a cable bundle on top of it. Make sure the silicone is in about the middle of where you want the stem to be on the wires.
4. Fold the cling film in half with the fold as close to the wire bundle as possible.
5. Squeeze the silicone against the wire bundle and play around with it until the wires where you wanted the stem to go are covered completely. Note: It's a good idea to bring the silicone up as high as you can, but don't cover up the pressure sensor.
6. Repeat the process with the other 4 wire bundles and leave them to dry.
Step 8: Testing (and the Code)
Before soldering everything together, you probably want to test if your components still work.
Use a breadboard to quickly connect all the LED bundles and the light sensor and upload the code to your Arduino to check if everything still works. Note that you probably have to adjust the parameters of the sensors to your project.
NOTE: I do not have any experience with coding, so this is not the most efficient way to do it by far. It would probably be better to use several functions and run the different variables of the LEDs through them. I tried to get this working, but eventually decided to do it the easier, less efficient way, because I was spending too much time on the code and had to move on.
The code:
#define NUM_LEDS 5
#define DATA_PIN 6
CRGB leds[NUM_LEDS];
//LED 0
int inPinPressureSensor0 = A0;
int ledState0 = HIGH;
float pressureReading0;
float pressurePrevious0 = LOW;
//LED 1
int inPinPressureSensor1 = A1;
int ledState1 = HIGH;
float pressureReading1;
float pressurePrevious1 = LOW;
//LED 2
int inPinPressureSensor2 = A2;
int ledState2 = HIGH;
float pressureReading2; float pressurePrevious2 = LOW;
//LED 3
int inPinPressureSensor3 = A3;
int ledState3 = HIGH;
float pressureReading3;
float pressurePrevious3 = LOW;
//LED 4
int inPinPressureSensor4 = A4;
int ledState4 = HIGH;
float pressureReading4;
float pressurePrevious4 = LOW;
//Light sensor
int inPinLightSensor = A5;
float lightReading;
float lightPrevious;
void setup()
{
Serial.begin(9600);
FastLED.addLeds(leds, NUM_LEDS);
//pressure sensor LED 0
pinMode(inPinPressureSensor0, INPUT);
//pressure sensor LED 1
pinMode(inPinPressureSensor1, INPUT);
//pressure sensor LED 2
pinMode(inPinPressureSensor2, INPUT);
//pressure sensor LED 3
pinMode(inPinPressureSensor3, INPUT);
//pressure sensor LED 4
pinMode(inPinPressureSensor4, INPUT);
//Light sensor
pinMode(inPinLightSensor, INPUT);
}
void loop()
{
//pressureReading LED 0
pressureReading0 = analogRead(inPinPressureSensor0);
delay(20);
//pressureReading LED 1
pressureReading1 = analogRead(inPinPressureSensor1);
delay(20);
//pressureReading LED 2
pressureReading2 = analogRead(inPinPressureSensor2);
delay(20);
//pressureReading LED 3
pressureReading3 = analogRead(inPinPressureSensor3);
delay(20);
//pressureReading LED 4
pressureReading4 = analogRead(inPinPressureSensor4);
delay(20);
//Light sensor
lightReading = analogRead(inPinLightSensor);
//If it is light, the LED is off.
if(lightReading > 28.0)
{
ledState0 = LOW;
ledState1 = LOW;
ledState2 = LOW;
ledState3 = LOW;
ledState4 = LOW;
}
//If it's dark and it was light previously, the LED will turn on.
if(lightReading <= 28.0 && lightPrevious > 28.0)
{
ledState0 = HIGH;
ledState1 = HIGH;
ledState2 = HIGH;
ledState3 = HIGH;
ledState4 = HIGH;
}
//if pressure sensor pin 0 reads <= 38.0 (when pressed) and when the previous state > 38.0 (not pressed) if(pressureReading0 >= 38.0 && pressurePrevious0 < 38.0 && lightReading <= 28.0)
{
//if LED 0 is on, turn it off. otherwise (so when it's off) turn it on.
if (ledState0 == HIGH)
{
ledState0 = LOW;
}
else
{
ledState0 = HIGH;
}
}
//if pressure sensor pin 1 reads <= 100.0 (when pressed) and when the previous state > 100.0 (not pressed) if(pressureReading1 >= 100.0 && pressurePrevious1 < 100.0 && lightReading <= 28.0)
{
//if LED 1 is on, turn it off. otherwise (so when it's off) turn it on.
if (ledState1 == HIGH)
{
ledState1 = LOW;
}
else
{
ledState1 = HIGH;
}
}
//if pressure sensor pin 2 reads <= 180.0 (when pressed) and when the previous state > 180.0 (not pressed) if(pressureReading2 >= 180.0 && pressurePrevious2 < 180.0 && lightReading <= 28.0)
{
//if LED 2 is on, turn it off. otherwise (so when it's off) turn it on.
if (ledState2 == HIGH)
{
ledState2 = LOW;
}
else
{
ledState2 = HIGH;
}
}
//if pressure sensor pin 3 reads <= 6.0 (when pressed) and when the previous state > 6.0 (not pressed) if(pressureReading3 >= 6.0 && pressurePrevious3 < 6.0 && lightReading <= 28.0)
{
//if LED 3 is on, turn it off. otherwise (so when it's off) turn it on.
if (ledState3 == HIGH)
{
ledState3 = LOW;
}
else
{
ledState3 = HIGH;
}
}
//if pressure sensor pin 4 reads <= 10.0 (when pressed) and when the previous state > 10.0 (not pressed) if(pressureReading4 >= 10.0 && pressurePrevious4 < 10.0 && lightReading <= 28.0)
{
//if LED 4 is on, turn it off. otherwise (so when it's off) turn it on.
if (ledState4 == HIGH)
{
ledState4 = LOW;
}
else
{
ledState4 = HIGH;
}
}
if(ledState0 == HIGH)
{
leds[0] = CRGB( 255, 255, 255);
FastLED.show();
delay(30);
}
else
{
leds[0] = CRGB::Black;
FastLED.show();
delay(30);
}
if(ledState1 == HIGH)
{
leds[1] = CRGB( 255, 255, 255);
FastLED.show();
delay(30);
}
else
{
leds[1] = CRGB::Black;
FastLED.show();
delay(30);
}
if(ledState2 == HIGH)
{
leds[2] = CRGB( 255, 255, 255);
FastLED.show();
delay(30);
}
else
{
leds[2] = CRGB::Black;
FastLED.show();
delay(30);
}
if(ledState3 == HIGH)
{
leds[3] = CRGB( 255, 255, 255);
FastLED.show();
delay(30);
}
else
{
leds[3] = CRGB::Black;
FastLED.show();
delay(30);
}
if(ledState4 == HIGH)
{
leds[4] = CRGB( 255, 255, 255);
FastLED.show();
delay(30);
}
else
{
leds[4] = CRGB::Black;
FastLED.show();
delay(30);
}
pressurePrevious0 = pressureReading0;
pressurePrevious1 = pressureReading1;
pressurePrevious2 = pressureReading2;
pressurePrevious3 = pressureReading3;
pressurePrevious4 = pressureReading4;
lightPrevious = lightReading;
//Open the serial monitor to see your values and change the parameters accordingly.
Serial.println("Pressure0:");
Serial.println(pressureReading0);
Serial.println("Pressure1:");
Serial.println(pressureReading1);
Serial.println("Pressure2:");
Serial.println(pressureReading2);
Serial.println("Pressure3:");
Serial.println(pressureReading3);
Serial.println("Pressure4:");
Serial.println(pressureReading4);
Serial.println("LightReading:");
Serial.println(lightReading);
delay(200);
}
Step 9: Soldering
Now the most difficult part of the project: soldering everything together... inside the log.
Note: you will need to protect your exposed wires with shrink tube, so don't forget to put some on before soldering your cables! If you do forget, you can also cover them up with electrical tape.
1: Start by soldering a cable from the 5-volt pin of your Arduino to the perf board. Do the same with the ground, data pin ~6 and A0 till A5.
2. Next, pull the light sensor through its hole in the log. Solder the ground to the ground on the perf board, the 5-volt to the 5-volt on the perf board and the data to A5 on the perf board. Use shrink tube to cover up exposed wires.
3. Pull your first mushroom stem through its hole in the log (this is the stem with the resistor on the data wire!). Carefully solder every wire in its place: (you can also look at the schematic to help you with an overview of what goes where)
- Solder the data wire of the pressure sensor to A0 on the perf board;
- Solder the ground-wire of the pressure sensor to the ground on the perf board;
- Solder the 5-volt wire of the pressure sensor to the 5-volt on the perf board.
- Solder the data wire you marked of the LED to ~6 on the perf board;
- Solder the ground wire you marked of the LED to the ground on the perf board;
- Solder the 5-volt wire you marked of the LED to the 5-volt on the perf board;
4. Cover up the exposed wires with shrink tube.
5. Tape the soldered wires together in bundles to keep an overview.
6. Pull through your second mushroom.
- Solder the data wire you didn't mark of the first LED to the data wire you did mark of the second LED (the one you just pulled through);
- Solder the ground wire you didn't mark of the first LED to the ground wire you did mark of the second LED (the one you just pulled through);
- Solder the 5-volt wire you didn't mark of the first LED to the 5-volt wire you did mark of the second LED (the one you just pulled through);
Repeat the same process for the other wires and mushroom stems. Check the schematic to see which data wire connects to which data pin.
When you're done soldering, use hot glue (or tape, if you want to be able to remove them) to secure your perf board and Arduino inside of the log.
Have patience and make sure you connect the right wires to each other, otherwise you may risk blowing up one of your LEDs! (This is why it was very important to mark the end of the three wires on the LEDs)
Step 10: Assembly and Changing Parameters
When everything is soldered into place, it's time to assemble the mushrooms!
1: Clean up the part of the stem where it meets the log using scissors and glue them stuck to the tree. It's best to use silicone for this.
2: Pick out the mushroom caps you want to use and glue a piece of tissue paper on the inside. This will make sure you can't see the wire inside of the mushroom.
3: Use hot glue to glue together parts of the wire spiral you created to make sure it keeps it shape after you press it.
4: Glue the mushroom cap to the wire spiral.
5: Cut out a circle of tissue paper about the size of the mushroom and cover up the bottom of the mushrooms. This will clean it up and even look a little like spores! Reference the photo to see how I cut the tissue paper.
Now the mushrooms are all assembled, it's time to change the parameters of the sensors.
Run your Arduino code and open the serial monitor. Look at the values of the sensors and adjust them until you're happy. You can make the mushrooms as responsive to pressure and the light sensor as responsive to light as you prefer.