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

Latest Post: Power Line Communication – (Video)

PLC

PLC (Power Line Communication) is the technology that allows data transmission over the existing Power Line network. Power Line can be the home power network or the national electricity transmission grid. The data that can be transferred is as diverse as its speed. With speeds of nearly 200Mbps, video transmission, voice, data and any other services can be transmitted successfully.

On this article i'm going to describe in detail my B.Sc Thesis in department of Electronic Computer Systems Engineer at Technological Education Institute of Piraeus, October of 2012 in Greece.

The project includes the design of two modules (transmitter – receiver) implementing a serial communication over the Mains connecting a remote large display to a weighing machine. 

The main idea:

The main idea of the communication process is simple described in the following diagram.  

main_idea

From right to left, data to be transmitted are first modulated (digital bits are converted to analog frequency/sine wave e.g. bit 1 is converted to a sine wave of 10Khz bit 0 is converted to a sine wave of 20Khz). In order to "clear" the Mains frequency and make the wire available for the transmitter the 50/60Hz signal is filtered. This filter clears any signal of 50Hz to 60Hz. The transmitted data then are free to travel over the Mains. When they find their destination another 50 to 60Hz filter is involved. After the filter pass the remaining signal is the modulated transmitted data. This signal is now demodulated and converted to digital bits. 

Convert data in a transferable form (Modulation):

There are different ways to modulate digital bits to a transferable frequency. I'll describe the most commonly used types.

  • FSK - Frequency Shift Keying

fsk

In FSK modulation, digital information is transmitted through discrete frequency changes of a carrier signal. For example bit 0 is modulated to a sine wave of 10Khz and bit 1 to 20Khz.

  • FDM – Frequency Division Multiplexing

OFDM

FDM is an encoding method of digital data on multiple carrier frequencies. This method allows simultaneous data transfer on the available frequency range. Firstly the information to be transmitted is separated to pieces. Each piece is modulated to a specific frequency in the available frequency range. Then all the modulated signals are multiplexed to a single signal ready for transmission. 

  • UPB - Universal Powerline Bus

UPB

UPB is a communication protocol specially designed for home automation devices. It uses power line wiring for signaling and control. The implementation can simple be done by charging and discharge a capacitor, forming spikes on the current AC signal.

UPB-timing

The pulses can be placed on 4 different but specific positions on the current AC wave. It's like a 4 bit digital number.

The receiver can simple find the position of each pulse by first recognizing the zero crossing and then start counting since the pulse sense.

Available Transmission Frequencies on AC Power Lines

As in any communication so here a frequency table specifies the allowed transmission frequencies on Power Lines.

North America: 0-500Khz

Europe:

 Zone

 Description

 3 – 9kHz

 Electricity providers

 9 – 95kHz

 A-Band Electricity providers

 95 – 125kHz

 B-Band Clients of electricity provider

 125 – 140kHz

 C-Band Clients of electricity provider

 140 – 148.5kHz

 D-Band Clients of electricity provider

Electronic Filters:

Categories

  • Active Filters
  • Passive Filters

Filter Types

  • Low Pass​  

Low_Pass_DIAGRAMLowpass_ActiveLowpass_Passive

  • High Pass   

High_Pass_DIAGRAMHighpass_activeHighpass_Passive

  • Band Pass   

BandPass_Filter_DIAGRAMBandpass_ActiveBandpass_Passive copy

  • Band Stop   

BandStop_DIAGRAMbandstop_activeBandstop_Filter

 

 

From theory to practice …

 

Project Description

  • "Weight bridge" – Remote Display
  • Receiver – Transmitter Design
  • FSK Modulation 72Khz Band-A

project

First Stage Filter. AC Power Line Filter

The first step of the project was to filter the AC 50-60Hz Power Line signal. The best way to block any other undesired signals than the communication frequency was to design a band pass filter allowing only the communication frequency zone (72Khz) to pass.

The filter was first designed and simulated in spice software. 

BandPass_Filter

Simulation Output:

BandPass_Output

Great! it looks working as it was designed to.

Because on this project we are going to play with 220-110V 50-60Hz Mains AC the above filter was modified to be more secure for experimentation and human use in the future.

