OLIMEXINO-NANO-GSM shield prototypes works fine


OLIMEXINO-NANO is small 30×30 mm Arduino Leonardo compatible board with microSD-card, UEXT, micro USB and stack-able shields, the available shields for the moment are:

OLIMEXINO-NANO-GSM is new 4 band GSM shield + Classic Bluetooth combo board. It stacks on OLIMEXINO-NANO and add GSM/GPRS capability to it + Classic Bluetooth connectivity.

The shield will be in stock end of the month and will cost EUR 20

New Product in stock: OLIMEXINO-NANO wearable Arduino Leonardo clone


In October I blogged for our new Arduino clone: The NANO with size only 30x30x8 mm.

Well we have them all three in stock now!

OLIMEXINO-NANO is the core module with USB micro connector, the stackable connectors for shields and UEXT to connect our many UEXT modules like BMP085, MPU6050, HMC5883L, Zigbee, temperature, magnetometers etc. etc.

OLIMEXINO-BB is stackable shield which allow you to connect NANO to Breadboard-1

OLIMEXINO-BAT is shield which contain Lithium 3V battery, connector for LiPo battery and on board charger.

The power supply for NANO is made very intelligently and as soon you connect LiPo it will take power from there, if the USB is connected the batteries are disconnected and start charging them.

We have two more modules which will be ready in few weeks:

  • EUR 10 Bluetooth 4.0 BLE shield which will allow the wearable NANO to be connected to iPhones without licensee issues or to Android phones with Bluetooth 4.0 and will allow interactions with phones and tablets with different sensors connected to NANO
  • EUR 22 GSM/GPRS 4 band shield with external antenna which will add connectivity via GSM

The NANO shield concept is that the connectors are SMT type and stackable, on bottom there is male connector, on top is female connector so you can stack as many shield as you want together.

Friday Free Board Quiz Issue #21 prize is PIC-GSM


Christmas is approaching and our prizes become bigger and bigger :)

With PIC-GSM you can control 2 relays via cellular GSM phone or over Ethernet, you have optoisolated inputs, microphone, tos of GPIOs and backup battery.

So implementing on your GSM house monitoring or controlling your home heating system or solar panel via GSM or Ethernet is possible to be implemented with this board.

Today at 17.00 o’clock our local Bulgarian time (GMT+2) we will post on Twitter our question.

You have one hour to reply to our tweet with the correct answer.

At 18.00 o’clock we will count the correct answers and ask random.org to generate random number in range then anнounce the winner and ship the board by airmail next Monday.

Good luck!

STELLARIS-UEXT adapter for Stellaris launch pad in stock


STELLARIS-UEXT is Texas Instruments Stellaris Launchpad to UEXT adapter.

We have prepared demo code for MOD-GSM, MOD-MP3, MOD-GPS, MOD-TC, MOD-SMB380, MOD-IRDA, MOD-LCD3310 so you can interface these modules from your Stellaris Launchpad.

As Stellaris MCU have two SPI, I2C and UARTs we made the adapter with two separate UEXT connectors so you can connect two independant UEXT modules to it. Each UEXT have power up/down control with MOSFET so you can power up and down UEXT modules connected.

Using MOD-GSM with iMX233-OLinuXino


MOD-GSM is 4 band cellular phone GSM/GPRS module which allow any board with UEXT connector to place and take GSM calls and to send and receive SMS-s and to connect to internet through GPRS and send and receive TCP-IP data.

Onw of our developers, Stefan made small demo example for how to use MOD-GSM with iMX233-OLinuXino, the project is at GitHub https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/iMX233/MOD-GSM

you can compile it with:

$ cc MOD-GSM.c -o mod-gsm

them make it executable with

$ chmod +x mod-gsm

and use it with

$ ./mod-gsm -help

what MOD-GSM code does? Each time somebody call the SIM card phone number it will log it in CALL-LOG file, if SMS is received it’s logged in SMS-LOG


$ ./mod-gsm -pb ADD OLIMEX +35932626259

you create new entry in the PHONE-BOOK

then if you got call from +35932626259 it will log it as call from OLIMEX

you can send SMS with this command

$ ./mod-gsm -sms OLIMEX

