Showing posts with label theory. Show all posts
Showing posts with label theory. Show all posts

Monday, September 29, 2014

How the BMP (bitmap) image looks from the inside, in binary

I needed to create a mitmap image in to code converter for Nokia 5110 display. So i decided to use .bmp images, just because they are simple.

If you want to look inside image file (binary code) you can use any "hex editor", if you open any file, programm will display to you hexadecimal codes from which this file consist of. I use "Hex Editor XVI32"

Sunday, September 28, 2014

nokia 5110 LCD display AVR


Now i will write about nokia 5110 display.

Saturday, September 27, 2014

Working with LCD display on HD44780 AVR

If you need only ready to use library, you can get it here.

Datasheet


I ordered display from ebay, 2 lines by 16 symbols.


How to work with AVR MC pins and their additional functions

I will write an overview about different AVR ATmega8 pins and show some coe examples for working with tem.


Tuesday, August 19, 2014

What is a servo motor (servo)

Servo motor is a motor, which we control by telling it at what angle it should be rotated and servo is trying to maintain that position.



How to work with it

Servo has 3 outputs: Power, Ground and Data.
On Data wire we apply PWM signal with different duty cycle, to control our motor.

     

Generally PWM frequency is 50 Hz (period = 20 ms), minimum impulse width is 1 ms (0°) and maximum is 2 ms (180°).
There are a variety of different servos, so you still need to read datasheet, but this information will help you to start.

Now i will write about their structure, you don't need to know what is inside of them to use them.

How to work with Sharp Infrared sensor

I already wrote how to work with ADC In this article.



( In the simplest case ) Infrared Proximity Sensor - Sharp has 3 output pins: Vcc - Power, GND - Ground and Vo - Data. Depending on the distance varies the voltage at the output Vo, all that left is transform that data to digital information.




AVR Tutorial - ADC (Analog to Digital Converter)

ADC as you can guess converts analog voltage to digital number, so we could work with it in microcontroller. We can build simple ADC with comparator, it's a device which compares 2 signals (1 of them is some constant reference voltage) gives one otput if 1 signal is bigger and other if smaller.

ADC accuracy depends on it's resolution. e.g. if we have reference voltage = 5 V and our ADC is 10-bit, then on every bit we have 5 / ( 2^10 - 1 ) = 0.00489 or 5 mV, so we can't measure changes less than 5 mV.

Monday, August 18, 2014

Introduction to Pulse Width Modulation (PWM)

PWM — Pulse Width Modulation
In general it's a method of controlling analog voltage by changing digital impulses width. In other words we can change analog signal with digitall signals.


If we need to change LED brightness, we will connect it to the
variable resistor. If we need constant brightness we will compute our resistor, but still some of the power will be converted to heat on the resistor, well, it's not very efficient.

In addition we have to manually change resistance and sometimes that is impossible (RC cars).






Friday, August 15, 2014

LED matrix

I decided to play a little bit with LED matrix, so i will write what i found out.