Modifications:

  • Between the 47uH inductor and 10K resistor a 1:1 transformer was added to isolate the main circuit from Mains.
  • In parallel with R1 (10K resistor) a TVS diode was added to protect the circuit from Mains voltage spikes. 

BandPass_Filter_Final

In continue to the above filter two more filters was included in the design. One for receiving signals and one for transmitting signals.

Receiver Filter

For the receiver a simple L-C Band Pass filter was designed to remove any remaining noise and undesired signals. 

RX_Passive

Simulation Output:

RX_Filter_AC

Transmitter Filter

In transmission mode we don't want to transmit any noise higher than the transmission frequency. Taking advantage of the Power Amplifier, used to transmitte the output signal, i designed a Low Pass active filter

TX_Active

Simulation Output:

TX_Active_Output

Looking on the internet about PLC solutions i found a bunch of different chips produced by the following companies:

  • STMicroelectronics
  • Microchip
  • Texas Instruments
  • Echelon
  • Maxim Integrated

A common rule i try to follow in most of my projects is to make simple and reliable designs. To do so i try to use as less chips as possible. From the above PLC solutions only STMicroelectronics offer's a chip that includes almost everything in one chip. The ST7540 PLC Modem including the Analog Front End as well as the Power Amplifier, all in a single chip solution looks to be the best choice. 

In this design i used one more chip. A common 8-bit MCU, the Atmel's Atmega168 to control the modem and hold the communication protocol. There is no specific reason why i used this MCU but it was the MCU i knew better.

The ST7540 Block Diagram

ST7540_Block_Diagram

ST7540 Receiver Path

Receivingpathblockdiagram

The receiver path of the ST7540. The receiving signal is captured on RX_IN pin. First crosses a Band Pass filter which filters once more the signal depending on the selected communication band. Next, the AGC (Auto Gain Control) manages to normalize the incoming signal so that it has the same "Volume" Gain along regardless of the signal strength variations that may occur during the communication. Finally the signal is filtered again, driven thru a frequency mixer to the demodulator where the signal is demodulated  to bits and be available on RxD Pin. 

ST7540 Transmitter Path

Transmittingpathblockdiagram

The Transmitter path of the ST7540. The transmitter includes a Power Amplifier with all of it's pins available on the chip footprint. That was one more reason why i chose this modem. I used PA_IN-, PA_IN+ and PA_OUT in appropriate connection with passive components so that it functions not only as a Power Amplifier but as a Low Pass active filter as well. The Current and Voltage loop is a great function that provides control of the output signal strength depending on the cable load and length.

The transmitter path starts with the TxD pin where the digital bits are captured. The FSK Modulator in combination with the DAC converts the digital bits to analog signal. This signal is then filtered and amplified properly to TX_OUT depending on the output Voltage and Current sense. 

Communication between ST7540 & Atmega168

Synchonoys:Asynch_connection

The communication between the ST7540 modem and the Atmega168 can be established using SPI (Synchronous) or UART (Asynchronous)

SPI: 

SPI master-slave interconnection

UART:

uart_framediagr

For this project i chose SPI to establish a Synchronous communication between MCU and Modem.

Circuits: The project was designed in Eagle Cadsoft

  • The final circuitry scheme including all the above described filters. 

Circuit_Active_Filter_PA

  • Full schematic of the final device

Full_Scheme

  • The PCB design to board

PCB

PCB

 

Difficulties:

  • Difficulty on SPI Communication
  • Difficulty on data reception
  • Design/Develop data correction protocol. 

SPI Communication Problem

One of the main difficulties i came across on this project was the modem's SPI peripheral. In SPI communication it is used the peripheral device to perform in Slave mode while the Host device is functioning in Master.
In the specific modem (ST7540) the manufacturer has determined the SPI to function only in Master mode making the Host MCU to perform in Slave. 

This comes in contrasts with the basic concept of the implementation where the Host controls the line communication and defines the timing of transmission. The Host defines the synchronization clock as well as the start / end of the SPI communication.

