Arduino arduinomega arduinoUno fishino fishinomega fishinouno gprs GSM GSM/GPRS homefeatured module newsline Open Source Projects Product launch Products Projects raspberry tech uno

UNIVERSAL GSM SHIELD – The hardware

UNIVERSAL GSM SHIELD – The hardware

 

It helps numerous low-cost GSM/GPRS modules as a way to present cellular connectivity to our Arduino tasks. First part.

 

Given the rising demand for digital gear with connection to the GSM/GPRS community, we determined to develop a brand new GSM defend for the Arduino and Raspberry Pi 3 platforms, able to supporting numerous modules on GSM breakout boards developed by open electronics, which use SimCom, Quectel and Fibocom GSM motors on the same pinout. Then you possibly can attempt to find the GSM module that most accurately fits your software, develop the firmware on the defend and then integrate the chosen module into the final circuit. The defend permits you to reap the benefits of each the features of voice call and SMS change and for the administration of GPRS knowledge connections. In the latter case, the SIM card have to be enabled for knowledge visitors.

Purposes that make use of straightforward SMS may be techniques that, given the prevalence of an occasion, must send a text, with simple associated knowledge, to a cell phone.

The info connection is beneficial in purposes the place you’ll want to ship or obtain knowledge from or to a server.

Whereas a typical software that would profit from a GPRS connection might be an electrical power monitoring system that periodically sends to a server the electrical measurements made.

 

Block diagram

Earlier than analyzing the electrical scheme, let’s dwell on its composition, described by the block diagram proposed on this web page. Let’s begin with the primary power provide, which is taken by way of a µUSB connector to which you’ll be able to join a power supply like that of cell phones, or you’ll be able to join the USB cable directly to a PC USB socket sort A, taking the facility from it. The 5 volts of the µUSB connector is taken both to the DC/DC converter, to generate the availability voltage of the GSM modules (+VBAT) and to the headers for the Arduino and Raspberry Pi boards.

Within the block diagram, the Arduino and Raspberry Pi boards are represented by two inexperienced useful blocks, from which some strains of communication, diagnostics and debugging start.

But let’s proceed so as: to start with, we will observe that from the useful block similar to Arduino there are several UART communication strains, both hardware and software program assigned; the latter are I/Os that may act as serial libraries and are helpful, for instance on Arduino Uno R3, where there is only one hardware UART. If this is for use to debug the firmware by means of the serial monitor, if you want to communicate with the GSM module it’s essential to initialize a digital serial. Is anybody questioning why we’ve set up two UARTs? The choice comes from the truth that there could be GSM modules outfitted with two UARTs: for example the SimCom SIM928A, which integrates a GPS receiver and has a serial port to receive AT commands for managing the GSM/GPRS section and the opposite for reading the NMEA GPS knowledge relating to the positioning.

As for Raspberry Pi, it only offers one hardware UART; in this case, it isn’t attainable to have two simultaneous communications.

 

 

The UART strains, in the case of Arduino boards, earlier than reaching the GSM modules cross by means of degree shifters that permit to couple knowledge strains with working voltages at +5V with knowledge strains with working voltages at +Three.3V. This is not crucial with regard to Raspberry Pi boards, as these already work at +Three.3V voltage. In addition to the extent shifters, the UART strains before reaching the GSM modules meet a collection of Three-position jumpers helpful to pick whether or not to use a communications hardware somewhat than software and determine if you wish to enable/disable the communication mild to see what instructions are exchanging the Arduino/Raspberry Pi boards with GSM engines. It’s also attainable to route the alerts in an effort to ship the AT instructions immediately from the PC, that is very useful in the course of the research part of the instructions to confirm their right operation earlier than code them in the Arduino and Raspberry Pi boards. These degree shifting and sign routing sections are represented by gray blocks (they are in all three distinct blocks, two named “Degree shifter and jumper selector” whereas the third is just a “Jumper selector“).

The GSM engines section is represented by the yellow block “GSM BreakOut Board” to which the previously mentioned communication strains arrive. In addition to the info strains, this block also consists of the +VBAT energy supply generated by the DC/DC converter and the Vrtc energy provide made out there by the zero.22F gold foil capacitor used to keep the Real Time Clock Calendar on the GSM modules powered in the event of a main power failure. The cost of the capacitor is assured by the identical electronics of the GSM modules when it fails the capacitor will maintain the RTCC lively until it’s utterly discharged.