then the program will wait for the SMS text terminated with <enter> and send it

you can also run mod-gsm with & to run in background and log your calls and SMS-s

Important note: SIM card which you insert in MOD-GSM should have no PIN code, also UEXT cable should be at least 20 cm as when MOD-GSM is near OLinuXino during the call time it emits so much energy that from time to time cause re-boot, to prevent this as you can see on the picture above I add some aluminum shield between the MOD-GSM and OLinuXino.

Also it’s good to cut the ribbon cable and left only wires# 1-4 which carry VCC, GND, UART.TX and UART.RX as MOD-GSM depend on how configured my drive up/down the other UEXT ports also and to mess with other modules on the UEXT bus.



PIC32-PINGUINO is Arduino like board which works with Pinguino IDE.

Several new demo examples are uploaded on our web https://www.olimex.com/dev/pic32-pinguino-otg.html

1. MOD-GPS demo example with our GPS module

2. MOD-CC2450 demo example with our low energy Bluetooth module (still not released on our web :) )

3. SHIELD-EKG-EMG demo example how to interface this shield to Pinguino and measure pulse and muscle activity

4. MOD-MP3-X demo example how to play MP3 files with Pinguino

5. Sending and receiving calls and SMS with MOD-GSM and Pinguino

6. Connecting to Bluetooth enabled devices with MOD-BT and Pinguino

7. Interfacing MOD-ZIGBEE-PIR with Pinguino

8. MOD-RTC real time clock interfacing with Pinguino

9. Reading 13.56Mhz RFID tags with Pinguino and MOD-RFID1365-BOX

all examples have readme.txt inside which explains the functionality



New demo example is uploaded on PIC32-PINGUINO-MX220 web page which demonstrate how to add GSM remote control to Pinguino and place and receive GSM calls.

PIC32-PINGUINO-MX220 have UEXT connector which allow MOD-GSM to be connected and easy to add cellular remote control.

The demo code contain PDE sketch which take calls and if the call is from GSM phone which is known toggle the on board LEDs (or if you attach relay can open your garage door for instance). If the on board button is pressed Pinguino will call stored phone number (i.e. panic button, or alarm event).

The demo code is at http://www.olimex.com/dev/DUINO/PIC32-PINGUINO-MX220/PIC32MX220_MODGSM_call_example.zip

DuinoMite Project: Implementing GSM remote control in BASIC with few lines of code


Today I will show you how easy is to use MOD-GSM module to place phone calls, to take calls from other phones, to send and receive SMS and how to add cellular remote control to any of your embedded projects.

MOD-GSM is quad band 850/900/1800/1900 MHz GSM module and cover all GSM frequencies used in the world. It’s based on SIM340DZ module and have build in antenna on board so you do not need to connect external antenna.

All you need is SIM card for your GSM operator, note the card should be with UNLOCKED PIN, you place it in the SIM connector, apply 12VDC and press the wake up button. If everything is OK the red LED will start blinking once per 2-3 seconds which means that the module is registered to the GSM network and ready for use.

MOD-GSM is controlled with UART commands at 9600,8,1,N settings and you can connect MOD-GSM directly to DuinoMite on the UEXT connector.

The control of MOD-GSM is made with AT commands, the full list of the AT commands is in the SIM340 user manual located here.

To play with the different commands and evaluate their action I wrote small DM-BASIC code:

10 MSG$=”” ‘MOD-GSM returned message
20 CMD$ = “” ‘MOD-GSM command
30 OPEN “COM3:9600″ AS #1 ‘Open UEXT UART to talk to MOD-GSM
40 PRINT “CMD:”; ‘wait for command
50 C$ = INKEY$ ‘get character
60 IF C$ = “” THEN 100 ‘if no character is entered check if MOD-GSM didnt sent message
70 IF C$=CHR$(13) THEN PRINT #1,CMD$ : CMD$=””: PAUSE 250: ? : GOTO 40 ‘ send command
80 CMD$ = CMD$ + C$: PRINT C$; ‘otherwise add the character to the command
90 GOTO 50
100 IF EOF(1) THEN 50 ‘check if something is in the UART receive buffer
110 M$ = INPUT$(1,#1); ‘read character from the receive buffer
120 IF M$ = CHR$(13) THEN 150 ‘if this is CR print the message
130 IF M$ <> CHR$(10) THEN MSG$ = MSG$+M$ ‘else add the character to the message
140 GOTO 50 ‘go back check for keys on the keyboard
150 ? “(“;LEN(MSG$);”)”;MSG$: MSG$=”” ‘here you can print or process MOD-GSM message
160 GOTO 40

When you run this small program it waits you to enter commands and send to MOD-GSM when you press ENTER, meantime listening if MOD-GSM send back messages to us and display them. This is good when you want to check how MOD-GSM respond to different commands.

What I noticed is that SIM340D do not respond to low case commands like “at” at start, once you write “AT” then it accept also lower case commands, but good idea is to not use lower case to prevent bugs ;)


