Visit Us On FacebookVisit Us On TwitterVisit Us On Google PlusVisit Us On LinkedinVisit Us On YoutubeCheck Our Feed

Latest Post: Adjustable digital spirit level indicator

As an Electronic Computer System Engineer at Delmac Instruments and in the needs of a customer i managed to develop/design a digital adjustable spirit level indicator. The main purpose was to set a zero point which means it is the starting measurement position and a limit point which will be the limit for the indication. When pitch or roll exceeds the limit point a buzzer will start ringing and indication LEDs will show the direction. There has been also added a UART interface which transfers axis values and some extra port outputs for debuging. 


Adjustable Digital spirit level Adjustable Digital spirit level


Latest Post: IV-11 VFD Tube Clock First Design

IV-11 VFD tube Clock March 2012 Wooden case


New case design New case designNew case design

This is a project i designed a year ago but never built, because of not enough spare time. This month i found some free time so i started building it and i send the pcb layout for manufacturing. 

All started when i received some IV-11 vfd tubes from an ebay seller i ordered from and i started testing and prototyping by first trying to simple light up the VFD tube.

A VFD tube works like a 7-segment led display with some small differences.

A) The Filaments. The Filaments exists to power the tube. We have to supply these two pins with 1.2Volt and nothing more (polarity doesn't matter).  

B) The Grid. The Grid is like the common anode of a 7-Segment LED display. So the Grid has to be pushed high at 60Volt (in these tubes) in order the segments to be able to light up.

C) The Segments. The Segments light's up simple by pushing them high at 60Volt.

Here are the very first steps of powering the tube manually.

IV-12 tube Testing

To make the powering of the tube digitaly in order to use it in the final design we have to built a simple circuit which will impliment the above description. The circuit has to be able to push each segment at 60Volt or Pull it to Ground at 0Volt. To do this two transistors (Push-Pull) are needed for each segment. One for pushing the voltage and one for pulling it down.

Push Pull Transistor connection:

We have 9 lines at each tube which need push pull transistors including Dot segment and Grid. So we have 2 transistors x 9 lines= 18 transistors in total for one tube, 28 for 6 tubes (8 lines for segments are in common for all tubes, only Grid is seperate and used for multiplexing). The number of transistors needed are enough for a fault on soldering or pcb etching (more routes) decreasing the finall product reliability and increasing cost because of the more pcb space needed. Less components more reliability.

To make VFD tube driving easier and more reliable Maxim has built MAX6921. MAX6921 is a Push Pull shift register where each bit of the register is ported on a specific pin of the device. So if we shift a bit of '1' the corresponding pin will be pushed high and if we shift '0' the corresponding pin will be pulled low. The communication to the shift register is implimented via SPI which makes it more easier as most of the MCU's nowadays have embedded SPI. By using this chip we only need 3 pins from the main MCU to impliment the SPI communication and nothing more. 

Prototyping the basic powering circuit using MAX6921 VFD tube driver.

VFD-Tube clock bread board testing   

To make all the 6 display tubes used in clock, appear at the same time we have to multiplex them. To do it so we have to turn on and off each tube in the row, enough times in a second in order, the transaction not to be visible in human eye (about 70~100Hz). As you can see on the above right video multiplexing for two tubes is tested.

Testing Filaments in series.

Testing MC34063 PSU

Describing the final circuit. 

The integrated circuits i have used are:

The main brain and RTC, ATMEL's AVR Atmega168p which has SPI, 16K of memory to write plenty of code, Counter/Timer with asychronous external crystal interrupt to update the RTC even in sleep mode, ADC for ambient light sense, an Analog Comperator for voltage drop sense to turn mcu in sleep mode when runing on backup battery and PWM to control LED brightness and voltage booster for Segments brightness. 

The MAX6921 VFD-tube Push-Pull driver used for the tubes driving.

The external supply voltage of the circuit is designed to be 1A 12Volt Power Plug Adapter.

To power the two chips a simple 5V stabilized power supply with LM7805 is used. Also has been used a full bridge rectifier in order to make the circuit work in any voltage polarity. At the output a low voltage drop 1N5817 diode is used to prevent back voltages.