The GSM modules are also related to 2 buttons which are used to turn on/off the GSM motor, button P1, or to reset the GSM motor, button P2. These buttons are useful when you need to function the motors manually, for instance, switching them on and then sending AT commands from a PC. The period of the on/off pulse, relatively than the period of the reset pulse, is dependent upon the motor itself. Subsequently, it is necessary to seek the advice of the datasheets for extra details, in fact, we’re speaking about pulses of very brief period. We conclude the roundup with the MIC and SPK strains, differential strains, which are used to attach respectively a microphone and a speaker, helpful throughout voice calls.

Now let’s look at the orange block “GSM/GPRS SPY” which, as mentioned before, is used to spy on serial communication between GSM engines and Arduino/Raspberry Pi boards, quite than sending AT commands instantly from a PC. The perform block could be very easy and consists of logic ports and some jumpers for signal routing in addition to a 4-pin connector, blue block adjoining, to which join the USB/UART converter FT782M, bought on the open electronics retailer.

We conclude the analysis of the block diagram by saying that the Arduino/Raspberry Pi boards are related to two P3 and P4 buttons for future developments and a collection of digital strains for debugging the firmware that you’ll write. Particularly, we now have three strains of triggers, with related LEDs, plus six diagnostic LEDs: two pink, two inexperienced and as many yellow; they’re helpful in the course of the phases of GSM engines initialization, sending and receiving SMS, voice calls, and so forth.

With this, we have now concluded the analysis of the block diagram. We will then transfer on to the detailed description of the wiring diagram.

 

Wiring diagram

Let’s begin with the facility provide part, which pulls voltage by way of the micro USB connector, from which the 5V attain the integrated U2 which is a step-down voltage regulator. Intimately, we used an LM2596, D²PACK package deal, with output voltage adjustable from a minimum of +1.23V to a maximum of +37V.

For our software, we have now set the output voltage to +Four.1V because the GSM modules anticipate a stabilized power provide between +3.2V and +4.8V. The integrated LM2596 guarantees an output current up to 3A with a standby current of 80µA, accepts input voltages of as much as +40V and the working frequency of the switching section is 150kHz. Fig. 1 exhibits the block diagram of the voltage regulator highlighting the operating logic and the varied input/output and management pins. As you possibly can see, at pin 1 the enter voltage is brought whereas from pin 2 the output switching voltage is taken, which by means of the network shaped by the Schottky diode, the inductance and the low ESR capacitor returns the regulated output voltage to the specified value. The voltage value is obtained by feedback with resistive divider to be related to pin 4 of suggestions.

 

Fig. 1

 

A digital enter, pin 5, is obtainable to show the voltage regulator on/off. The logic is lively low and in our software, we pressure it to ground or all the time on. The working precept of the voltage regulator might be summarised in the diagram in Fig. 2.

The built-in works on two distinct durations of time, the first period is given by the ON change situation and the second by the OFF change situation. In the ON change situation, the enter voltage is related directly to the inductance input and the recirculation diode is prohibited. In the course of the OFF interval, the change is open and the voltage on the inductance reverses its polarity and triggers the recirculation diode. The current flows by way of the diode maintaining the present loop with the load. The frequency at which the electronic change is switched on/off is 150kHz as indicated above.

The converter control is obtained by various the duty-cycle or by appearing on the ON and OFF occasions of the change as indicated by the following:

 

Having stated that, let’s calculate the values that the feedback resistors must take to set the output voltage to the regulator. The formulation to be adopted is the following (as regards to Fig. 1):

 

which when utilized to our circuit turns into:

 

 

The facility provide is then delivered to the GSM modules, i.e. the connectors marked as U5 and U6, and to the P1 and P2 buttons, respectively used to manually change the modules on/off and reset them (manually). The LED LD1 signifies the presence of the +VBAT energy provide. As an alternative LD2 is used to indicate the presence of the +5V power provide and eventually, LD3 signifies the presence of the +3.3V power provide returned by the Arduino boards, slightly than Raspberry Pi.

The +5V supply voltage can also be transferred by way of a voltage divider to the X1 terminal block, o that a voltage reference is on the market for external electronics for future improvement. The X2 terminal block and the P channel MOSFET This fall, used as an digital change, full the set-up.