interesting commands which I saw in the PDF:

ATD<number>; – call phone <number>
ATA – answers incoming RING
ATH – hang up the line

AT+GSN returns the modem IMEI when I execure it I got back “353358014969443″ message which is my MOD-GSM IMEI number

AT+ATI returns the SIM340 info, what I got when executed is:


notice it says the modem is SIM300D although the hardware is SIM340D I guess these two modules share same firmware and this is why the response is as SIM300, the only difference between SIM300 and SIM340 is that later have 4 bands but SIM300 only 3 bands coverage

AT+CSQ returns the quality of the GSM signal – when I execute it I got response:

+CSQ: 25,0

I decided to hack a little bit to see what these numbers means. I covered the module with two metal pans:


the CSQ value decreased to +CSQ: 12,0 :-)

when I removed the top cover it recovered to +CSQ: 21,0


so generally you can use this to test your signal quality and the higher this value is the better is the signal reception, the values according to SIM340 PDF are in range 0-31

AT+COPS? return the name of the operator to whom SIM card you put belongs
+COPS: 0,0,”GLOBUL” operator name

i.e. the SIM card I put belongs to GLOBUL GSM operator

AT+CSPN? show your SIM card operator to which network you are connected, when I executed this is what I got

i.e. the MOD-GSM works in BG GLOBUL GSM network

SIM340 have internal temperature sensor which you can use to measure the temperature

AT+CMTE? will return the ambient temperature of the module:
+CMTE: 1,25

which means my room remperature is 25 C


to place phone call with DuinoMite and MOD-GSM is quite simple here is the code to do this:

10 OPEN “COM3:9600″ AS #1
20 PRINT #1, “ATD+35932626259;”

if you run this code you will ring to Olimex phone number with your MOD-GSM (please do not test your MOD-GSM with our phone number :) )

quite simple huh?

you can use this phone call as ALERT for instance if you detect something and want to warn the phone owner – just place call with this two line code

now how we can “receive” calls?

10 OPEN “COM3:9600″ AS #1
20 MSG$=””
30 IF EOF(1) THEN 20 ‘wait MOD-GSM to tell us something
40 M$ = INKEY$(1,1) ‘read one character
50 IF M$ = CHR$(13) THEN 100 ‘process incoming message
60 IF M$<> CHR$(10) MSG$ = MSG$ + M$
70 GOTO 30 ‘wait for new message
110 GOTO 20

so with 2 lines of code we can place phone call and with 8 lines of code we can detect incoming call.

Now tell me how many lines of code you would use to do same in C :-)

Perhaphs many of you know these GSM garage door openers, what they do is to open your door when you call them. The trick is that they detect the incoming call, and if the call comes from known number the GSM module Hang-up the call so the calling phone is no charged, then open the door.

Let see how we can implement this!

There is two ways MOD-GSM to respond to incoming call: one is by simply returning “RING” the other is to respond with “RING” and caller number. The default state is simple RING so you have to turn on Caller Identification with “AT+CLIP=1” command, let’s modify above code so it detects incoming RINGs and check if they are from “secure” number and only if such number is detected to do the action.

