IoT Controlled Snow Machine

The most homemade snow machine you’ve ever seen. Made from a hairdryer, polystyrene and MKR1000. Controllable from anywhere in the world*

Things used in this project

Hardware components

Arduino MKR1000
Arduino MKR1000
× 1
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
× 1
Apple USB Powe Adapter
× 1
Jumper wires (generic)
Jumper wires (generic)
× 8
3.3V/5V 10A Relay Module
× 1
Solid State Relay
× 1
240V AC Socket and Plug
× 1
Hairdryer
× 1
2 Litre bottle (empty)
× 1
Magic Snow
Or crumble up polystyrene when you’ve run out
× 1

Software apps and online services

Arduino IDE
Arduino IDE
Sublime Text
Web Hosting

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

I live in the middle of wet rainy England and my boyfriend lives in the south of Oregon, USA. This year, they had so much snow, it looked like a winter wonderland. I was so jealous, I mean just look how pretty it is here. We joked how we need an IOT device that turned the snow on and off, as he hated it but I loved it… cue lightbulb moment.

Arduino/Genuino MKR1000

I had previously played around with the Arduino uno and wifi shield, but as this project would be outdoors (mum said that I can’t get snow in the house), I wanted to use a wireless connection. I’ve been looking for a while for a reasonably priced method of wirelessly connecting to the internet and after googling around for this project, I was really excited to hear about the MKR1000, as well as the competition.

My go-to was to use a simple wifi server sketch, but then I thought it would be more interesting if my boyfriend could turn on the snow. Using the Web client in WiFi101 examples, I adapted it so it connected to a txt file on a server and looked to see if there was a 0 or 1. I then made a website that would write 1 or 0 depending on if the on or off button was hit respectively.

The Snow Machine

Now the Arduino was all setup, I just needed to connect it to snow. I couldn’t find the right adapter to plug it into the clouds so I made a snow machine.

 

Well I tried to make a snow machine okay ?

So version 1 is a hairdryer and a plastic 2l bottle with the ends cut off, using magic snow (powder that you add water to)

Version 2 has the addition of a cloth to stop the snow falling into the hairdryer

Version 3 has crumbled up polystyrene because I ran out of magic snow

Electronics

Shoutout to my dad here. It’s good having an electrician in the family.

My MKR1000 could turn an LED on, but I needed it to turn on my “Snow Machine” aka my hairdryer. I tried using a relay. I read on the Arduino website that the board runs at 3.3V, so I used a 5V relay on a board that can be reliably triggered by 3.3V. This was soldered to a 240V AC socket that I could plug my hair dryer in. Worked a dream!

I went to test this with snow (note, this is where I used up all of my magic snow) and found that when I turned on from the website, the snow machine kept flicking on and off. My dad thought it was due to the relay so we added a solid state 2-480V relay and added a power supply to that. We then realised the problem was due to wifi connectivity issues in the garden so it would probably work fine with just the 5V relay.

Final Thoughts

Unfortunately because of time differences and running out of snow, my boyfriend didn’t get to turn on the snow machine.

We left the solid state relay in so I can play around with this device using other appliances in the future. Next stop the oven for IoT pizza. But for now, time to clear up all the polystyrene/snow in my garden. Going to need more to build a snowman.

Schematics

IoT SnowMachine Bread Board View

Circuit diagram of the setup I used for my IoT snow machine. It was my first time using Fritzing and couldn’t find the exact components so used images instead to give a rough overview

Code

index.php

PHP

Website to control IoT Snow Machine.
MKR1000 looks at switchState.txt – If 0 off, if anything else on
Opening on.php writes 1 to switchState.txt
Opening off.php writes 0 to switchState.txt
<?php 
// Website to control IoT Snow Machine.
// MKR1000 looks at switchState.txt if 0 off, if anything else on 
// Opening on.php writes 1 to switchState.txt
// Opening off.php writes 0 to switchState.txt 

?>


<!DOCTYPE html>
<html>
<head>
	<title>Make it snow</title>
	<!-- Make it look pretty by connecting up bootstrap -->
	<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body style="background-color: #00ccff;">

<main class="page-scroll" id="snow">