If the MOSFET This fall is switched off, i.e. the VGS voltage doesn’t exceed the channel activation threshold, the +5V provide voltage, by way of the interior diode of the MOSFET, reaches pin 1 of the X2 terminal board. Now, if the signal “shutdw” is about excessive, it happens that Q3 is switched on by grounding the gate of This fall and, because of the voltage current on pin 1 of X2, the VGS exceeds the edge by activating the This fall channel. On this condition, when the primary power provide fails (+5V) and if there is a +5V voltage generated by an auxiliary board on the terminal block, our electronics will proceed to operate till the “shutdw” line is turned down.

Let’s now describe the interconnections current on each the Arduino and Raspberry Pi boards. Supported Arduino boards are Arduino Uno R3, Arduino Mega 2560 R3 and Fishino boards (Uno and Mega). In case you employ Fishino boards (use boards with the carried out latest firmware that frees I/O 7) you need to keep in mind that I/O 10, 11, 12 and 13 are used for WiFi and in case you employ the microSD card also I/O 4 have to be free. Since at I/O 10, 11, 12 and 13 we had deliberate to attach the P4 button and three triggers for debugging, this ought to be taken under consideration when using the Fishino Uno board. For those who use the Fishino Mega board, the I/Os to be left free are Four, 10, 50, 51 and 52 (also on this case use boards with the carried out latest firmware that frees I/O 7). If I/O 11, 12 and 13 are to be free, transfer jumper J12 to place 2-Three.

As for the Raspberry Pi boards are supported: Raspberry Pi 2 model B+, Raspberry Pi Three mannequin B and Raspberry Pi 3 mannequin B+.

 

Fig. 2

 

Let’s start with the Arduino boards, for convenience, we used as a starting reference the Arduino Mega board pin-out with the corresponding pins of the Arduino Uno board highlighted in blue. In case you use the Arduino Mega board, you’ll be able to choose whether or not to make use of the two hardware UARTs, UART1 and UART2, mapped to I/O pins 16, 17, 18 and 19 or the two software UARTs which might be mapped to I/O pins A8 (RX UART2), A9 (RX UART1), A10 (TX UART2) and A11 (TX UART1). The corresponding I/Os for the Arduino Uno board are A0, A1 A2, and A3. The software UARTs, as far as the reception sign is worried, have to be mapped on the I/O pins that help the port change interrupt. So be careful when creating any hardware on your purposes.

The TX and RX alerts of the 2 UARTs, both hardware and software, should bear a degree adjustment because the Arduino boards work with logical levels at +5V whereas the GSM modules work with the level at +3.3V. Then the TX sign, earlier than reaching the GSM engine, is tailored by way of using a MOSFET channel N properly related. The identical goes for the RX signal from the GSM module to the Arduino board. To raised understand what has been stated, let’s look at the connection of the TX and RX strains, both hardware and software program, used to send AT commands for the management of the GSM section. As may be seen from the wiring diagram on the Arduino aspect, the affected strains are identified as “ARD_RXD1_HW”, “ARD_TXD1_HW”, “ARD_RXD1_SW” and “ARD_TXD1_SW”.

These come to selection jumpers, J6 and J7, that are essential to determine whether or not to use a hardware or software program serial connection. Subsequently, if the jumpers are in position 1-2, a software UART connection is recognized, while if the jumpers are in position 2-3, a hardware UART connection is recognized.

As for the Arduino TX sign, whether or not hardware or software program, it reaches the MOSFET Q5, which adapts the voltage degree to +Three.3V comparable with the electronics of the GSM modules. In addition to the MOSFET Q5, two unassembled resistors in voltage divider configuration have been prepared to adapt the voltage degree from +5V to +3.3V (Just for the TX line). As for the RX sign, all the time on the Arduino aspect, we’ve that this is delivered to the drain of the MOSFET Q1 that so related permits you to adapt the signal from the GSM motor at +Three.3V to the voltage degree +5V of Arduino. We’ve got already used any such adaptation in many different purposes.

The identical reasoning has been applied to the TX and RX strains for the management of the AT instructions of the GPS and subsequently referenced to the J8 and J9 jumpers.

