You are on page 1of 22

AVR-GSM development board Users Manual

All boards produced by Olimex are ROHS compliant Rev. C, October 2011

Copyright(c) 2011, OLIMEX Ltd, All rights reserved

Page 1

AVR-GSM is excellent board for adding remote monitoring and control in remote places by GSM cellular network. Do you want to switch on/off your local heating in your mountain house? To monitor the temperature at up to 8 remote points up to 30 meters away from the module? To listen what happens in your house with silent call after you get message for alarm status? Then AVR-GSM is the board for you! It contains ATmega32 microcontroller and 3-band GSM GPRS module 900/1800/1900Mhz inside which covers most used GSM networks around the world. The GSM antenna is build in the board so no need for external expensive GSM antennas. AVR-GSM have two relays 240VAC/10A, two opto-isolated inputs which could be connected to alarm sensors or just buttons for user actions (like call pre-loaded phone numbers), on-board temperature sensor and connector for additional up to 8 addressable remote temperature sensors at up to 30 meter distance from the module. Normal phone hook can be connected to this board and to allow user to speak, listen, taking and placing phone calls as normal stand alone cellular phone. AVR-GSM can be connected to PC with the USB connector it have and it is recognized as modem which could be used to add internet via GPRS to your computer (imagine how useful is this for your mountain house if there is no internet but only cellular network!).

• • • • • • • • • • • • • • • • •

MCU: ATMega32 32KB Flash memory, 2KB RAM, 1KB EEPROM JTAG connector for programming and debugging with AVR-JTAG-L or AVR-JTAG-USB GSM GPRS 3-BAND MODULE 900/1800/1900Mhz with build onboard GSM cellular antenna Li-ion backup battery for up to 200 hours of GSM module stand-by (no relays etc - peripherals active) SIM-card holder Two RELAYS 240VAC/10A Two opt isolated inputs USB interface 2.5mm Hands-free connector; Buzzer (ringer) Status LED On-board temperature digital sensor Connector for remote temperature sensors up to 30meters far away from AVR-GSM Plastic housing (optional) Extension 26 pin connector for all unused ATMega32 ports PCB: FR-4, 1.5 mm (0,062"), solder mask, silkscreen component print Dimensions: 130x82x34 mm (5.1x3.2x1.3")

The AVR-GSM board is shipped in protective anti-static packaging. The board must not be subject to high electrostatic potentials. General practice for working with static sensitive devices should be applied when working with this board.

Page 2