SPI protocol in order to define the start / end of the communication requires an additional line the SS. By this line the Master can signal the Slave when the communication starts/ends. While the ST7540 is working in Master mode it doesn't include this additional line thus increases the difficulty of SPI synchronization. 

After a lot of hours of SPI debugging using logic analyzer and testing different combinations i found an unusual but working method. In order to enable the Slave's (Atmega168) SS pin to indicate SPI's start/stop i used another pin of the same MCU and not one of the ST7540 (while it wasn't included).

So by checking the CD_PD line (carrier frequency detect line) of the ST7540 the MCU knows when there are available data for reception in ST7540. If the MCU detect available data enables the SS pin and the SPI communication starts by receiving the available data. When the data reception ends thus the CD_PD pin has changed state to indicate that there are no more available data the MCU restores the SS pin to its initial state disabling the SPI and clearing the SPI bit counter used to synchronize the communication. 

This method is like deceiving the SPI while the same (Slave) device enables its SS pin. 

Data Correction Protocol

Once successfully completed the data transmission between the ST7540 and the Atmega168 one more problem occurred. After several data transmissions and monitoring the transmitted data using Oscilloscope and Logical Analyzer it observed that many times the data received differed from those sent.

After studying the taken measurements it was found that the received data were not wrong in their content but in the bit sequence. The received bytes were shifted one or more bits to the left thus some of the most important bits were lost in the transmission.

To prevent and automatic correct the received data from possible "undesired shifts" a correction protocol was designed.

On the following example i randomly added 2-shift error on New byte 2 and 1-shift error on New byte 1

Protocol Steps:

  • Transmitter:
  1. The byte to send is first separated to two nibbles.
  2. Nibble 1 and Nibble 2.
  3. The header 0×10 is logical AND at each new byte
  4. The new bytes (New byte 1 and New byte 2) are ready to be send
  • Receiver:
  1. The receiver makes a logical AND to the received byte with 0xF0 and check's if the header is > 0×10. The main idea is to check if the received byte's header is 0×10 or it is shifted left. 
  2. If it's > 0×10 it means that the received byte was shifted left. So the receiver shifts the byte one bit right and checks again. 
  3. This procedure is repeated until the header of the received byte become 0×10.
  4. When the header becomes 0×10 it "means" (if the byte was really shifted) that the right half byte (nibble) is the correct half byte that was first sent from the transmitter.
  5. The same procedure is repeated for the the "New byte 2"
  6. The two right halves of the received bytes are then combined to one new byte which is the final byte to read. 

Protocol_Diagram

 

Safety

For safety reasons the power strip where the PLC modules were connected during the tests was modified by adding a four contact switch with light indicator and a fuse.  

Before After

An extra fuse was added to each power cable used to connect the PLC module. 

The Mains 50-60Hz filter was built in a separate removable PCB for extra protection. The PCB was also wrapped with heat shrinkable avoiding user contact to Mains. 

PLC PLC

 

More Photos:

Debugging … Flashing and Debugging again … 

PLC PLC

PLC PLC

The final project connected on the Mains.

PLC

The module board.

PLCPLC

The Mains 50-60Hz filter was developed in a separate removable PCB for protection reasons.

PLCPLCPLC

The 50-60Hz filter was also wrapped with heat shrinkable avoiding user contact to Mains

PLC

RS232 to UART converter.

PLCPLC

Modified wall plugs 12V 1A used to power the PLC modules.

PLC

First Blinking Led Test.

Final demonstration

The source code as well as the PCB & Schematic can be found here:

DOWNLOAD HERE

 

Project presentation at 1st Innovation Festival Technological Educational Institute of Piraeus (Video in Greek)

28-29/03/2014

PLC PLC

PLC PLC

Latest Post: Thermostat V1.0

Thermostat

In the need of my new homemade energy saving fireplace (which boils water for the radiator) i designed and built a digital thermostat. The idea to design my own thermostat came when i came across with the following problem.

When i first fire the fireplace the water in the boiler around the fireplace is cool. After a few minutes the fireplace warms the water enough so that the water temp exceeds the thermostat limit. The thermostat changes state and drives an electric valve to move the water from the fireplace boiler to the radiators. The electric valve is slow enough and takes a few minutes to make a full turn. While the water is moving from the fireplace boiler to the radiators, circularly cool water is coming back in the fireplace boiler from the radiators. Τhe water temp in the fireplace boiler is getting cooler and after a few minutes falls under thermostat's limit. The thermostat changes state and stops the valve from driving the water to radiators. This happens again and again until the whole amount of water in the radiators is get warm

To prevent this problem from opening and closing the electric valve in so small time spaces i designed a thermostat that can delay the sample points. It check's the fireplace boiler temp and drives the electric valve once the water temp exceeds the thermostat limit. After that it waits for a half hour or more and then checks the water temp again.

The Design:

A simple Power Supply design using LM7805 regulator and two capacitors. 

Thermostat_PSU

For Menu selection and device configuration a Rotary Switch is used. The selected rotary includes a push button switch as well. 

Thermostat_Rotary

Two Relays manage to drive external electric valves

Thermostat_Relay

The user interface is displayed on a HD4780 LCD Character Display with configurable backlight.

Thermostat_LCD

The main MCU is the 8-bit AVR ATMEGA168. A Buzzer manages to indicate the user for a button press or a limit exceeded. Two LM35 temp sensors one internal and one external measure the ambient and pipe – fireplace boiler temp. You can also notice a 32.768Khz crystal. This crystal is used to impliment a real time clock which keeps real time delays.

Thermostat_MCU

Writing the Firmware

Writing the Firmware

All the components. The front panel is printed on a laser printer using transparent paper.

All components Front Panel

Milling notes Circuit Top view

Homemade PCB without ISP header to make faster board routing.

MCU Flashing Bottom View

The source code as well as the PCB & Schematic can be found here:

DOWNLOAD HERE

 

Latest Post: Carbon Fiber Exhaust Repair

I'm writing this post to share with you some photos of my motorbike's exhaust system repair. 

For the repair i used 1 meter of carbon fiber tape and 1 liter of resin (i didn't use all of the resin but that was the smallest available amount in the market). Total cost of the repair was about 40

FIRST STEP:

Cleaning and sanding the broken place.  Placing the first carbon fiber layer 

Exhaust Repair Exhaust Repair

The final result: (On the final surface you can view some bubbles that came out because i didn't use a vacum machine)

Exhaust Repair Exhaust Repair

Latest Post: Macbook Pro 13.3″ Simple Sleeve

One Sunday while i was watching my grandmother's sewing machine it came on my mind to build a simple modern Sleeve for my Macbook Pro 13.3". The materials i used was what i found lying around. An old pair of blue jeans and a piece of durlap in the store room used for sack repairing. It didn't take more than one to two hours to learn how to use the sewing machine (by reading the manual and some videos on youtube) and cut the materials in the correct form.

Here is the result of the unique Candrian Sleeve

I used the bottom of the jean as a pocket in the Sleeve

Latest Post: IV-11 VFD Tube Aluminium Case

Today (Jun 7, 2013) i finished my first IV-11 VFD Tube Unibody Aluminium clock prototype.

From 3D Model:

3D Model Assembly 3D Model Assembly

3D Model 3D Model

3D Model 3D Model

To Real Model:

IV-11 VFD Clock (Aluminium) IV-11 VFD Clock (Aluminium)

IV-11 VFD Clock (Aluminium) IV-11 VFD Clock (Aluminium)

IV-11 VFD Clock (Aluminium) IV-11 VFD Clock (Aluminium)

IV-11 VFD Clock (Aluminium) IV-11 VFD Clock (Aluminium)

IV-11 VFD Clock (Aluminium) IV-11 VFD Clock (Aluminium)

More info: http://clock.candrian.gr/

Latest Post: IV – 11 VFD Tube Clock V1.2 (Greek Design)

Click for more info IV – 11 VFD Tube Clock V1.2 

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 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.

 

DOWNLOAD HERE

 

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:

00000000
00011000
00011000
01100110
01111110
01100110
01100110
00000000
00000000

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

0000000000000000
0001100000011000
0001100000011000
0110011001100110
0110011001100110
0111111001111110
0110011001100110
0110011001100110
0000000000000000
0000000000000000

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

Repeat.

 

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