As talked about, it is attainable to spy on the AT commands which might be sent to the GSM/GPS module and the relative solutions using the electronics shaped by the built-in U1 and the jumpers J1, J2, J3, J4 and J5.

To complete the sunshine, we’ve got the standard USB/Serial converter FT782M configured to work with I/O at +3.3V logic degree and inserted in the applicable connector CN1. Because of this electronic piece and to a correct configuration of the jumpers it’s attainable to do the next:

1) spy on AT commands sent to GSM/GPS module from Arduino/Raspberry Pi board;

2) spy on the AT instructions sent to the Arduino/Raspberry Pi board;

Three) ship AT commands instantly from PC excluding Arduino/Raspberry Pi TX and RX strains.

So, if you wish to spy on AT instructions, and their answers, sent to GSM module jumpers J1, J2, J3, J4 and J5 have to be in position 1-2. If you wish to spy on the info acquired from the GPS modules, jumpers J1, J2 and J3 have to be in position 2-3 whereas jumpers J4 and J5 have to be in position 1-2. If you want to ship AT commands instantly from a PC, for instance, to review new instructions to be carried out in Arduino or Raspberry Pi sketches, you should configure the jumpers as follows: jumpers J2 and J3 in position 1-2, jumpers J4 and J5 in position 2-Three and jumpers J1 detached (configuration for sending AT commands to GSM part). Or jumper J2, J3, J4 and J5 in place 2-3 and J1 indifferent (configuration for studying GPS knowledge).

To exclude the potential of sending AT commands from the PC permanently, merely don’t mount the 2 zero ohm resistors R2 and R3. On this method, it is inconceivable to ship AT instructions from the PC to the GSM/GPS engine because the road is interrupted.

Nevertheless, we advocate that you simply all the time mount the spy section, as it’s useful through the research and learning phases of the AT commands.

Furthermore, given the potential for utilizing a PC terminal to send/receive AT commands, there’s a quick and effective technique of research that frees you from any bugs launched in the course of the writing of C code for the development or integration of an Arduino/Raspberry Pi library. In different words, first, you research the AT command you need to implement using a PC terminal and then, only after understanding the way it works, you implement it in your library.

Returning to the TX and RX communication strains, those coming from Raspberry Pi have already got levels suitable with GSM modules and subsequently do not require line adaptation. Nevertheless, it is essential to determine by way of jumpers J10 and J11 whether or not to drive the GSM section fairly than the GPS section. If J10 and J11 in place 1-2 will communicate with GSM part, vice versa if in position 2-Three will talk with GPS part.

In addition to the TX and RX strains, we now have additionally prepared the control strains which, nevertheless, are at present not utilized in our library, specifically the strains “CTS“, “DCD“, “RTS” and “DTR“.

Rather more necessary are the “ON/OFF” and “RST” strains, which are used respectively to modify the GSM/GPS module on/off or to reset it. Fig. 3 exhibits how the electronics needed to modify the GSM module on/off have to be arrange, as you possibly can see the ignition pulse have to be constructive logic and its period have to be longer than one second.

 

Fig. Three

 

Fig. Four exhibits the time diagram for switching on the GSM module and, more precisely, exhibits the development that the PWRKEY sign on the transistor collector should have. Subsequently, to ensure that the GSM ignition operation to achieve success, it’s vital that, after having given energy, you wait a minimum of 500ms before sending the ignition pulse (which should final greater than 1 second).

 

Fig. Four

 

Along with switching on the GSM using the suitable line, we’ve ready the button P1 that performs the identical activity, offering the logical degree 1 as a result of it should activate the transistor that sets the PWRKEY module to zero internally.

Fig. 5 exhibits the development that the PWRKEY signal should have when the GSM module is switched off: the logic zero pulse should have a period of multiple second but lower than 33 seconds. The time diagrams simply shown referred to a SIM800C engine. If other motors are used, reminiscent of an M95 from Quectel, the period of the on/off pulses could also be totally different. In this case, the shutdown pulse should have a period of between 700ms and a most of 1 second. Subsequently it’s all the time good apply to consult the module datasheet.

 

Fig. 5

 

In addition to the on/offline, we’ve got arrange a reset line (“RST“) which serves to reset the GSM motor. Push-button P2 performs the guide reset perform.