To convert supply voltage from 12Volt to 60Volt for Grid and Segment supply a boost converted has been used which is controlled with PWM from Atmega168. The boost converter is inspired from adafruit's ice tube clock. A pull down resistor has been used at the MOSFET Gate to pull it down in no operation and a 60Volt zener diode is added in parallel to output to prevent over voltages.

A backup battery is used to keep runing the mcu when power supply is unplagged. A low voltage drop diode 1N5817 is connected in series to prevent battery charging.

Three buttons are used for user interface (configure time/date/alarm and change menu) with pull up resistors and decoupling capacitors for spikes, AVR In System Programmer, and a voltage divider used for voltage drop sense. A decoupling capacitor is also used here to prevent spikes.

Ambient light sensor (a voltage divider with a photoresistor), a UART pinout for additional modules to be add in future and a transistor in series with a 2Watt resistor, is used to adjust filament voltage/current using PWM. Because the circuit is designed to be powered by a power plug adapter the filaments are connected in series to reduce current darw and they are supplied directly from +12V.

There have been also used 6 RGB leds, one under each tube, filling in the tubes with more color and making it more impressive. The color change depending on the selected menu. 

Green: Time

Blue   : Date

Red    : Alarm

They are also supplied directly from the power plug adapter in order not to overload LM7805 and increase it's temp.


The main circuit.

The tube segments are connected in parallel via the bus to MAX6921 and a FET is used to turn on/off the chip. Atmega168 is connected with ISP to MAX6921. A 32,768KHz crystal is used to count the time. Also a buzzer has been used for alarm mode and button press feedback.

Crystals with frequiency 32,768KHz is used in RTC's beacuse they make perfect division with 128.  32 768 / 128 = 256. So we use this crystal with a clock prescaler of 128 and we have a counter (max value of counter 256) overflow interrupt occured once a second with accuracy of 0.002% depending on crystal.

Finall design photos:

The PCB Desing:

IV-11 VFD tube Clock March 2012 - PCB IV-11 VFD tube Clock March 2012 - PCB

Showing Time (GREEN Light).

IV-11 VFD tube Clock March 2012 IV-11 VFD tube Clock March 2012

Showing Alarm (RED Light).

IV-11 VFD tube Clock March 2012 IV-11 VFD tube Clock March 2012

Showing Date (BLUE Light).

IV-11 VFD tube Clock March 2012 IV-11 VFD tube Clock March 2012

And some more photos.

IV-11 VFD tube Clock March 2012 IV-11 VFD tube Clock March 2012

A photo with less light to capture clear digits. 

IV-11 VFD tube Clock March 2012



Update! Building a wooden case.

Gluing the frame Gluing the top

Gluing the top Painting the top

Soldering a new clock for the wooden case Comparing the two clocks

Wooden case Wooden case

Wooden case Wooden case - Front view

Wooden case - Rear view

Latest Post: Switch Timer V2.0

Timer V2.0 Redesign Timer V2.0 Redesign

After some modifications on my UV exposure box (scanner) for better UV expose, i desided that a better pcb must me designed for switch timer. The old one had over drilled holes and it was designed and built on my very fist steps. Also the high voltage side from the low voltage wasn't seperated as it needed to be safe. 

So i redesigned it in a more compact and easier to use pcb. The firmware has been also updated and now you can program the timmer by using the two buttons. The time is calculated by timer interrupt triggering using a 32.768KHz RTC Crystal with better accuracy. The display update also has been changed from static to dynamic.

The board is homeprinted at my exposure box.

Here is the schematic in pieces.

For 5V supply used for AVR, 7-segments etc, has been used a full bridge rectifier, a big decoupling capacitor and LM7805 :

The two seven segments are connected in parallel and are updated using mutliplexing. Current protection resistors are used for each segment. Q2 & Q3 are switching each display.

Here is the relay drived by Q1 witch switches on/off the relay. On the one side of the relay is connected the AC Mains and on the other the lamps.

The AVR ATmega8. A buzzer has been used to indicate when timer is on/off and when a button is pressed. Here you can also see the RTC crystal 32.768 used to trigger the timing counter.