Important: If your board does not work. 10-bit ADC with Programmable Gain at 1x. 1149. and Capture Mode – Real Time Counter with Separate Oscillator – Four PWM Channels – 8-channel. Low-power AVR® 8-bit Microcontroller Advanced RISC Architecture – 131 Powerful Instructions – Most Single-clock Cycle Execution – 32 x 8 General Purpose Working Registers – Fully Static Operation – Up to 16 MIPS Throughput at 16 MHz – On-chip 2-cycle Multiplier Nonvolatile Program and Data Memories – 32K Bytes of In-System Self-Programmable Flash Endurance: 10.BOARD USE REQUIREMENTS: Cables: Hardware: Software: 1. Compare Mode. AVR-USB-JTAG Or any compatible tool for programming and/or debugging AVRStudio + WinAVR for developing your own applications The demo software show basic functionality and how to place / take phone calls (C source and HEX) or how to remote control via SMS (C source and HEX) The sources are compiled with WinAVR free C compiler. or 200x – Byte-oriented Two-wire Serial Interface – Programmable Serial USART – Master/Slave SPI Serial Interface – Programmable Watchdog Timer with Separate On-chip Oscillator – Power-on Reset and Programmable Brown-out Detection Page 3 .000 Write/Erase Cycles – 1024 Bytes EEPROM Endurance: 100.1 Compliant) Interface Peripheral Features – Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes – One 16-bit Timer/Counter with Separate Prescaler. PROCESSOR FEATURES: • • • • • High-performance. 10x.8 meter USB A-B cable to connect to USB host on PC. first try to charge the battery as you power supply the board for few hours.000 Write/Erase Cycles – 2K Byte Internal SRAM – Programming Lock for Software Security JTAG (IEEE std. AVR-JTAG.

Page 4 .


MEMORY MAP: Page 6 .

Page 7 .

7 K H11A817 SMD http ://www.RTS.MAIN_TX R16 2K RAS1 215 1 N4148 8 7 6 5 4 3 2 1 AVR-GSM Rev.MAIN_RX.MAIN_RX.DBG _RX.3V 1 0uF/6.CTS.DTR.2uF 10uF/6.7K H11A817SMD D1 ATMEGA32_4 4TQFP TXD.7n C51 C52 m/dev 1K R18 22K .3 7MHz 8 XTAL1 7 RTS CTS DTR DCD B1 2 +12V AREF 29 AREF C11 22pF (ADC7)PA7 (ADC6)PA6 (ADC5)PA5 (ADC4)PA4 (ADC3)PA3 (ADC2)PA2 (ADC1)PA1 (ADC0)PA0 30 31 32 33 34 35 36 37 EXT-1 0 EXT-1 2 EXT-1 4 100 n R45 2K/1% SCL.99K/1 % GND 4 VR(3V) TPS770 30 5 3 3V_E 0 R3 0 R31 (NA) SIMDATA 22 22 22 SIMCLK SIMRST VSIM C62 EXT-1 330p (N A) C61 2.R TS.7 K 68 K C60 SIM SIM-HO LDER 1n(NA) VBAT 3V 5V_CHG_E R48 R47 0 NETL IG HT NA NA U5 FT23 2RLSSO P2 8 R42 C76 33p HANDSFREE 1 P+ 5 40 14 13 46 16 10 1 9 VSIM 6 SIMDATA 7 SIMCLK 8 SIMRST 47 3V 4V NA R39 0 EXT-13 R38 NA EXT-11 2 USB USB_SHIELD R5 R13 R27 R28 R29 68 C77 33p R30 R15 560 56 0 DCD RI FB1 USB_PW R 4 20 VCCIO VCC S H IE LD USB 2 1 2 3 4 R35 R36 0 0 USBDM USBDP 16 15 USBDM USBDP 560 560 560 560 560 RXD TXD RTS CTS D TR C15 C26 10uF/6.3V EXT-24 3 V EXT-2 EXT-4 EXT-6 EXT-1 6 EXT-1 8 EXT-2 0 EXT-2 2 D12 R1 0 2K RAS12 15 1N4 148 (SCK)PB7 (MISO)PB6 (MOSI)PB5 (SS)PB4 (AIN1)PB3 (AIN0)PB2 (T1)PB1 (T0)PB0 3 2 1 44 43 42 41 40 PC[0.3V/8x12/low_ESR SIM300D_HD_V2 VBAT R74 560 STAT red NETLIGHT R7 9 2K D5 BUZ Q4 BC817 VBAT 3V D4 1 N4148 BUZ PB1221 R8 2 1N414 8 2K R75 33K Q5 BC817 1 Page 8 TXD.DBG_RX.SIMCLK.olimex.SIMDATA.3V/8x12/low_ESR R9 (NA) C 46 C 28 1N40 04(SMD) EN/SYNC GND FB + + 12 V R71 150 K D3 1N582 2(SMC) 10uF/10 V/120 6 BD97 78HFP C5 0 4 .DCD. O LIMEX Ltd OPT1 R24 330 D2 1N4148 LED2 red 1 2 4 3 IN1 REL2 T4 BC817 R 17 RELAY2 R32 4.RI.2uF/0805 C53 C29 1000 uF/16VDC C1 1000 uF/16VDC 1 00n R73 R72 4.5/SMD PWRKEY 10uF/10V/1206 C38 SPEAKER H EAD2 R43 C6 10uF/12 06 C74 33p close to connecor close to module GND2 TEST GND3 GND1 AGND R6 3 3K 10 C73 33p 33p 33p 10p 100 n 10p C71 C78 C18 C16 C10 EAR+ RERAUDIOOUT+ AUDIOOUTAGND 10 0n 2 1 GND1 GND2 GND3 GND4 GND5 GND6 GND7 GND8 GND9 22 17 30 31 32 34 35 36 37 48 7 25 18 26 21 23 24 26 25 1000u F/6 .RXD.DCD.SIMRST 2.MAIN_TX +1 2V EXT-2 6 U6 RST 4 RESET XTAL2 PWRKEY 3V 3V 2 VCC GND RESET 1 R2 22K B1 LED 10K R14 U1 STM10 01R R44 20K/1 % R33 330 R81 33K EXT-8 C22 3 C 19 NA 3VA R3 4 L2 330 27 AVCC AGND IN1 STATUS USB_RST C3 22p F Q3 7.CTS.DBG _RX.DTR..3V C37 C7 10n GND A1 GSM_ PCB_ANT 33 ANTENNA C36 NA NA R4 4.3V/8x12/low_ESR 1000u F/6 .7K 8 USB_RST 19 TXD RXD RTS# CTS# DTR# DSR# DCD# RI# 3 4 43 44 45 11 42 2 1 1 5 3 11 2 9 10 6 FT232RL 220uF/10V/tant C57 R46 22K USB_PRESENT - + 10 0n MIC + R37 NA 3 24 27 28 EXT-1 5 EXT-17 EXT-19 EXT-21 EXT-23 EXT-25 MAIN_RX MAIN_TX DTR R TS CTS RI D CD DBG _TX D BG _RX BACKUP VCHG RXD TXD TEMP_BAT DTR AUXADC RTS CTS NETLIGHT RI POWERKEY DCD DEBUG_TX VBAT1 DEBUG_RX VBAT2 2 NC1 #RESET NC2 OSCI OSCO DOWNLOAD C58 C20 33p close to microphone C9 33p 33p 18 19 20 21 MIC2P MIC2N MIC1N MIC1P C23 + + + C5 47u F/6 .3V C8 C27 10 0n 17 3V3OUT CBUS0 CBUS1 CBUS2 CBUS3 CBUS4 23 22 13 14 12 MIC JACK-3PIN PHON E_JACK_ UNI P - R40 1K 1 PWRKEY 6x3.2 uF(NA) C63 220n (N A) R2 2 R 21 R2 0 C2 2 D CD C_ E 1N5819 S(NA) 1N5819 S USB_PWR C ON2PH 1 6 VIN RT INV SW 5 2 VR L1 15uH/DBS135 3 4.99K/1 % R2 3 3 2 1 1 0K SIMCLK SIMIO SIMRST SIMNC VCC GND 6 5 4 SCHEMATIC: 1 2 7 4 + + + D15 C17 2.MAIN_TX +5V STATUS VSIM GPO1 SIMDATA SPI_DATA SIMCLK SPI_CLK SIMRESET SPI_CS SIM_PRESENCE SPI_D/C KBROW0 15 28 1 2 27 29 41 12 38 39 15K/1% C24 1 0n C 47 220uF/10 V/ta nt 1000u F/6 .RXD.DCD.SDA 3V 3V 3V 3V 3V 3V LED C25 3V FB(080 5) + + 100n C3 4 28 red LED_R1 REL1 C2 1 1 0uF/6.DBG_ TX.DTR . B COPYRIG HT(C) 2 009.3V R1 0 U3 STATUS TXD.RXD.RTS.RI.VBAT BAT_ E 9 0-DEG REE 2 1 LI_BAT + P- 3V VBAT 4 V_E 2 2 1 +5V +5V 1 D13 1 N5819S D14 D1 1 1 IN OUT /EN NC/FB + +12V R70 1 2 NA R69 4.RI.MAIN_RX.7] REL1 3V DBG_TX 17 VCC1 VCC2 5 VCC JTAG PC2 PC4 PC3 PC5 R11 1 R4 1 10 1N4148 1N4148 CON6PH TXD 2 38 T3 BC81 7 RELAY1 R12 2K R8 1K R7 1K 1K RST SCL LED RI U2 +5V EXT-9 D9 D7 R 19 22K 3 MTX/DTX MAIN_TX DBG_R X C12 18 GND1 GND2 39 (TOSC2)PC7 (TOSC1)PC6 PC5(TDI) PC4(TDO) PC3(TMS) PC2(TCK) PC1(SDA) PC0(SCL) 26 25 24 23 22 21 20 19 RELAY1 RELAY2 PC5 PC4 PC3 PC2 SDA 1 3 5 7 9 2 4 6 8 10 SDA SCL Z2 O PT_ TEMP USB_PRESENT BUZ B1 IN2 RXD TXD SDA SCL 1 2 3 4 8 VBAT 7 6 5 EXT-7 C4 3V EXT-5 1 2 3 4 5 6 1N4148 1N4148 D10 D8 C14 100 n 100 n C13 6 GND SDA VDD SCL ALERT A0 A1 GND A2 TCN75A(NA) BZV55C5V1(mini-melf) 3V R25 3 30 D6 1 N4148 CON8PH LED3 OPT2 red 1 2 4 3 IN2 1 00n EXT-3 1 REL RXD 2 +12V 100 n 3 MRX/DRX LED_ R2 MAIN_RX REL2 (OC2)PD7 (ICP)PD6 (OC1A)PD5 (OC1B)PD4 (INT1)PD3 (INT0)PD2 (TXD)PD1 (RXD)PD0 16 15 14 13 12 11 10 9 R26 4 .

moved 2. In this case: − jumper BAT_E must be closed − jumper 4V_E must be open − jumper 4V must be open Page 9 . The module is powered with battery and allows battery charging. Power from +12VDC with backup battery. Power consumption in this mode is: − about 60mA when have a conversation. The module is powered only from external 12V and the battery is not connected. Important: 4V_E.BOARD LAYOUT: POWER SUPPLY CIRCUIT: The power supply of AVR-GSM could be done in two different ways: 1. − About 25mA in normal mode (without conversation) + 60mA if relays are turned on. 4V and 5V_CHG_E jumpers have to be together. In this case: − jumper BAT_E must be open − jumper 4V_E must be closed − jumper 4V must be closed − jumper 5V_CHG_E must be open. Power from +12VDC without using the internal backup battery.

− − Power consumption in this mode: depend on the battery charge may vary between 10 and 300mA.37MHz is connected to ATMega32. CLOCK CIRCUIT: Quartz crystal 7.63V. and about 200mA during active call. jumper 5V_CHG_E must be closed RESET CIRCUIT: AVR-GSM reset circuit is made with STM1001R with typical threshold +2. Page 10 . CONNECTOR DESCRIPTIONS: JTAG: Pin # 1 2 3 4 5 6 7 8 9 10 Signal Name PC2(TCK) GND PC4(TDO) 3V PC3(TMS) RST 3V NC PC5(TDI) GND This connector allows programming and debugging via AVR-JTAG or compatible tool. If the 12V power supply is missing the battery discharge current is between 5 and 25 mA without call.

the microcontroller decides whether the communication is between PC terminal and GSM module or between ATMega32 and GSM module. the communication is between ATMega32 and GSM ATMega32 can control FTDI chip as detect USB present and can toggle RST line of FTDI chip. to operate AVR-GSM should have inserted valid SIM card for your operator network.e. SIM-CARD: Pin # 1 2 3 4 5 6 Signal Name VSIM SIMRST SIMCLK GND NC SIMDATA This is standard SIM card connector. Page 11 . On board there is FT232RL USB to UART converter. when USB cable is removed from AVR-GSM. Note that the SIM card should be without PIN security. To use it you should download and install the drivers for your OS from http://www.USB: Pin # 1 2 3 4 Signal Name VCC USBDM USBDP GND This is standard USB Type B connector for connection to PC. When USB cable from PC is connected to AVR-GSM – ATMega32 allows communication between USB (PC terminal) and GSM module.

PWR-CON : Pin # 1 2 Signal Name +12V GND This connector is used to power the AVR-GSM. OUTPUT RELAYS CONNECTOR: Pin # 1 2 3 4 5 6 Signal Name NO-REL1 COMMON-REL1 NC-REL1 NO-REL2 COMMON-REL2 NC-REL2 NO – relay normally opened contact.10A/250VAC .15A/125VAC .15A/24VDC Page 12 . NC – relay normally closed contact COMMON – relay common contact By this connector the user can switch on/off load witch not exceed next maximal admissible ranges: . External (12VDC) power source have to be applied to this pins.

There is possibility up to 8 external temperature sensors on this bus. I2C signals (SCL.5 mm connector. Standard headphone/microphone combined cable can be used hands-free Page 13 . Olimex sell these modules separately under the order code MOD-TMP and communication with up to 30 meters between the AVR-GSM and MOD-TEM is possible error free. HANDSFREE: Pin # GND AU+ MIC Signal Name GND AU+ audio out MIC2P audio in This is Audio 2.INPUT OPTOCOUPLER & TEMP CONNECTOR: Pin # 1 2 3 4 5 6 7 8 Signal Name DIGITAL IN1 + DIGITAL IN1 DIGITAL IN2 + DIGITAL IN2 GND SCL SDA 3V Two digital optoisolated inputs are available for user code. The input level are between 5 and 12V DC. SDA) are used for external temperature sensor connection or other suitable I2C device interfacing.

SPEAKER: Pin # 1 2 Signal Name EAR– EAR+ This is connector for external 32 ohm speaker EXT: Pin # 1 3 5 7 9 11 13 15 17 19 21 23 25 Signal Name BACKUP GND 3V VBAT +5V POWERKEY-pin12 of GSM module AUXADC GPO1 SPI_DATA SPI_CLK SPI_CS SPI_D/C KBROW0 2 4 6 8 10 12 14 16 18 20 22 24 26 Pin # AREF 3VA AGND Signal Name (ADC3)/PA3 PWRKEY .SPEAKER CONNECTOR .(ADC2)/PA2 (ADC1)/PA1 (ADC0)/PA0 (SCK)PB7 (MISO)PB6 (MOSI)PB5 (SS)PB4 (T1)PB1 RST Page 14 .

All of the GPOs are initialy in low state without any setting from AT command.SPI_CLK. This pin value can be read with AT command. ADC0/PA0: ADC0 input/digital IO of ATMega32. (SCK)PB7. VBAT: Dedicated to connect main Li-ion battery. SPI_DATA. Can be used for external analog circuits. Li-ion battery with 650mA capacity is used in AVR-GSM. The input voltage value should be in range 0V to 2. +5V: +5VDC output / up to 2A current source POWERKEY: This is GSM module power on/off key. GPO1: This is GPO of GSM module and can be configured by AT command for outputting high or low level voltage. AUXADC: This is general purpose analog to digital converter build-in the GSM module. Vnom = 1. 3VA: Analog power supply of ATMega32 microcontroller.5V.4V. GND: Digital ground.EXT is connector for external plug-in modules. It's standard 26 pin ribbon cable IDC keyed connector.8V.(MISO)PB6. This is 3VDC output for external digital modules. Inom= 20uA AREF: Analog reference input of ATMega32 microcontroller... If the battery attached to this signal is chargeable and the voltage level is low the module will charge the battery. The power supply of GSM module has to be a single voltage source of VBAT= 3.SPI_D/C: This is GSM module SPI port reserved for future use. Open collector output.(MOSI)PB5. when the battery is discharged. 3V: Digital power of ATMega32. ADC3/PA3: ADC3 input/digital IO of ATMega32. Backup: RTC backup power supply for the GSM module real time clock and RAM. When the module is ON if you press and hold for more than 3 seconds the module go in power down state. Can be used for external analogue circuits.4V. AGND: Analog ground of ATMega32 microcontroller. ADC1/PA1: ADC1 input/digital IO of ATMega32. If the module if in power down mode and you press and hold this key for more than 1 second the module will go in ON mode.(SS)PB4: ATMega32 SPI pins.SPI_CS. KBROW0: This is external keyboard input pin of GSM module. Page 15 .4. This is 3VDC output which can be used for external analog modules. RST: ATMega32 Reset pin.

This jumper connects the DCDC 5V output to the internal charger circuit. when the jumper is closed the DCDC output voltage is set to 4V. Default state closed Important: 4V_E. It is useful to measure the current consumption.It is useful to measure the current consumption. Default state closed Download This is GSM module bootloader enable 4V_E When this jumper is open state the DCDC voltage output is set to 5V. Default state – open. Default state is to be open to not drain the battery during stocking the modules.JUMPER DESCRIPTION: BAT_E Connects 3. Default state . This is necessary when main battery is not connected and the supply voltage should be 4V. Default state – open. this jumper feeds the 4V from the DCDC output to the GSM module. 4V When the main battery is not present. when the battery is connected the DCDC voltage should be 5V. Default state – open. 4V and 5V_CHG_E jumpers have to be moved together. Default state closed 3V_E This jumper connects +3V to FT232RL and ATMega32. Do not plug in external +12V if BAT_E jumper is open! DCDC_E This jumper connects the DCDC output to the GSM module. Page 16 .7V Li-ion battery to the GSM module. Reserved for GSM module firmware upgrade. 5V_CHG_E The GSM module have build in li-ion charge circuit.

MTX/DTX The GSM module have two UART channels. One for the commands. one for debugging. MRX/DRX Default state MRX Page 17 . One for the commands. one for debugging. With this jumper you control which chnnel goes to ATMega32 and FT232RL. MTX/DTX Default state MTX MRX/DRX The GSM module have two UART channels. With this jumper you control which chnnel goes to ATMega32 and FT232RL.

SPEAKER – voice output for external 32 ohm speaker. reflect with log.5 mm jack voice input and speaker output. PWRKEY button – This is GSM module power on/off key. with AT command you can switch the voice audio output to be directed to this speaker or to the handsfree audio connector. reflect with log.INPUT/OUTPUT: Button B1: user button connected to ATmega32 pin. BUZ – audio buzzer . with AT command you can switch the voice audio input to be taken from this microphone of from the handsfree audio connector. The relay is turned on with log 1 of PC6 port. MIC – on-board microphone (voice).11 (PD2(INT0)). STAT is off state – GSM module is not running 64ms On/ 800ms Off – GSM module does not find the network 64ms On/ 3000ms Off – GSM module is connected to the network 64ms On/ 300ms Off . 0 of Mega32 input. LED_R2 (Red) indicated when turn on REL2. Status red LED with name STAT – indicates the state of GSM module. HANDSFREE – audio 2. When the module is ON if you press and hold for more than 3 seconds the module go in power down state. Page 18 .GPRS communication Optocouple 1 – OPT1 (H11A817SMD) .40 (PB0(T0)). LED_R1 (Red) indicated when turn on REL1. Relay1 – REL1 240VAC/10A (RAS1215) with default tied Normal Close (NC) and COM terminals and disconnected Normal Open and COM terminals.5V-12V optoisolated input with LED3 indication and open collector output connect to ATMega32 pin. Optocouple 2 – OPT2 (H11A817SMD) . Relay1 – REL2 240VAC/10A (RAS1215) with default tied Normal Close (NC) and COM terminals and disconnected Normal Open and COM terminals.16 PD7. The relay is turned on with log 1 of PC7 port.12 PD3 (INT1). If the module if in power down mode and you press and hold this key for more than 1 second the module will go in ON mode. can be used as RING signalization. Status green LED with name LED connected to ATmega32 pin.5V-12V optoisolated input with LED2 indication and open collector output connect to ATMega32 pin. 0 of Mega32 input.Positive voltage of '+' terminal and negative voltage or GND of '-' terminal of OPT_TEMP connector. Positive voltage of '+' terminal and negative voltage or GND of '-' terminal of OPT_TEMP connector.

MECHANICAL DIMENSIONS: All measures are in mm. Page 19 .

AVAILABLE DEMO SOFTWARE: Placing/taking phone calls with AVR-GSM (C source) – Remote control via SMS on AVR-GSM (C source) firmware description – Page 20 .

edited October 2011 – in AVAILABLE DEMO added hyperlinks Page 21 .ORDER CODE: How to order? You can order to us directly or by any of our distributors. All boards produced by Olimex are ROHS compliant Revision history: Rev. Check our web www. C SOFTWARE .com/dev for more info.olimex.

This document is intended only to assist the reader in the use of the product. No license. Other terms and product names may be trademarks of others. OLIMEX Ltd. The product described in this document is subject to continuous development and improvements. Page 22 . shall not be liable for any loss or damage arising from the use of any information in this document or any error or omission in such information or any incorrect use of the product. Neither the whole nor any part of the information contained in or the product described in this document may be adapted or reproduced in any material from except with the prior written permission of the copyright holder. are registered trademarks of Olimex Ltd. logo and combinations thereof. Olimex®. express or implied or otherwise. All rights reserved. to any intellectual property right is granted by this document or in connection with the sale of Olimex products. The information in this document is provided in connection with Olimex products. However all warranties implied or expressed including but not limited to implied warranties of merchantability or fitness for purpose are excluded. All particulars of the product and its use contained in this document are given by OLIMEX in good faith.Disclaimer: © 2011 Olimex Ltd.