Intro: Remote MQTT-GSM Communication Server
Tuberculosis is a worldwide endemic disease with a high mortality rate, approximately 5 million people die each year. Despite being a disease completely curable, WHO data reveal that it is still being the third cause of mortality in the world. In the last decades, modern diagnostic methods have been developed, which diagnose the disease with a high sensitivity rate and in a few hours. However, developing countries cannot implement these new methods due to economic reasons, missing specialists and hard implementation in remote areas. For this reason, we are focusing on developing a set of embedded devices that modify and strengthen common laboratory instrumentation coupling mechanisms, circuits, microprocessors, SoCs and software with the finality of the automation of TB diagnostic.
This is one of the embedded devices we´ve developed to help our main project of building an automatic digital microscope to detect disseases.
You can find full documentation and support by following us here!
This particular device is ment to be an mqtt broker between all the devices we developed, as well as saving all relevant data in a built in database then to be syncronized by SMS through GSM Network in remote places where there is absolutely no internet accses but GSM.
Step 1: Materials
For this project you will need the following materials:
- 2 x ATX power supply
- 1 x Intel Edison
- 1 x SIM900
- 1 x Arduino Mega
- 1-3 x Wireless Chargers
Step 2: Building the Case
The first thing that we are going to do is to build the case. For this, you will have to take apart the two ATX power supplies.
Remove the top part of both power supplies. Then, use a piece of acrilyc or any other material to put together both as shown in the pictures.
Now, we are going to remote the circuit of the second power supply. Here's where the Intel Edison, the arduino mega and the SIM900 will go.
Now, we need to build walls for the sides and the top part of our device. For this, you can use acrylic or any other material that you like.
Use screws for the walls and the roof.
Take the three wireless transmitter and place them on the roof of the case. Measure the center of each transmitter and make a hole on the roof for each one, so that we can pass the cables through those holes.
We are almost done with this step. Now, we will cut the cables of the first power supply. You need to know that the color of the wires represent the following:
- Red wire: 5 volts
- Yellow wire: 12 volts
- Cyan wire: -5 volts
- Black wire: GND
We will use two 5 volt and two 12 volt wires. Cut those. Make sure to secure the rest of the cables to avoid short circuits.
Step 3: Implementing the Electronics
Soldering mini-USB cables to the Power Supply
Take 3 mini-USB cables and cut their type-A side. Then, solder the power and ground cables to one 5 volt and GND output from the power supply. As seen in the pictures, the cables are ready to be connected to the wireless transmitters.
Adding the Intel Edison
Take one 12 volts output wire and one GND wire. Solder them into a barrel jack. This will power the microprocessor. Do the same for the SIM900.
Step 4: Putting All Together
Now, we will place the Intel Edison inside the case. Power it with one of the barrel jacks. Do the same for the SIM900. Put the SIM900 in a place that the antenna gets out of the case. This can be on the sides of the case.
The arduino Mega can be placed anywhere as well. You can power it with the Intel Edison. This will make easier the serial communication between both.
For the SIM900, use two jumpers to connect the serial ports.
Step 5: The Code! - Intel Edison
For the software you must do a couple of things. Little yet simple. The use of the intel edison is highly recomended since its optimized for iot. You can also use a raspberry pi or some similar but the code has not been tested on anything else. Let us know if you decide to do it with an alternative to the intel. We'll be glad to know how it went for you.
First set the intel edison to output a wifi local network.
Now, you must download mosquitto broker from https://mosquitto.org/download/
Then run it in backround as a daemon. You can configure to start this service at the boot up. This will give you a local mqtt broker which all your devices can use if they are connected to de wifi network provided by the intel edison.
Finally download and run the code above. This will do all the job. What it does is that it sets clients on topics which all devices will be sending data. This particular topics will be stored in a MongoDB database. When sync begins, it will start to send all database data through serial to the arduino. This arduino will give the comands to the Sim900 to be transmited through SMS.
Step 6: The Code! - Arduino
you may be wondering, why use a arduino instead of directly sending commands to the Sim900. It apears to be a comunication error between the intel edison an the sim900. We hadn't been able to make it work, and seems that lots of people can't either. If you find a solution please let us know!!!
Well. The code is pretty straight forward. Download it and run int on any arduino that can be connected to the edison.
Now plug in a sim card which you know the number of and then the Sim900 to the arduino:
And start testing with your own number!!