Latest Post: Thermal Printer Driver

One of my latest projects i just finished is a hardware thermal printer driver. This project designed/developed for Delmac Instruments as a part of my internship. Thermal printers are used in cash and weighting machines for receipt printing.

Thermal Printer Connected on the driverThermal Printer attached on the driver

What the specific hardware does is to receive ASCII characters, escape sequences in UART and convert them in a printable form to send to printer mechanism for printing. Escape sequences are used to send commands to the printer to change character size, line spacing etc.

Thermal Printers don't use ink as usuall printers but they have a head of tiny resistors in a row (about 384) which behave on the paper as dots. Also they use a suitable paper which is thermal sensitive. 

By supplying voltage to a single resistor, you heat the resistor and you make the paper burn at the specific point drawing a tiny single dot on the paper. If you supply voltage to a single resistor and you move the paper at the same time by stepping the head motor you will have a tiny width vertical row. This is the basic. (Resistors are refered as elements).

The main behavour of the head is like a shift register. You shift data to be print on the head register and then you supply voltage to the elements, mapping the shifted data, on the paper. For example if you shift a value like 000011100111000111 and you power the elements you will have the '1' bits appeared on the paper with dots.

Here is a diagram showing how the data are shifted.

To print a single character you have to draw it line by line. To do this fast and simple the character pattern has to be saved on a table with all the other characters. Then you select each line of each character you want to print and you shift it on the printer register by the order you want.

For example a simple character pattern of A in 8-bit width and 9-bit height could be:


If we want to print A A then we have to shift the following data line by line.


The main printing algorith is:

1) Shift one pattern line data to the head register

2) Power the Elements

3) Move motor one step

4) Power the Elements

5) Shift next pattern line data to the head register



Note.   Steps 2 and 4 are repeated because each line we see on the paper is two dot lines of the printer head.

Thermal Printer DriverThermal Printer Driver
Thermal Printer Driver

Latest Post: Thermometer V2.0

Angle ViewFront ViewSide view


ThermometerV2.0 is coming to replace in hardware and software V1.0.


I designed this version in the need of a thermometer for my room, built in a small pack and easy to control. The hardware is designed on a way so that the pcb can be wall mounted. At the top side of the device the PCB extents giving space for two keyhole type holes which are able to keep the device mounted on the wall. The LCD display plugs at the front side of the PCB, covering all the electronic components and giving a compact design view. The user can interact with the device using the left side switch button. The design includes a 6-pin header which gives connectivity for UART (RX,TX,GND) and for the external sensor DHT-11 (VCC,GND,DATA). Also there is an ISP-6 pin header which gives the option of on board programming. Finally there is an optional Bluetooth plug on the back side connected with AVRs UART for possible communication to other devices like mobile phones, home automation devices, pc's or whatever you imagine.

The code is written in C and is well performed in a readable way so anybody can read and modify it. For the LCD driving i have used Peter Fleury's library.

Function Modes

Display modes:

Backlight modes:
 1)Fast mode (press the button, light on, 2 seconds delay, light off)
 2)Light switched off
 3)Light switched on

Hardware description:

The power supply

The power supply is a basic LM7805 power supply using two pair's of decoupling capacitors before and after the regulator. Additionaly can be used the AMS1117 regulator at 3.3V. This regulator is included in the design to give the option of using a Bluetooth module which usually work at 3.3V.

The LCD HD44780 16×2 Char

A 16×2 character LCD display is used to display data to user. The only thing that somebody may not understand here is the use of BC547. BC547 is used as a switch to switch on/off LCD's back light or to pulse it using PWM adjusting the back light lightness and giving nice fading options. R3 is used to limit the current flow to transistors base, and R1 is there to pull down base voltage.

Main Brain Atmega8

The main brain of this device is Atmega8.

Note. A 16Mhz crystal has been used instead of 8Mhz shown on the schematic in order to read DHT data easier.