We conclude this evaluation with the “RI” line, referred to as “Ring Indicator“, which is delivered to the input INT0 (Arduino Uno) or INT4 if it is ArduinoMega. This line, lively at a low logic degree, indicates the reception of an SMS or a voice call. If we take as reference a SIM800C engine we now have that through the reception of an SMS the road goes low for 120ms after which returns excessive. However, in case you obtain a voice name, the road goes low and only returns excessive in case you reply or reject the voice name with the appropriate AT command.

Fig. 6 describes the sign development on the RI line (Ring Indicator) with regard to the reception of an SMS while Fig. 7 exhibits the development through the reception of a voice name.

 

Fig. 6

 

Word jumper J13, which can be utilized to drive GSM modules in addition in case the firmware needs to be updated.

 

Fig. 7

 

GSM modules often have an audio section to which you’ll be able to join a microphone and audio system to make voice calls, often use a headset with a microphone outfitted with a microphone audio jack separate from the audio system jack, or (mostly) with a single jack, which nevertheless just isn’t standardized but exists in two versions: CTIA and OMTP (Fig. 8a ).

The distinction is in the contact of the microphone, which is in several positions. Our electronics are designed to work with both OMTP and CTIA formats: by mounting resistors R54 and R55, the CTIA commonplace is selected, while by mounting resistors R52 and R53, the OMTP normal is chosen. The connector used SJ-43514, JK1, is a 3.5mm jack of the CUI-INC which has the pin-out proven in Fig. 8b, the place you notice the correspondence between the jack in OMTP/CTIA format and the contacts of the connector, as already extensively stated, the one distinction between the two codecs is that the microphone line and the GND are inverted.

 

Fig. 8a

The audio part is completed by a collection of capacitors to be related on the differential strains of the speakers and on the differential strains of the microphone. As for the speaker capacitors, there are two blocks; one to be related near the GSM and the opposite close to the connector. The SPK_P signal is carried by the C37 and C38 capacitor to the 2 audio connector speakers left and proper.

All we’ve got to do is describe the set off and debug strains, which are helpful for code improvement at each the library and sketch degree. On the Arduino board, the “Trigger1, 2 and 3” trigger strains have been prepared and carried via collection resistance to the CN3 connector to which an oscilloscope probe may be related, relying on the case. Trigger strains are based mostly on I/O pins 11, 12 and 13. Keep in mind that in the case of Fishino boards these pins are shared with the WiFi section. They complete a collection of LEDs related to I/O 32, 33, 34, 35, 36 and 37 and out there solely on Arduino Mega and Fishino Mega boards. Each the set off strains and the LED strains have been delivered to the Raspberry Pi board.

 

Fig. 8b

 

PCB Format

Let’s have a quick take a look at the board format, proposed in Fig. 9 that exhibits the sections every one distinguished by color:

  • orange part, the place you will discover the facility supply carried by the micro USB connector, the terminal block for connecting a potential battery backup system, the audio jack and two auxiliary buttons for future developments;
  • inexperienced section, the place the jumpers for the number of the varied communication modes and indicator are situated (you will see that a summary desk under);
  • grey part, where there are two connectors for housing the GSM breakout boards;
  • purple section, where there are the set off and diagnostic LEDs as well as the comb connector for the connection of a potential oscilloscope probe;
  • blue section, where the 2 buttons used to turn on/off the GSM engine and the reset button are situated.

 

Fig. 9

 

The defend is obtainable in a pre-assembled version, but for many who need to try to mount the elements on the board, we advise to start out from the integrated U11 adopted by Q1 and U2. Then you need to mount all of the resistors and SMD capacitors in 0603 instances, the 2 connectors U5 and U6 after which the remaining SMD elements starting from the LEDs. Lastly, mount the audio jack, the terminal block and all of the jumpers and buttons. Depart the interconnect connectors on the Arduino and Raspberry Pi boards for last.

Table 1 summarizes the jumpers and how they need to be set.

 

AT commands from PC by way of serial mild

Most of the AT commands out there, along with the syntax and the number of parameters related to them, have kind of articulated responses, consisting of several parameters, which need the code to be decoded and made out there to the top consumer for implementation in your software. Therefore, it is essential to be able to research the conduct of the AT commands you need to use before implementing them in your purposes or libraries. It’s also good to know that in an effort to achieve certain objectives, resembling managing GPRS connections, it is crucial to provide several AT instructions to activate the info connection. We add that along with the syntax it’s also vital to review and understand the suitable sequence of AT instructions to be despatched as a result of some commands to be acquired and accepted require the prior sending of other AT commands before them, they usually have to be sent in the proper sequence.

