# Weather Projection – Faysal, Shino and Cathy

Introduction

Talking about the weather, is always a good way to start off a conversation! After we collected some sensors that can measure the outside conditions, we decided to combine them and build a weather station! From projecting sensor controlled drawings onto a wall, to having  projections on a canvas with windmills on it, we finally decided to create a projection that interacts with the body!

Concept

Inspired by virtual fitting rooms, we decided to have something similar that would help you decide what to wear from your closet while taking into consideration the weather conditions.

As soon as the camera detects a specific color on your body, there would be a projection directly on the body of a type of clothing that corresponds to the outside weather. If our weather station detects low temperatures, an image of a coat would be projected, if high temperature, a t-shirt would be displayed instead. Other than the temperature sensor, we also included a humidity sensor, a light sensor and a  hall effect sensor. The humidity sensor would detect rain and thus project an image of an umbrella (closed or open depending on the amount of humidity in the air). The light sensor would darken or lighten the lenses of glasses that would be projected also on the body. The Hall effect sensor helped us “capture” the speed of the wind. We would build a windmill inside that would turn as fast as a windmill set outside and would give an idea of the wind speed.

Arduino

For the Hardware we used an Arduino uno board, a temperature sensor, a humidity sensor, a light sensor and a hall effect sensor. We also used a board that we mounted on top of the arduino so we’d be able to better connect the sensors. (see image below).

Arduino/Processing Code

We first needed to get our sensors working properly, we also needed to collect the data from the sensors and feed it to Processing that will generate the projections needed. At first, we had trouble connecting all the sensors together, but then thanks to Shuting’s help we were able to get our hands on her arduino code ,that can read 5 sensors at same time. Unfortunately it did not solve our problem completly. The sequence of the variables the processing was getting from arduino wasn’t the the same as the analogue input. So we asked Jim for some help and he showed us the library of firmata, which can be directly uploaded to the board without changing anything. As for the processing part, we just used the arduino input library that can get the variables.

Below shows our Processing work:

1. We started by using “println(arduino.analogRead(0)” to test the variables from the sensor ,so we can know their range and  how they change, so we can then adjust them to display different types of clothing, sunglasses and an umbrella,using “if…else if…else”.

2. We then decided to  make it more interactive. Ideally it would track the human body: When people step into the frame, there would be a projection of clothes. Using a motion sensor came to mind and we thought of using it as a switch or as a tracking sensor that would sense the body that entered the frame. As it seemed hard to realize, we then decided to go with a  web came that would track color. (which we learned towards the end of our processing class). The example tracked the color that was chosen by the mouse, ours needed to track only one specific color that we would assign in advance. We simplified the code, combined it with the changing of clothes, as well as the umbrella code and  then created a function to draw the glasses. Finally we combined everything together and tested it.

By the way, thanks to Harjot’s code on assignment 4, we were able to control the video tracking and activate it only when we push a button.

Usually When you push the button, the value changes but when you remove your finger, the value goes back to the original one. We made sure that each time the button is pushed the value would switch from 1023 to 0 or from o to 1023.

Original Screen:

Screen when button is pushed:

3 .Before we pushed the button we wanted the projection on the wall to be decorative, so we searched on openprocessing.org, and found a nice clock code that showed the date and time. It was quite nice as it’s colors change over time.

4. To make the projection more attractive we decided to introduce an electronic photo album along with the clock . We used the PNG photo format ,and made the pictures appear randomly as they rotate and scale in size. (it also looked like a digital collage). The “tint” made the collage cool ,but surprisingly the “tint” also affected the color tracking part, and made the clothes look darker ,so we delete this part eventually.

5. We finally combined the collage’s code along with the previous color tracking code.

Projection of Collage and Clock:

Projection of Clothes:

The light sensor, humidity sensor, and temperature sensor will affect what is projected on the user’s body, while tracking the pink dot held by the user. (the pink dot is the color that the web cam tracks).

>>> Our processing code can be accessed here:  processing_code

The Windmill

No weather project would be completed without a windmill! As previously mentioned, we used a hall effect sensor to detect the speed of the wind. We also decided to use a different arduino board for this circuit.

The wind detecting windmill was the physical interactive part of our project. Our design challenge was to create a device that would let people know the outside wind condition while they’re inside. So we built a windmill outside the room that collects data from the wind speed and uses it as an input data to stimulate and activate another windmill inside the room. When the windmill inside the room rotates, people would have an idea of the wind speed outside their door. (We first thought of having an inside fan that would blow air on the face of the user and make him feel the outside win. But since our fan wasn’t strong enough, we dropped that idea).

Building the windmill

1. Determining which sensor we would need to detect the wind speed.

Jim gave us many suggestions and recommended that we use the hall-effect sensor to detect the wind speed. After doing much research, the hall effect sensor was definitely the best to way calculate the RPM. (revolutions per minute that is a measure of the frequency of rotation).

The sensor works with a magnet, it would detect each time a magnet came close to it.

2. Building the device that detects the RPM

Setting up the Hall effect sensor:  connecting the hall effect sensor as an input device and the motor as an output device. (see image below).

Fixing the hall-effect sensor in the box and setting the magnet on the back of windmill:

>>> Our arduino code for the windmill can be accessed here: windmill_code

Fixing a motor and putting a windmill on it:

Here is a video of the windmill in action!!

Challenges

Some of the challenges that we faced was the inaccuracy of the body detection. Sometimes the projection was shaky and did not always detect the color on the user.

Sensor delay: we sometimes had delays as the sensor data would take time to travel and project the right image.

Next Steps

We definitely  would like to explore the use of the Kinect with our project in the future. We would then have better accuracy and a better interactive experience!