Introduction: Arduino Component Restarter With Temp Output Using Cayenne

About: I am 37, I have a job that allows me to build and make daily. I love my job. I have 6 children, my oldest is also a maker and has written her own instructables. I own a computer repair shop, and I build a lot …

Ok so what is the purpose of this device, I needed a easy way to restart network components. Sometimes the easiest way to fix buggy hardware is to hard reboot it. Right now i am using this for a Guest Router and my smartthings hub (they both need a reboot every now and again. This could be used to turn anything off for 10seconds and then back on automatically. As for the temp sensor the DS18B20 temp sensor is really cheap so you could use it to measure ambient temperature or make sure something in your network closet does not overheat.. Now that you know the devices purpose, here is how to make it.

Step 1: Gathering Your Materials

  1. Arduino UNO -Amazon $10 OR EBAY ABOUT $5
  2. Relay- I used This one because i had it and it has outlets- Amazon has them for $20
  3. Arduino 5100 Ethernet Shield -Amazon $10
  4. DS18B20 Temp Sensor --Amazon 5 for $12!

  5. 4.7k Resistor x 1

  6. Uno power supply -- any 5v to 9v power supply should work, or u can purchase a specially made arduino power supply.
  7. Arduino IDE
  8. Cayenne ------- Cayenne is a free service that allows easy Internet Of Things programming and monitoring. If you have never used it, it is very easy to start using with either a raspberry pi or arduino.

Step 2: Prepare the Hardware

  1. solder the 4.7k resistor between the data (yellow on mine) and the positive (red on mine). Leave enough of a lead on the end so we can solder it to the arduino(or you can breadboard it).
  2. Solder the temp sensor to the uno, red to 3.3v, black to ground, yellow to digital 3 (D3)
  3. Solder the relay leads to the uno, one lead to ground and one to digital pin 2 (D2). If you are using a different relay that requires dc voltage you will need to connect a lead to the 3.3v or the 5v depending on the relay. But the data pin is the same.
  4. Attach the network shield to the uno.
  5. Connect the completed uno to the computer by USB.
  6. Find your Port # for your arduino. We will need the port # to connect to it later. This is done by going to the device manager in windows (see pictures).

Step 3: The Cayenne Dashboard

Ok, once you have a account with cayenne you will be at the dashboard, this is where we will start the lesson.

So this is the dashboard, your is probably empty if you just signed up. Click on the "add New" button on the upper left corner and then click on "Device/Widget"

A new list will open up on the right and we will click on the "Microprocessor" option, Then "Arduino". Then ignore the next page and click "next", it may as well say "blah blah blah".

Select Arduino UNO from the list that pops up, you can use any of the arduino boards listed but for this example we are going to use the arduino UNO. Once selected it will ask how we are connecting it to the internet, for this example we are going to use the "Ethernet Shield 5100"

Take note of the authorization token key (a monkey got in the way of mine :) you will need this later.

Click on "sketch" next to the ethernet connection option. this is the sketch to connect the arduino to your cayenne dashboard. we will not be using this sketch as we are adding a temp sensor and we need to modify the default relay code to make it turn back on after turning the router off.

Now it will tell us "waiting for the board to connect" go ahead and minimize the browser for now, now its time for Fun with Arduino IDE. YEAH

Step 4: Add Your Arduino to Your Cayenne Dashboard (The Arduino IDE Part)

  1. Ok, now for the arduino IDE part. Open arduino and select "tools" in the top menu.
  2. Change the port # to the correct port number as seen in the pictures.
  3. Make sure it says Arduino/ Genuino Uno under "Board", if not select that.
  4. Click on "sketch" on the top menu, then "Include Libraries" and then"Manage Libraries".
  5. this is the Library Manager, this will download the files needed to make arduino work with cayenne.
  6. Type "Cayenne" into the search box and click install to install the library.
  7. Type "onewire" into the search box and download the top two results, we will need these libraries to make the temp sensor work.
  8. Close the library manager and open the "router_restarter.ion file supplied.
  9. Erase the stars and enter your authorization key token thingy in here. This was supplied back in the cayenne steps before (the monkey).
  10. Verify and upload the code to the arduino (the check mark button and the arrow button on the main page of the arduino IDE).

Step 5: Finish on Cayenne (Almost Done)

Once the code is uploaded the arduino uno should show up in the cayenne dashboard. Now we will Click on the "Add New" button in the top left corner of cayenne, and click on "device/Widget" and then Temperature, then our sensor. here you wil have to select your device (Arduino Uno), the Vurtual Pin (V2 for relay and V3 for Temp), and a couple other options (see pictures).

Great, if done right, and no issues, you should have it all connected and be working. You could optionally create a case for it, but i didnt.

IoT Builders Contest

Participated in the
IoT Builders Contest

Circuits Contest 2016

Participated in the
Circuits Contest 2016