An instance of that is when making an attempt to hook up with an APN using the AT+CSTT command in a TCP/UDP knowledge connection. Before sending the AT command to hook up with the APN you have to first send the AT+CIPRXGET command (Get Knowledge From Network Manually) if you don’t want to see the error code “3” return, i.e. operation not allowed, by sending the AT+CIPSTART command.

A useful gizmo for this function is using software for the evaluation and simulation of serial communication protocols. Listed here are some examples by which we’ll present some spy sections of the AT commands exchanged between the Arduino boards and the GSM module and the sending of the AT commands from the PC for the configuration of the GSM module to work in GPRS mode.

Fig. 10 exhibits the serial monitor of the Arduino IDE in the course of the initialization phases of the GSM module: on this case it is a SIMCOM SIM800C.

 

Fig. 10

 

When the serial monitor is began, Arduino is reset and the procedure of initialization of the GSM modules is started, together with ignition; nevertheless, because the GSM module was already switched on, the impulse sent to the engine truly switches it off and this is deduced from the reception of the string “NORMAL POWER DOWN” (see part circled in blue). The initialization algorithm is able to perceive these conditions and routinely activates the GSM module once more, that is understood by the reception of the string “RDY” (see part circled in pink). Then follows a collection of AT commands to initialize the GSM engine together with sending the PIN code. The knowledge you see within the serial monitor of the IDE could be enabled/disabled by way of code, this info could be very useful through the debugging of the code. Nevertheless, with a view to have a real view of the knowledge exchanged between the engine and the Arduino/Raspberry Pi boards, it’s essential to make use of a serial mild in hardware assisted by particular analysis software.

Fig. 11 exhibits, circled in blue, that the GSM module has been turned off by the library after which on again (in pink). Circled in green you’ll be able to see the AT commands despatched to examine whether it is necessary to ship the PIN code to activate the SIM, what number of makes an attempt we now have out there to ship the PIN code and the successful activation of the SIM after sending the code itself.

 

Fig. 11

 

Fig. 12 as an alternative exhibits the sending of AT instructions from PC to configure the GSM module in GPRS mode, particularly during a knowledge connection to a server by way of TCP protocol; see highlighted in blue the command “AT+CGATT=1” used to hook up with the GPRS service, in inexperienced the command “AT+CSTT=”ibox.tim.it” used to hook up with your APN (GPRS Access Level Identify), in pink the “AT+CIFSR” command that returns the IP handle assigned by GPRS, in yellow the “AT+CIPSTART” command for connecting, by way of TCP or UDP protocol, to a remote server and its port. Under is a collection of instructions for sending knowledge, particularly using the PHP code on the server. The above exhibits the effectiveness in sending AT commands from a PC to review the steps to be followed to appropriately configure a knowledge connection to a distant server. After you have discovered the best AT command stream, you possibly can implement it in code in your library and its sketch.

 

Fig. 12

 

Updating GSM modules

With the direct connection to the PC, it’s attainable to update the firmware of the GSM modules; for instance, we’ll see the right way to update the firmware of the SimCom SIM800C. First, you have to download the device, which you’ll be able to obtain from the following link:

www.dropbox.com/s/kn73rhcz8v72jhb/SIM800_Series_download_Tools_Customer_v1.06.rar?dl=zero.

It isn’t needed to install the software program as a result of to use it’s enough to run, in administrator mode, the file “SIM800_Series_download_Tools_Customer.exe” which can open the work window in Fig. 13, the place we will select quite a few parameters including the Goal (in our case, SIM800C), the communication interface (PortType2, which in this case is a UART), the “Com” to which you’re related and eventually the Baudrate. The Com used within the example is COM15 and the baud price set is 115,200.

The subsequent step is to load the firmware, which within the case of SimCom is a file with the extension . cfg. The replace must be achieved with the defend solely, because it is essential that the GSM is off. Click on on “Begin Obtain” and solely then activate the GSM engine by holding down the facility button P1 for more than 4 seconds or, in the event you want, by inserting jumper J14 in position 1-2 till the update procedure starts. The firmware replace takes place in three steps.

 

