Introduction: Spreading Information With Intel Edison
Project developed by João L. Martins, Alex Lucchesi, Laís Minchillo and Fernando Pereira in the Intel IoT Roadshow 2015 in São Paulo, Brazil!
So imagine what if we would like to exchange information about what is going on in each sightseeing of a town for all tourists passing by them? Or, just imagine if we had a Remote Monitoring Center so far way that its signal couldn't reach nobody else? And what if its information is concearning about the next Katrina?
With that goal in our heads, during the Intel IoT Roadshow, we developed a project whose intention was to spread information got by servers among themselves through clients passing by each one of the them and updating all of these servers and clients with the newest information. Furthermore, we developed some of these servers with the capability of uploading all the new data in the cloud.
Step 1: Hardware Requirement
For this project, these items are required:
- Intel Edison
- Arduino Expansion Board
- APC220 Radio Communication Module
- Kit Grove
- Jumpers
From Grove's Kit we are going to use these sensors:
- Temperature Sensor
- Button (or Touch)
- LCD BlackLight RGB
- LED
With only one Edison board it is possible to connect and sync with the internet, becoming not necessary the APC220 Radio Module. With two Edisons and sensors, it is possible the sync with internet as well as with each other via radio signal, which was the main idea of the project. With three dispositives, we can have the complete setup, a mobile client without internet, one fixed station connected with the internet and another fixed station without connection and far from the connected station. In this case, we are able to spread the data among all the dispositives.
In case of substituting the itens above, you should be concerned with the compatibility. For exemple, in one hand we can change the radio module by another module with serial interfce. In other hand, if we use another LCD, we have to find and change the library to be able to use it correctly.
Step 2: Software Requirement
For this project, these items are required:
- Development environment: Arduino IDE
- Cloud: ThingSpeak
It is necessary to install the Edison's extension in the Arduino IDE.
To do that, you should follow: Tools > Board > Boards Manager and than search for Edison and click in the result and in Install to start installing.
These links might be useful if you don't have the IDE or an account in the cloud.
Step 3: Hardware Connections
- Put the Intel Edison in the Arduino Expansion Board.
- Put the Groves's shield in the Arduino Expansion Board
- Plug the LCD in any I2C port of the Grove's shield.
- Plug the temperature sensor in the A1 port.
- Plug the button (or Touch) in the D8 port.
- Plug the LED in the D4 port.
- Be careful and plug the jumpers in the pins GND, VCC, RXD and TXD of the radio.
- Be more careful and plug the other side of the jumpers in the pins GND, VCC, TXD and RXD of the shield, respectively. Important note: the TXD of the radio have to be plugged in the RXD of the shield and vice-versa. Furthrmore, the VCC could be chosen 3.3V as well as 5V for the radio module.
- Put the antenna in the radio module.
- (Optional) Plug an extern power supply cable in the Arduino Expansion Board
- Plug an USB cable connected to the computer in the Arduino Expansion Board to upload the program.
Remark: Remember that some computers cannot supply enough current for the Board only using the USB cable, mainly if we have many sensors plugged.
Step 4: Coding
Our code is available in: https://github.com/suarigata/spread
PS:
- The main defect of the code is that we cannot have more than 10 devices, because the ID is only one character but it can easily be modified.
A second restriction is that the two devices running the server cannot be in each other signal area because it will probably have a signal conflict when the client is in this same area. One idea to avoid this is to wait an aleatory time for each server before trying to connect to the client again.
Another remark is that before trying to connect via radio, one device can "hear" the radio channel to ensure that the channel is free in order to avoid conflicts.
- Some adaptation were made for the code run in the Intel Galileo too. For that, the first line of the server code should be not commented. This adaptation was only compiled and not tested.
Image source: http://www.sourcinghacks.com/
Step 5: ThingSpeak Cloud
You have to sign up in the ThingSpeak and create a channel for each device.
For each device we need the fields for timestamp, temperature and button state. Each ThingSpeak channel has a limit of 8 fields maximum. We needed 9 fields for all devices of this project, so we created one channel per device.
We need the numbers and keys of the channels for writing and reading. Making them public we don't need the reading key, and this was the config used by us.
Now, you have to substitute the ThingSpeak's channel information in the beginning of the code, as following:
char *key[3] = {"***Writting key 1***","***Writting key 2***","***Writting key 3***"};
char *canal[3]={"channel nb 1","channel nb 2","channel nb 3"};
Doing that, you can compile and upload the code to the boards and start spreading the information!!!
------------------------------------/\-----------o/---------------------------------------
We hope you liked our project and use it someday in your life!
Best Regards,
Team Pirata!
The End.