Above are the peripherals used. From left to right,

  • The Bluetooth module, this module is optional. It is connected to avr's uart so everything in UART can be sent via Bluetooth. For example it can send the sensor reading on a pc, a mobile phone, e web server.
  • The DHT-11 sensor is used for outside humidity and temperature measurement. It has a 5k pull up resistor to Data pin to pull data bus to VCC and a 100nF decoupling capacitor to filter noise
  • Including an ISP header on the design makes it easy to update the software and debug on board.
  • For inside temperature sensing has been used the LM35.
  • A button is used to interact with the user. This button is pulled up with avr's internal pull up resistor and is connected to INT0 interrupt pin.
  • Also there is a UART pin header for optional module installation or for serial connection to PC.

More photos:

The PCB Board:

Pcb Board Front Side Pcb Board Back Side

From Design to reality

PCB Design Pcb Board Front Side Soldered

The back side of the PCB and all the parts nedded for this project.

Pcb Board Back Side All components for this project

While testing the Hardware and the Software on breadboard proto.

The final device view.


Sending sensor readings over Bluetooth.


The source code can be found here:



Latest Post: DHT-11 & One wire bus


DHT-11 is a temperature & humidity sensor in one package. It utilizes exclusive digital-signal-collecting-technique and humidity sensing technology, assuring its reliability and stability. Its sensing elements is connected with 8-bit single-chip computer. Every sensor of this model is temperature compensated and calibrated in accurate calibration chamber and the calibration-coefficient is saved in type of program in OTP memory, when the sensor is detecting, it will cite coefficient from memory. Small size & low consumption & long transmission distance(20m) enable DHT-11 to be suited in all kinds of harsh application occasions.


  • Low Cost
  • Supply voltage 3 to 5V
  • Max current 2.5mA (while requesting data)
  • 20-80% humidity range with 5% accuracy
  • 0-50C temperature range with +-2C

Inside the package looks like this:


SDC11305 Inside DHT-11

The interesting thing in this module is the protocol that uses to transfer data. All the sensor readings are sent using a single wire bus which reduces the cost and extends the distance.

In order to send data over a bus you have to describe the way the data will be transferred, so that transmitter and receiver can understand what says each other. This is what a protocol does. It describes the way the data are transmitted. 

On DHT-11 the 1-wire data bus is pulled up with a resistor to VCC. So if nothing is occurred the voltage on the bus is equal to VCC.


To make the DHT-11 to send you the sensor readings you have to send it a request. The request is, to pull down the bus for more than 18ms in order to give DHT time to understand it and then pull it up for 40uS.


What comes after the request is the DHT-11 response. This is an automatic reply from DHT which indicates that DHT received your request. The response is ~54uS low and 80uS high.


What will come after the response is the sensor data. The data will be packed in a packet of 5 segments of 8-bits each. Totally 5×8 =40bits.

First two segments are Humidity read, integral & decimal. Following two are Temperature read in Celsius, integral & decimal and the last segment is the Check Sum which is the sum of the 4 first segments. If Check Sum's value isn't the same as the sum of the first 4 segments that means that data received isn't correct.

How to Identify Bits:

Each bit sent is a follow of ~54uS Low in the bus and ~24uS to 70uS High depending on the value of the bit.

Bit '0' : ~54uS Low and ~24uS High

Bit '1' : ~54uS Low and ~70uS High

End Of Frame:

At the end of packet DHT sends a ~54uS Low level, pulls the bus to High and goes to sleep mode.


Logic Analyzer Snapshots

In the following image you can see the request sent from the MCU to the DHT and following the packet. Because the request has very long duration as you can see is about 20mS and packet received is in uS we can't view the data bits.

If we zoom at the data bits we can read the values. You can see after the Request follows the Response, and Data bits. I have drawn some color notes to be more understandable.

If we decode the above data we have.

Humidity 0b00101011.0b00000000 = 43.0%

Temperature 0b00010111 = 23 C.

The last two segments can't be seen in this image because of zoom.



What we have to do to read a DHT-11 sensor is:

  1. Send request
  2. Read response
  3. Read each data segment and save it to a buffer
  4. Sum the segments and check if the result is the same as CheckSum

If the CheckSum is correct, the values are correct so we can use them. If CheckSum is wrong we discard the packet.