Fig. 13

 

Gsm library for Arduino boards

The library architecture is predicated on a collection of C++ information and related .h information with definitions of variables, constants, knowledge structure, and so forth. The primary file, which additionally incorporates the process for switching on and initializing the GSM module, acts as the idea for the other information that make up the library (Fig. 14).

There are a number of boundary information to the primary one, including:

  • UART connection administration “cpp“.
  • I/O management “cpp“
  • administration of the interrupts utilized by the “cpp” library
  • SMS administration “cpp“
  • voice calls management ” cpp “
  • security perform administration “cpp“
  • phonebook management “cpp“
  • GPRS connection administration “cpp”
  • HTPP commands administration “cpp“.

 

The information include the code for managing a collection of AT commands both for sending commands, with the relative parameters, and for decoding the responses acquired by the GSM, including the error codes. Presently, just a few AT instructions are managed, however as the library is in continuous improvement increasingly more commands shall be added in the future. The same applies to the error codes management.

 

Fig. 14

 

Fig. 15 exhibits the state machine for sending AT commands and GSM response management: it begins with the initialization of the GSM engine and then enters a loop for sending AT instructions. For every AT command despatched, a response from the GSM engine is predicted and its content is decoded. If the reply is OK, the subsequent AT command shall be passed, in any other case the system will return the error code and, depending on the case, will attempt to ship the AT command once more up to a maximum of 3 times. If the AT command is just not profitable, even after three attempts, the system resets the GSM engine and begins once more by re-initializing the same and then returns to the AT command sending loop.

This is the broad strategy that lies on the heart of our library. AT management features instructions that are not used don’t take up Flash memory area, nevertheless for every category of AT commands there’s its own response administration section, which is managed by an appropriate state-controlled machine. On this case, if enabled with the appropriate #Outline, the response management routines are inserted in the compilation of the machine code and then take up area in Flash. It’s all about finding the suitable stability between the features you want in your purposes and the reminiscence area your library takes up.

 

Fig. 15

 

The library helps the Arduino Uno and Fishino Uno, Arduino Mega 2560 or Fishino Mega 2560 boards. Sooner or later, we don’t rule out extending compatibility to probably the most superior Arduino, i.e. those with a 32-bit microcontroller. Having stated that, we shall conclude this primary episode here.

 

Listing of elements

R1:  100 kohm 1% (0603)

R2, R3: 0 ohms (0603)

R4, R6, R10: 1.2 kohm 1% (0603)

R5:  5.6 kohm 1% (0603)

R7:  2,2 kohm 1% (0603)

R8:  200 ohms 1% (0603)

R9:  10 kohm 1% (0603)

R11, R12: 220 ohms 1% (0603)

R13:  1,2 kohm 1% (0603)

R14, R15: 220 ohms 1% (0603)

R16, R18: 5.6 kohm 1% (0603)

R17, R19: 10 kohm 1% (0603)

R20:  1.2 kohm 1% (0603)

R21, R22: 10 kohm 1% (0603)

R23:  220 ohm 1% (0603)

R24. R25: 0 ohm (0603)

R26÷R28: 220 ohm 1% (0603)

R29, R30: 10 kohm 1% (0603)

R31:  1,2 kohm 1% (0603)

R32, R33: –

R34, R35: 10 kohm 1% (0603)

R36, R37: –

R38÷R40: 1.2 kohm 1% (0603)

R39, R40: 1.2 kohm 1% (0603)

R41, R45: 10 kohm 1% (0603)

R42:  36 kohm 1% (0603)

R43:  220 ohm 1% (0603)

R44:  5,6 kohm 1% (0603)

R46, R48÷R50: 1.2 kohm 1% (0603)

R47:  22 kohm 1% (0603)

R51:  10 kohm 1% (0603)

R52, R53, R59: –

R54, R55: 0 ohms (0603)

R56÷R58: 10 kohm 1% (0603)

R60:  zero ohm (0603)

R61÷R64: 10 kohm 1% (0603)

C1: 100 nF 16 VL ceramic (0603)

C2: 10 µF 16 VL ceramic (0603)

C3: 10 nF 16 VL ceramic (0603)

C4, C5: 220 µF 16 VL tantalum (E)

