Medium One Prototyping Sandbox with Nordic Thingy and Raspberry Pi 3
This Kit includes a Nordic Thingy and Raspberry Pi 3 board. You will be connecting the Nordic Thingy to the Raspberry Pi via Bluetooth, then the Raspberry Pi will send data from the Nordic Thingy to the cloud over Ethernet or WiFi. You then can log in and visualize the data in the Medium One Sandbox, a cloud service we provide with built-in tools you can use with your data.
You will also create a workflow to send alerts to your phone, as well as, an email, if the pedometer in the Nordic Thingy detects steps have been taken. A workflow is one of the tools on the sandbox that helps you make useful applications using your data.
Step 1: Connecting your Nordic Thingy and Raspberry Pi 3 to the Medium One Sandbox using Ethernet
If you want to connect your Raspberry Pi to the cloud over WiFi, please refer to Step 6: Configuring WiFi on your RPI, at the end of this document. Otherwise, you will need an Ethernet cable to plug into your Raspberry Pi.
1. Configure your Raspberry Pi to WiFi or plug in the Ethernet cable.
2. Turn on the Raspberry Pi by plugging in one of the USB Mini’s in your Kit and connecting it to a power source.
3. Wait two minutes for the Pi to finishing booting up.
4. Now, power on your Nordic Thingy. You will need to take off the black rubber box, and find the switch on the inside (outlined in red pictured below). If the switch does not turn it on, it may be out of batteries. In this case, plug it in via USB mini port (green outline pictured below). Note: The Nordic Thingy only charges when it is plugged in AND the switch is turned to on.
5. You should see a green light blinking after a couple moments. You may see a blue light blinking beforehand, meaning the Nordic Thingy is looking for something to pair with. If it does not eventually go to the green light, make sure your Raspberry Pi is on and running. Once it shows the green light, congratulations! It has paired with the Raspberry Pi.
Step 2: Login to the Sandbox and Visualize the Nordic Thingy data
1. Navigate to https://www.medium.one/. Click “LOG IN”.
2. LOG IN using the “username” and “password” on the postcard included in your Kit. You will find them in the Your Medium One Sandbox Credentials box.
3. After you LOGIN, you should see something like this. A description of each section of this Dashboard follows.
This is the “Real Time Events Stream” widget. Each of the lines, beginning with the date in blue on the left, is a piece of data coming in from the Nordic Thingy. You can see in the text, sensor readings like pressure, temperature, and humidity. You can also see the color detected by the light sensor on the board, the orientation of the board dictated by roll, yaw, and pitch, and the pull of gravity on the board.
The Real Time Line Chart widget shows you the values of the acceleration of gravity in the x, y, and z directions over time. You can rotate the Nordic Thingy and watch these values change depending on the orientation.
The Real Time Gauges show you readings from the different sensors on the Nordic Thingy. The values will change on these gauges as new data comes in.
The Last Value Table shows the last value of key information such as IP addresses, battery, direction of the compass, and orientation of the Nordic Thingy.
Step 3: Modify Your Workflow to Send Alerts to Your Email and Phone
In this step, we’re going to modify a workflow. Workflows are python applications that run as data comes in. This particular workflow checks to see if the Nordic Thingy has moved based on the number of steps sent by its pedometer. If the board has moved, it sends an email and text message alert. It limits the number of alerts to be sent to one per day. We’re going to modify the workflow to send the alerts to your phone number and email address.
1. On the Medium One Sandbox, click on “Workflow Studio.”
2. Click on “Steps Taken Alert”.
3. You should see one green boxes and one blue box. Double click on the blue box.
4. Python code will appear. On line 4, replace the email with your email address. Make sure to keep it in the quotation marks.
5. On line 5, replace the phone number with your phone number, excluding country code. Make sure to keep it in the quotation marks.
6. Click “Save and Activate.”
Step 4: Test Your Alerts
1. Make sure your Nordic Thingy is still blinking a green light. If not, press the reset button.
2. Go back to the dashboard on the Medium One Sandbox by clicking on Dashboard icon in left menu. Find the “Real Time Gauges”. Here, you can see the different sensor data change as the events come in. Take note of “steps taken” on the far right.
3. Take note of the current value of “steps taken”. Take the Nordic Thingy with you and walk back and forth for ten seconds. Come back and see that the number of steps taken has gone up, and you have received a text message and an email!
Step 5: Now what?
Congratulations! You have connected your bluetooth Nordic Thingy device to the cloud using Ethernet over a Raspberry Pi 3. We have many more interesting projects you can try out. Go to www.medium.one and SIGN UP for a free Medium One Sandbox account:
Then checkout our tutorials and see what else you can do using the Medium One Sandbox:
Build a Home Weather Station using your Raspberry Pi. Check out this tutorial: https://blog.mediumone.com/2017/08/home-weather-station-using-raspberry-pi-and-sense-hat/
Use Alexa’s voice-controlled speaker to tell your sensor system what to do! That and much more here: https://blog.mediumone.com/category/tutorials
Learn more about the Medium One system here: http://docs.mediumone.com
Step 6: Configuring WiFi on your RPI
Your Raspberry Pi can also connect to WiFi, but you will need to configure the SSID and password. You will need a USB mouse, keyboard, as well as, a monitor with an HDMI cable.
1. Plug the monitor, keyboard, and mouse into the Raspberry Pi. Power it on after they are plugged in and the monitor is on.
2. After about 30 seconds, you will see the following display on your monitor. Click on the WiFi button in the upper right hand corner.
3. Find the WiFi network you want to connect to and click it. Type the password in the pop up box.
4. Your Raspberry Pi will now automatically connect to this network when it turns on!