To read the data bits can use a counter and start count uSeconds of High level. For counts > 24uS we replace with bit '1'.  For counts <=24 we replace with bit'0'


Here you can find some code to read DHT-11 using an Atmega8 at 16Mhz


Latest Post: DC Motor Speed Controller

In the need of controlling a 7A 20Volt DC Motor i designed a speed controller with some cheap components. The circuit is a digital circuit and works with Pulse Width Modulation (PWM) which is one of the best ways to control a dc motor. This circuit can drive up to 33A 10V DC motor with a big heat sink placed on the switching mosfet.

Summarily i used in this circuit, the AVR ATtiny13 to control the PWM , a n-mosfet IRF540N for switching the motor and a Rotary Encoder to adjust the PWM Duty Cycle.

Note. The same circuit can be used as a light dimmer for LEDs.

The circuit consists of:

The Power Supply.

It is a basic LM7805 power supply which adjusts the voltage at 5V for powering the ATtiny13 and the LEDs. Capacitors before the LM7805 C10, C7 and after C8, C11 have been used for noise filtering. Diode D1 1N4001 is there to protect the circuit from inverting voltages.

The main circuit.

The main circuit can be separated in 4 sub circuits to be more understandable.

   The LEDs

3 Leds have been used for indicating PWM Duty Cycle value: Minimum (LED3), Maximum (LED2) and the Current Value (LED1). LED2 and LED3 are connected directly to the ATtiny13 I/O. LED1 which indicates the current PWM Duty Cycle value is driven by the transistor T1 BC337 triggered by the PWM output. R1 R3 and R4 are current limiting resistors for LEDs. R2 Limits the current draw to the BC337 base.

   The Rotary Encoder

This is the Rotary Encoder connected with the appropriate components to work properly. R6 and R5 are pull up resistors which "pulls" A and B pins to VCC. Pin C is directly connected to GND. C4 and C3 are decoupling capacitors which are appropriate for noise filtering. If you don't place them the noise will be not filtered and the rotary probably will not work.

   The Motor Switcher

For Motor Switching i have used a n-mosfet IRF540N which can Continuous Drain Current, VGS @ 10V 23-33A depending on the temperature (25C-100C). Diode D2 has been placed for inductor inverting voltages. Capacitor C1 is there to filter the noise provided from the motor. If you don't place this capacitor you may have noise at the rotary encoder and it will not work properly.

Make sure you have placed a heat sink on the IRF540N because at high currents it is getting realy hot!

Here you can find photos of the test circuit i built.

DC Motor Speed Controller DC Motor Speed Controller


The code and the Circuit Scheme can be found:


Latest Post: 3-pin Rotary Encoder How to

The idea of explaining here how a rotary encoder works began from the need to use a rotary encoder myself for adjusting a pwm which drives a DC motor. So i started looking for how a rotary works. When i understood how it works i thought that it could be a good idea to show you and explain what i learned.

Anyone who has worked on circuits before has used an analog potentiometer. If you are new in electronics here is a quick explanation of what a potentiometer is. In a few words a potentiometer is a varying resistor which value changes by turning the knob. By the Ohm Law V=I*R implies that it can be used for voltage or current adjustments. An example of potentiometers use is in front panels for varying values e.g in a work bench power supply to adjust the voltage or the current.

Well the potentiometers have some disadvantage.

  • Produce noise at knob turn over the uses or if dust has passed in.
  • They are not that accurate.
  • To use them in a digital circuit you have to use an Analog To Digital converter.

On the other hand Rotary Encoder.

  • There is no noise production (if you use the appropriate capacitors).
  • They are accurate (they have steps).
  • There is no need of a digital to analog converter.

Also another difference is that the analog potentiometer has a stop and start point. Rotary encoder can be turned as many times as you want. There is no end and start point. Optically there is no big difference. The best way to find out if it is a rotary encoder is to turn the knob. If you feel steps and there is no start and end point it is a Rotary Encoder.

So Rotary Encoders can be used in digital circuits providing accuracy and ease of use. Analog potentiometers are easier to use in analog circuits.

