Create Raspberry IoT project with Artik IoT platform

Would you like to use your Raspberry Pi to develop IoT project? Follow this guide to know how to create a Raspberry Pi IoT project.

Artik IoT platform is an end-to-end IoT platform that helps us to build awesome Raspberry Pi IoT project. It is an open platform that enables different devices to connect to the cloud. Using Artik IoT, connected devices or sensors send data to the cloud. Application, services or other connected devices use this information according to their business requirements. As you may already know, Internet of things is the next technological revolution that will have a huge impact on our life, so it is important to know how to use this platform. Before reading this tutorial, it is important you have a complete overview of what is Internet of things and how it will impact our future.

This tutorial wants to provide a step by step description about how to implement a Raspberry Pi IoT project using Artik IoT platform. It will explore:

how to configure a device

how to create the IoT data model in Artik IoT

how to write an application that sends data to this IoT platform

Artik IoT platform overview

This IoT platform supports several data exchange paradigms and provides different SDKs depending on the developing language we prefer.

The main features provided by Artik IoT are:

Data driven development

Real-time data using Websocket

Different data and device support

Artik is a well structured IoT platform and before starting using it, I recommend you to read the article about how to use IoT platform to have an overview. Moreover, Artik is a well-documented platform with useful and interesting example and you can have more information at this link. An interesting aspect of this platform is the cloud API that enables external devices to connect to this platform and exchanging data.

Configure the device in Artik to use Raspberry Pi IoT

First of all, it is necessary to have an account to configure the device. The account is free. This tutorial is based on Raspberry Pi but the process of configuring the device is device agnostic. Once you are logged in, in the Samsung Artik IoT dashboard, you have to click on the device and start configuring it:

It is important you add a unique name so that your device can be identified. That’s all, you have created your first device ready to send data. The next step is configuring the data model using the Manifest.

Implement Artik IoT data model

This is an important aspect because it is necessary to configure in Artik the variables we want to handle in our IoT project. These variables are sent by the device to the cloud and they represent the parameter we measure using the sensors.

Raspberry Pi, in this project, uses two sensors (to make the project simple):

DHT11

BMP180

The first sensor, DHT11, measures the temperature and humidity while the second one, BMP180, measures the temperature and the pressure. Later in this post, we cover how to connect them to Raspberry. By now, it is important to know that Raspberry sends three different parameters:

Temperature

Humidity

Pressure

These are the variable we have to configure in Artik IoT cloud platform. The steps to configure them are described below:

In this case, we add the temperature field that will hold the temperature values coming from the DHT11 sensor. To add the other parameters you can repeat the same steps. At the end you will have:

How to use sensors with Raspberry Pi IoT project

The configuration steps are now completed, the next step is connected Raspberry to sensors. Be aware of the wiring otherwise, you could damage your device or sensors. The connection between Raspberry and the two sensors is shown in the pictures below:

To use these sensors is important you install wiringPi library. The code used to send data to Artik IoT platform is written in NodeJS but you could use other languages too. Before reading sensors values, it is necessary to install two NodeJS libraries:

Send Raspberry data to the cloud

Finally, we are ready to send the sensor data to the cloud. It is important to notice that the device must be authenticated before it can send data. To do it, we need to use a secret token and the device Id that we get from the cloud IoT platform clicking on the device we have created previously.

As soon as you start the NodeJS app, it begins sending data to the Artik IoT platform. Accessing to the Artik IoT dashboard you can verify the data and create charts:

At the end of this post, you gained the knowledge about Artik IoT platform and how to use it to develop a complete IoT project. This guide described how to build a Raspberry Pi IoT project using sensors and IoT cloud platforms.

About The Author

I'm an electronic engineer with over 15 years of
experience in computer programming. I'm the author of the book "Android things projects". I'm a MVB at DZone and DZone Guide Author. I have contributed to the IoT guide. I'm the technical reviewer of the book Internet of Things with Arduino Blueprints(published by PacktPub). I love creating IoT projects using Arduino, Raspberry Pi,
Android, and other platforms. I am interested in the convergence
between IoT and the mobile applications. I'm SCEA, SCWCD, and SCJP
certified.
Follow on: Twitter | Linkedin

Get more stuff

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Sign up for our Newsletter

Enter your email and stay on top of things,

Get SwA updates delivered to your inbox. Article, tips, source code

×

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.