5 PHONE$ = “+359897286123″ ‘this is the phone number which trigger our module with incoming call
10 OPEN “COM3:9600″ AS #1
20 MSG$=””
30 IF EOF(1) THEN 20 ‘wait MOD-GSM to tell us something
40 M$ = INKEY$(1,1) ‘read one character
50 IF M$ = CHR$(13) THEN 100 ‘process incoming message
60 IF M$<> CHR$(10) THEN MSG$ = MSG$ + M$
70 GOTO 30 ‘wait for new message
100 IF INSTR(MSG$,PHONE$) <> 0 THEN PRINT “SECURE INCOMING RING DETECTED!”: PRINT #1,”ATH” ‘if the call is from secure number, print message and hang-out the line so no charge
110 GOTO 20

So with 10 lines we implemented these expensive garage door openers? Not bad!

Sending and receiving SMS with DuinoMite and MOD-GSM

Now let’s see the commands for SMS. The SMS is very convenient way to send status info, small amount of data, like “DOOR IS OPEN”, “PIR SENSOR IS ACTIVATED” etc.

Also by receiving SMS commands like “TURN HEATER ON” or “CUT ELECTRICITY” you can easily add remote control to any of your embedded devices.

There are few commands to operate with SMS:

AT+CMGF – this set the SMS mode we will use TEXT mode so the command should be “AT+CMGF=1″ when you start using SMS

AT+CMGDA=”DEL ALL” this command deletes all SMS messages, it’s good to execute it after you receive SMS to not full the MOD-GSM SMS memory with many SMS messages

Sending SMS:

send sms command is with this format:


so let’s send SMS, the code is:

10 OPEN “COM3:9600″ AS #1
20 PRINT #1,”AT+CMGF=1″: PAUSE 250 ‘select SMS message format as TEXT mode
30 PRINT #1,”AT+CMGS=”+CHR$(34)+”+359897123342″+CHR$(34)+CHR$(13)+”HELLO WORLD”+CHR$(26) ‘send SMS to phone +359897123342 with message HELLO WORLD

only 3 lines of code are necessary! and you can put in the send string your temperature, parameters you want to monitor etc etc etc.

you can combine this code with code above and to send back SMS with status only when the SECURE phone number call you first.

Receiving SMS:

OK I send now SMS with content “Led=on” to MOD-GSM

when MOD-GSM receive SMS it notify me with message:

+CMTI: “SM”,1

so I have to monitor in my code for this in the received messages, then I can read the message with the command:


the result is:

+CMGR: “REC UNREAD”,”+359897123342″,,”12/02/01,20:01:51+08″

With this information I can execute SMS commands only when they come from my known SECURE number.

Here is the code to receive commands by SMS and execute them:

5 PHONE$ = “+359897286123″ ‘this is the phone number which SMS we will process
6 CMD$ = “LED=ON” ‘ this is the command which to trigger my action
7 ACTION = 0 ‘ listen
10 OPEN “COM3:9600″ AS #1
15 PRINT #1,”AT+CMGF=1″ : PAUSE 250 ‘ set TEXT SMS mode
20 MSG$=””
30 IF EOF(1) THEN 20 ‘wait MOD-GSM to tell us something
40 M$ = INKEY$(1,1) ‘read one character
50 IF M$ = CHR$(13) THEN 100 ‘process incoming message
60 IF M$<> CHR$(10) THEN MSG$ = MSG$ + M$
70 GOTO 30 ‘wait for new message
100 IF INSTR(MSG$,”+CMTI:”) <> 0 THEN 200 ‘ new SMS arrived
105 IF INSTR(MSG$,PHONE$) <> 0 THEN 230 ‘ the SMS is from secure number
106 IF INSTR(MSG$,CMD$) <> 0 THEN 250 ‘ we recognized command
110 GOTO 20
200 ACTION=1 ‘ SMS is ready to be read
210 PRINT #1, “AT+CMGR=1″ : PAUSE 200 ‘ read the SMS in memory
220 GOTO 20
230 ACTION=2 ‘ SMS comes from secure phone
240 GOTO 20
260 ACTION = 0: PRINT #1, “AT+CMGD=1″ ‘delete the SMS
270 GOTO 20

so this 23 lines code receives and executes commands from secured phone number.

With this code above I hope you understood how easy is to control embedded devices vis GSM cellular network and DuinoMite. It took me two hours to write the code and this article, you can try to do same in other language and tell me the result :-)


Get every new post delivered to your Inbox.

Join 456 other followers