A Rotary Encoder usually has 3 pins A, B and C. Pin C is the middle pin and we connect it to GND.

What a rotary encoder actually does is:

While you turn the knob it "short-circuits" pins A and B to pin C (GND) for some milliseconds depending on the speed you turn it. Actually this is the step you feel when you turn it. Which of the two pins is shorted first depends on the direction you turn the knob.

  • Right wise pin A will be first shorted to GND and then pin B.
  • Left wise pin B will be first shorted to GND and the pin A.

By this you can identify in which way the knob is turned to. To see the short circuit, you have to supply a voltage at pins A and B. If you don't do it the voltage at pins A and B will be 0Volt before and after the short circuit so no difference will be observed. If you put direct voltage on these two pins when short circuit occurs a lot of current will be drawn as a result the power supply connected to, may be burned. For this reason we have resistors. They can adjust the current flow and they can hold voltage difference at their edges. By putting a pull up resistor on each pin(A & B) to supply voltage you pull them the supply voltage (that's why the called pull ups) and when the short circuit is occurred their voltage drops to 0V as the GND. The current that will be drawn depends on the resistors value. With the Ohm Law V=I*R you can calculate it.

Above is a hand drawn schematic with the theoretical output pulses on the right. R1 and R2 are the pull up resistors i talked about before (In use with an MCU for better results don't use MCU's internal pull ups but external 10K's). The real waveforms is expected to have noise provided by the turning of the knob as a push button provides as you push it. To clear this noise i have put two decoupling capacitors C1 and C2 (1uF each). Follow real images from a logic analyzer when the knob is turned with decoupling capacitor connected and not. Notice the difference!

Right Wise

Capacitor NO

Capacitor YES

Left Wise

Capacitor NO

Capacitor YES

We don't care about the pulse width which depend on the speed you turn the knob. What we are interested in is which pin is getting first low. As you can see there is a big difference between waveforms with and without capacitors connected. Waveforms with capacitors connected are close to theoretical ones.

Actually the code exported from the 3-pin rotary encoder is a 2-bit gray code.

Right CCW

Left CW

A 0 0 1 1
B 1 0 0 1

A 1 0 0 1
B 0 0 1 1

We can identify in which direction is moving by just looking the B state after A's falling edge. With red is colored the state after the falling edge of A.

Well now that we know how it works we can use it with a microcontroller by just checking which pin is getting first low. One way is to use an external interrupt with triggering on the falling edge of pin A as shown in the following diagram. If a falling edge detected on pin A check pin B state. If it is low that means that the rotary has turned left otherwise it has turned right.


The test Circuit

Rotary Encoder How To

Latest Post: Thermometer V1.0

Digital Thermometer BreadBoard testing

Thermometer V1.0 was built at my very first steps on microcontrollers and generally in electronics about 2008. Then i was still writing embedded software in assembly as a starter. It was a big challenge for me to drive the HD44780 LCD Display and the ADC of the Atmega8 using assembly. I remember, i was writing and testing about a month to make it work. Searching for bugs on both hardware and software. By the way when you develop both sides hardware and software, debugging is the most difficult thing. Υou don't know where to start from, searching for bugs, software or hardware? I also had came across with the problem of making a division and that wasn't that easy. I had to write a whole function to do it (in C you can just write the symbol / and division is done). In assembly if the division is by 2 you can easily shift the value right but if it isn't what you can do?

This project wasn't something admirable but it was much a lesson for me. I learnt a lot of things from this like writing assembly, learning how the LCD  works and how to drive it with the correct timing! Every difficulty you come across is a lesson for you!. Of course when i saw it working (on breadboard) i felt so happy like a kid.

I also remember a classmate of mine sawing him the code and talking about how many hours it took to me to make this thing work and him telling to me "Oh that's what you made? this is very easy… I made the same thing in about half an hour". When i asked him how he did it, he revealed me that he had just copied some C code (about 20 lines) of a book he found when mine was about 600lines and i knew where is each word in the code. Well the answer is yours… You can make things the easy way but you have to know that someone else had worked for you to make these things easy for you and he is the one who has learned the more! If you want to learn don't choose every time the easy way.

Well here i post some photos of the circuit. It was my first homemade double side pcb using short wires for vias and soldering components in both sides which finally didn't work :P. For a reason i don't know i have lost the Eagle Schematic and Board Layout. I have only the code and the photos. So i post what i have.

As i remember i have used ATmega8, LM35 and HD44780 LCD Display. Also LM7805 has been used for power supply.


Digital Thermometer Digital Thermometer

Digital Thermometer Digital Thermometer

The Assembly code can be downloaded at the following link


Latest Post: GSM/GPRS Autonomous Weather Station (Tracking System)

Front    Back-soldered

Autonomous live tracking weather station. It takes (analog/digital) measurements and sends them to a web server over GPRS. Adding a battery and a solar station you can make it fully autonomous. It supports up to 3 Analog or Digital inputs. The main brain is the PIC 16F877A which also drives the SIM900/300 GSM module which is placed in the back of the PCB.
The main purpose of this project is to take wind flow measurements of different locations and store them in a database remotely. By this you know if the locations are appropriate for future installation of wind generators.

The data send from GSM to Web server with GET requests which isn't the safest and best way but its an easy way to make it work. The example code you can find at the github is a very simple example and has no security responsibility.

The GSM module:

For the GSM communication i've used the SIM900/300 which is a very good, easy to use and cheap gsm module. It offers UART communication and can be controlled with AT Commands. It works at 3.6Volt and uses an external gsm antenna. The module also includes a battery charger which is very useful if an external battery is used in combination with a solar panel or a wind generator for autonomous use. On the design there is also a LED indicator LED1 which indicates the gsm status (blinks). The module can be powered on/off by the button [S3]. As a hardware design guide i have used the Sim300 Hardware Design.

Note1.  I began designing the board for SIM300 which finally stopped to be manufactured and replaced with the SIM900. The hardware design manuals deference from each other so you may  find some useless components included in the connection between the simcard and the sim module which was included in the SIM300's manual but not in the SIM900's. The footprints of these two modules are the same.

Note2. The S3 which i used to power on/off the module but can be replaced with a transistor connected to the PIC to power on/off the module from the MCU.

Note3. The module works perfectly with the only disadvantage that it needs a voltage supply >4Volt to Vbat pin.

The main "brain" PIC 16F877A:

The main "brain" is the PIC 16F877A working at 16Mhz. The MCU is supplied by the Vbat as the gsm module. RA0,1,2 are used for analog inputs (analog measurements). The input voltages are converted to digital internally (ADC) with Vref=3.1V which is stabilized by a 3.1Zener diode. At the analog's inputs pinout is also included a Vbat and GND pin for possible external's measurement tool power supply. The Q3 (BC547) is used to Pulse (PWM) the LCD's backlight in order to reduce the power consumption and adjust the backlight's brightness. S4 switch is used to reset the mcu and R1 is there as a pull up resistor to keep the voltage high on running mode. D1 is there to stop the 12Volt to "charge" the battery and burn the SIM900 (Vbat). R2 limits the programming current flow to MCLR. In this design there is also included a PIC-ICSP header which lets the developer to program the pic in system without the need of unplugging anything.

The 16×2 Char LCD HD44780 :

A 16×2 LCD HD44780 has been used to display some status information and make the device user friendly. There is a backlight jumper (POWER-LCD) at the led's anode which gives the user the option to turn off the backlight for power consumption. There you can see that this net is connected to PIC's INT (LCD-INT) which is used to make the PIC know when the LCD is powered on to run the LCD initialization routines (The LCD at it's first power on needs to be sent some commands to initialize and make it ready to display the data that will receive). By this you can remove the LCD while the MCU is running, plug it back reset the jumper and the LCD will start working again.

More photos:

The pcb under light  Front

Back  Homemade PCB of GSM Back

Homemade PCB of GSM Front

Breadboard prototype:

GSM bread board testing    GSM bread board testing

Testing Video:

You can download the PCB design the Firmware the datasheets and the data storing web site from the github.


This was build as a project of Microprocessors lab for Technical Institute of Piraeus department of Electronic Computer Systems Engineering.