<div class="container-fluid text-center">
	<br><br>
</div>

<div class="container-fluid text-center ">
<div class="btn-group btn-group-justified">

<!-- Snow button opens on.php -->
	<a href="on.php" class="btn btn-default btn-lg">Snow</a>
<!-- Stop button opens off.php -->
	<a href="off.php" class="btn btn-default btn-lg">Stop</a>
</div>
</div>

</main>

on.php

PHP

Website to control IoT Snow Machine.
MKR1000 looks at switchState.txt if 0 off, if anything else on
Opening on.php writes 1 to switchState.txt
Opening off.php writes 0 to switchState.txt
<!-- Website to control IoT Snow Machine.
MKR1000 looks at switchState.txt if 0 off, if anything else on 
Opening on.php writes 1 to switchState.txt
Opening off.php writes 0 to switchState.txt -->


<?php 
//Include index file so basic styling is consitant 
include 'index.php';

//Var to open file
$myfile = fopen("switchState.txt", "w") or die("Unable to open file!");

//Text to be written to file. 0 means off. anything else means on
$txt = "1";

//Write to file (file thats been opened, data written to file)
fwrite($myfile, $txt);

//Close file
fclose($myfile);
?>

<footer style="margin-top: 300px">
<div class="container-fluid text-center ">
	<h2>It's snowing!</h2>
</div>
</footer>

</body>
</html> 

<style type="text/css">
/*When the arduino is turned on, the web page will start snowing*/
/*Cheers pal for the snow http://codepen.io/NickyCDK/pen/AIonk*/
#snow{
	background: none;
	background-image: url('https://www.wearewebstars.dk/codepen/img/s1.png'), url('https://www.wearewebstars.dk/codepen/img//s2.png'), url('https://www.wearewebstars.dk/codepen/img//s3.png');
	height: 100%;
	left: 0;
	position: absolute;
	top: 0;
	width: 100%;
	z-index:1;
	-webkit-animation: snow 10s linear infinite;
	-moz-animation: snow 10s linear infinite;
	-ms-animation: snow 10s linear infinite;
	animation: snow 10s linear infinite;
}
@keyframes snow {
  0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
  50% {background-position: 500px 500px, 100px 200px, -100px 150px;}
  100% {background-position: 500px 1000px, 200px 400px, -100px 300px;}
}
@-moz-keyframes snow {
  0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
  50% {background-position: 500px 500px, 100px 200px, -100px 150px;}
  100% {background-position: 400px 1000px, 200px 400px, 100px 300px;}
}
@-webkit-keyframes snow {
  0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
  50% {background-position: 500px 500px, 100px 200px, -100px 150px;}
  100% {background-position: 500px 1000px, 200px 400px, -100px 300px;}
}
@-ms-keyframes snow {
  0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
  50% {background-position: 500px 500px, 100px 200px, -100px 150px;}
  100% {background-position: 500px 1000px, 200px 400px, -100px 300px;}
}	

	
</style>

off.php

PHP

Website to control IoT Snow Machine.
MKR1000 looks at switchState.txt if 0 off, if anything else on
Opening on.php writes 1 to switchState.txt
Opening off.php writes 0 to switchState.txt
<!-- Website to control IoT Snow Machine.
MKR1000 looks at switchState.txt if 0 off, if anything else on 
Opening on.php writes 1 to switchState.txt
Opening off.php writes 0 to switchState.txt -->

<?php 
//Include index file so basic styling is consitant 
include 'index.php';

//Var to open file
$myfile = fopen("switchState.txt", "w") or die("Unable to open file!");

//Text to be written to file. 0 means off. anything else means on
$txt = "0";

//Write to file (file thats been opened, data written to file)
fwrite($myfile, $txt);

//Close file
fclose($myfile);
?>

<footer style="margin-top: 300px">
<div class="container-fluid text-center ">
	<h2>It's not snowing</h2>
</div>
</footer>

</body>
</html> 

IoT_SnowMachine

Based off the Web client in WiFi101 examples, this script is used on the MKR1000 to connect to wifi and check if a file on a server says anything other than 0. This then turns on my connected appliance, in this case my homemade snow machine

Source : IoT Controlled Snow Machine


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top