C6, C7: 100 nF 16 VL ceramic (0603)

C8, C9: 10 µF 16 VL ceramic (0603)

C10, C11: 33 pF 16 VL ceramic (0603)

C12, C13, C15: 10 pF 16 VL ceramic (0603)

C14:    33 pF 16 VL ceramic (0603)

C16÷C19: 10 µF 16 VL ceramic (0603)

C20, C21: 10 pF 16 VL ceramic (0603)

C22÷C23: 33 pF 16 VL ceramic (0603)

C24:    10 pF 16 VL ceramic (0603)

C25:    33 pF 16 VL ceramic (0603)

C26, C27: 100 nF 16 VL ceramic (0603)

C28, C29: 220 µF 16 VL tantalum (E)

C30:    0,22 F 5 VL electrolytic

C31, C32: 33 pF 16 VL ceramic (0603)

C32:    33 pF 16 VL ceramic (0603)

C33, C34: 10 pF 16 VL ceramic (0603)

C35:    33 pF 16 VL ceramic (0603)

C36:    10 pF 16 VL ceramic (0603)

C37, C38: 10 µF 16 VL ceramic (0603)

LD1, LD6, LD7: Yellow LED (0603)

LD2, LD4, LD5: Purple LED (0603)

LD3, LD8, LD9: Inexperienced LED (0603)

LD10÷LD12: Pink LED (0603)

P1÷P4:    Microswitch

D1:  MMSD4148T1G

D2:  B340A-13-F

Q1, Q2:   BSS123

Q3:  BC817

This fall:  SPD50P03LG

Q5, Q6:   BSS123

U1:  SN74LVC2G00

U2:  LM2596DSADJG

U3:  Arduino Mega 2560 rev.Three

U4:  Raspberry Pi Three B+

U5:  GSM/GPS module SIM928

U6:  GSM module G510/M95/SIM900

L1:   VLS6045EX-150M

 

Miscellaneous:

–     Micro-USB B connector

–     Jack socket 3.5mm from CS

–     Three-ways Male strip (13 pcs.)

–     4-ways Male strip (2 pcs.)

–     Jumper (13 pcs.)

–     2×10 poles connector pitch 2 mm feminine (2 pcs.)

–     Strip M/F Arduino 8 methods (5 pcs.)

–     Strip M/F Arduino 10 methods

–     Strip M/F Arduino 2×18 methods

–     Strip M/F Raspberry Pi 2×20 ways

–     4-way Female strip

–     4-way clamp

–     Printed circuit S1416 (110x158mm)

 

From openstore

Common GSM Defend

GSM compact interface with M95

Miniature Module with SIM800

Small Breakout for SIM928 GSM&GPS Module

 

!perform(f,b,e,v,n,t,s)if(f.fbq)return;n=f.fbq=perform()n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments);if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!zero;n.version=’2.zero’;n.queue=[];t=b.createElement(e);t.async=!zero;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)(window,
document,’script’,’https://connect.facebook.net/en_US/fbevents.js’);

fbq(‘init’, ‘1435112296761783’);
fbq(‘monitor’, “PageView”);(perform()
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded)
var fbds = doc.createElement(‘script’);
fbds.async = true;
fbds.src = ‘//connect.fb.internet/en_US/fbds.js’;
var s = doc.getElementsByTagName(‘script’)[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;

)();
window._fbq = window._fbq || [];
window._fbq.push([‘track’, ‘6021809506052’, ‘value’:’0.00′,’currency’:’EUR’]);

window.fbAsyncInit = perform()
FB.init(“appId”:”139297462792714″,”channelUrl”:”https://www.open-electronics.org/?sfc-channel-file=1″,”status”:true,”cookie”:true,”xfbml”:true,”oauth”:true);
sfc_update_user_details();
;
(perform(d)
var js, id = ‘facebook-jssdk’; if (d.getElementById(id)) return;
js = d.createElement(‘script’); js.id = id; js.async = true;
js.src = “//connect.facebook.internet/en_US/all.js”;
d.getElementsByTagName(‘head’)[0].appendChild(js);
(document));
(perform(d, s, id)
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “//join.fb.internet/en_US/all.js#xfbml=1”;
fjs.parentNode.insertBefore(js, fjs);
(document, ‘script’, ‘facebook-jssdk’));