Filter results by

Make an IoT Weather Station with ARTIK Cloud

This article demonstrates using ARTIK Cloud with simple, off-the-shelf sensors and hardware. Specifically, we will be gathering climate data from a low-cost temperature sensor and relaying that data to the cloud via ARTIK Cloud APIs. From there, we can analyze our collected data in real-time or historically. This autonomous combination of hardware, software and networking is now being referred to as IoT (Internet of Things).

Click the name of the device you just added. In the pop-up, click “Generate Device Token…”.

Copy the device ID and device token on this screen. You will use these in the code.

Set up the Arduino and the temperature sensor

Now let’s wire the sensor. We are using a DHT11 here. They are not the most accurate, but they are cheap and easy to use for our simple use case.

Using the Arduino IDE, upload the Arduino code (dht11.ino) to the Uno. This code reads the temperature data from the sensor and sends the value (in Fahrenheit) to the serial port every 2 seconds (you can change this parameter in the code later, since ARTIK Cloud limits the number of messages per day).

Set up the Raspberry Pi

Connect your Raspberry Pi to a monitor, mouse and keyboard. Ensure that ethernet or WiFi is working, and make sure the OS is up-to-date:

$ sudo apt-get update
$ sudo apt-get upgrade

If not already installed, install Node.js for ARM, then add the packages ‘serialport’ and ‘node-rest-client’ via npm:

$ npm install serialport
$ npm install node-rest-client

Now connect the serial port from the Arduino to the USB on the Raspberry Pi.

Finally, copy the Node.js code (weather.js) to the Raspberry Pi (use scp to transfer it, or simply create a file and paste the code). Insert the device token and device ID you collected from My ARTIK Cloud into the placeholders in the code.

Also, wouldn’t it be interesting to know where your weather station is located? What about gathering GPS coordinates from an additional sensor—or even hardcoded, if the weather station will not be moved? That could certainly be added with more data fields.

There are other sensors that detect barometric pressure and wind speed. Why not capture a full array of weather data for your particular microclimate wherever you may be?

Yes! Connect me with Samsung IoT partners to hear more about their products and services. *

* By checking either box, you may receive notifications by phone, email, text, and/or other electronic means from Samsung Semiconductor, Inc. and its affiliates. If you choose to receive partner notifications, we may forward your contact information to ourpartners. You may unsubscribe from these services at any time by clicking on the unsubscribe link in our communications or by submitting a request here. Please see our Privacy Policy and Terms of Use for more information about how your data is stored and used.