a picture showing temperature sensor and fan connected to grove shield

 

IOT is the next technological wave and we all would be riding it weather we want or not. As a technologist by hobby and profession I like idea of everything I interact with being smarter and it is quickly turning into reality. You are right, we are just getting started and we have a long way to go use the Internet of Things to make everyone’s life’s easier, more comfortable and save money as we still do not fully understand how we would manage a lot of things like interactions, interconnections and most importantly security of these millions of devices across the internet and constantly communicating.

 

However we will explore more about all of these as we go along this adventure. In this series we will be playing with Photon and Grove components and see where this journey takes us.

 

Here is what I ordered and will be using in this series

A Particle Photon – $19 (Photon)

Grove Kit for Photon – $49 (Grove Shield for Photon)

Grove Mixer Pack V1 – $29 (Grove Mixer Pack V2)

 

This would give us enough devices to play with. This is all we need for the entire tutorial however you do not need to order all of this, you could also order individual parts for the adventure you like as well.

 

If you already have knowledge of electronics than you might get the photon Starter kit and components that you need and use soldering and or jumper wires to make the circuit for your self.

 

If you are not good with electronics and or just lazy like me then here is the minimum of what you need to play along with the recipes in this series

1 Particle Photon

1 Grove Photon Shield

Individual Grove Components

 

Enough about starter information, let’s get started with our First Adventure

 

Fan with button

 

Requirement

  • Photon
  • Grove Shield for Photon
  • Mini Fan
  • Button
  • Cardboard

 

Let’s Get Cracking

  • Place the Photon on the Grove shield if you have not already done so and connect the USB port to the power.
a picture showing placement of photon on the grove shield

Photon Grove Shield

 

  • Now lets adds the connector wires to port A4 and D2
a picture showing connector wires to Grove shield

Connector Wire Photon

  • Connect the Button to the connector wire on D2
a picture showing the grove button

Grove Button

  • Connect the Mini Fan converter to connector on A4 and connect the Mini Fan to the 2 wire port on Fan connector
a picture showing grove mini fan assembly

Grove Mini Fan Assembly

  • This is how the final assembly should look like.
a picture showing a fan and button connected with photon

Mini Fan with Button

  • And now we would need to write some code to make this work. To start coding you would either need to login to your cloud IDE (Particle Build) or create a new project in your local particle Dev IDE (Particle Local IDE)

 

  • Now when you press the button the Fan should start spinning.
a picture showing running IOT fan through button

IOT Fan

Smart Fan – Runs when it’s hot

Requirement

  • Photon
  • Grove Shield for Photon
  • Mini Fan
  • Cardboard
  • Temperature Sensor

Lets make this fan smarter. We would use the temperature sensor to tell us the temperature and when its hot the fan will start spinning automatically.

  • Remove the connection of the button and add the temperature sensor at A0 in the Grove Shield
a picture showing connectors at A0 and A4 in Grove Shield

A4 and A0

  • This is how the final assembly would look like

a picture showing temperature sensor and fan connected to grove shield

Run fan when its hot



 

Run Fan through internet or when it’s hot

In the this adventure we will make this fan even smarter by able to receive commands through the internet so that we could start it through a browser.

Lets change our code to include a local variable and also expose a cloud function which would internally call the function to control the fan. Also we will alter the condition for turning on and off the fan to include the command given tough internet.

 

 

Now let us create a simple html page to turn on and off our Fan

 

 

a picture showing controlling fan from internet

Control Fan Through Internet

 

Hope you had fun doing the project. Any questions, comments and feedback are most welcome.