Monday, February 23, 2009

Why Pullup Resistors ?

The Pull-up Resistor

This time in Very Basic Circuits, I would like to talk about pull-up resistors. The basic function of a pull-up resistor is to insure that given no other input, a circuit assumes a default value. Actually, there are two flavors of this circuit. A pull-up and a pull-down. Their function is the same, to create a default value for a circuit, but one pulls the line high, the other pulls it low.

A floating input gate. Not Good!

Consider this schematic. The gate U1A has an input (pin 1) and an output (pin 2). The input state of most logic gates is called a high impedance. This means it provides no real power of its own. Therefore, if nothing is connected to pin 1, the value of the input is considered to be floating. Most gates will float towards a high state. This is a very weak condition, and any electrical noise could cause the input to go low.

When switch S1 is closed (on), the input state at pin1 goes low. Since there is a definite connection to an electrical potential (in this case ground), the state of the pin is stable.

When switch S1 is open (off), then input pin 1 is susceptible to a wide array of electrical problems. The traces or wires connected to pin 1 may very well allow enough electrical noise in (by acting as little antennas) to cause pin 1 to incorrectly switch states. What is needed here is a way to connect pin 1 to an electrical potential that can be removed when the switch is closed. This electrical potential will allow the pin to keep a steady state.

One thought is to tie the pin to Vcc (+5 volts) to insure that pin 1 doesn't float. The circuit to the right certainly does that. With pin 1 tied directly to Vcc, the line does not float, and has an ON state.

The problem with this circuit is what happens when switch S1 is closed. This creates a direct electrical connection between Vcc and GND. In other words, it will short out the circuit. If you are lucky, it will just stop your entire system from working. If you are unlucky, it will burn up the wires!

The problem with short circuits is they allow too much current to flow from Vcc to GND. This causes heat to be generated, which can sometimes burn parts, wires, or even start fires. In addition, most circuits fail to function correctly because the voltage at the power supply drops to zero. In general, this is a bad situation!

A very bad idea!

Pull-up resistor limits the current

Now consider the next schematic, which is similar to the first but has added a pull-up resistor. This resistors function is to limit the amount of current that can flow through the circuit.

When switch S1 is open (off), pin 1 is tied to Vcc through the resistor. Since pin1 is a high impedance input, a voltage meter or logic probe placed on pin 1 will show Vcc (+5v) if connected to pin 1.

When switch S1 is closed (on), pin 1 has a direct connection to GND, which takes it to the low state. The pin1 side of R1 also has a direct connection to ground. Current will flow from Vcc, through R1, and to ground. It isn't considered a short, however, because R1 will limit the amount of current that can flow to a very small amount. In fact, you can compute this using Ohms law.

I = V / R

I = 5v / 10,000ohms

I = .0005A (.5mA)

A variation on this them is a pull-down resistor. Just like the pull-up resistor, it is used to limit the current that can flow between Vcc and ground. Though less often used, it is still a valid thing to do.

Most digital circuits use a 10k or a 47k resistor for pullups. The exact value doesn't actually matter, as long as it is high enough to prevent too much current from flowing. 10k seems to be the most common, but if you are hoping to save as much power as possible, the a 47k resistor may be right for your application. In some cases, you can go higher, but then you are depending on characteristics of the pins on the chip.

In Summary

You will find that pull-up resistors are extremely common is most digital circuits. The key function for a pull-up is to prevent input lines from floating. The key function for the resistor itself is to prevent too much current from flowing through the pull-up circuit.


Source: 

http://www.seattlerobotics.org/encoder/mar97/basics.html 

Saturday, February 14, 2009

Control Your PC Via Remote Control






Hi All ,
This is another project I made and want to share.

Description :
with the help of this project you can control your PC via a remote control (any remote control , e.g. you TV remote). Controlling the PC means you can open and close programs , Increase or decrease the Volume , showing your powerpoint presentations , switching between songs and movies .... etc, all while you are away from your PC (using your remote).
You can program the remote buttons as you want to do any selected task.

Idea:
using an infrared receiver and program the signals received from it.
the circuit connected to the PC via serial port.

Pictures :





References:

http://www.ustr.net/infrared/index.shtml

http://lnx.manoweb.com/lirc/?partType=section&partName=parts

http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.send.aspx

http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/86dcf918-0e48-40c2-88ae-0a09797db1ab

http://www.codeproject.com/KB/cs/winamparticle.aspx


Wednesday, February 11, 2009

why Linux for Embedded Systems ?

Question: Why Linux is the choice for Embedded Systems?


Answer: There are multiple reasons for choosing Linux for the Embedded Systems. Some of the reasons are given below.
Linux is based on Open source concept and it is going to be the future of embedded software. Most of the embedded systems are built using Linux as they significantly bring down the product cost simply because it is open. 

There are ample amount of tools and debugging mechanisms provided by Linux for an embedded systems developer right from the editor to memory analyzer. These tools play a major role in embedded system development as they reduce the development time. 

Linux is customizable for almost all processor architectures and it is scalable at all levels.

Question: What are the building blocks of BIG Embedded Systems from a programmer's perspective?

Question: What are the building blocks of BIG Embedded Systems from a programmer's perspective?

From a programmer's perspective there are four building blocks for any system namely
Boot-loader,
Operating system,
Device drivers
and Networking subsystem apart from the device's main functionality.

When the system gets powered up, the boot-loader is the first program that gets activated from the non-volatile memory or NVM. This boot loader will vary from one system to another, because it mainly depends on the way system is configured. This boot loader will in turn revoke the operating system by calling its entry point, which in-turn initializes various operating system services (memory, tasks, scheduler etc...).

Once the operating system services are initialized, all the low level device drivers followed by other subsystems (like networking) are brought up. At this point we can say that the platform is built for the system. After this initialization is complete, the system would be in a position to perform its expected functionality. This functionality will vary from device to device as each system is built for a different purpose. Say for example a router's main functionality would be to route the packets but a microcontroller's functionality may be measuring the temperature using a sensor. Finally functionality programming is the main core of embedded system which requires a powerful programming skill.

What kind of boards and hardware experience one should learn ?

Question: What kind of boards and hardware experience one should learn to get experience in Embedded Systems?

Answer: To start with, Micro controller based boards are good ones to learn the board level programming. After that one need to get hands on experience in boards like : PIC, Mechatronic and ARM board. If an engineer get an opportunity to work on customized boards, which are used in live projects it would be really useful to get a good knowledge.

How Embedded Systems programming is different ?

Question: How Embedded Systems programming is different from normal programming? What are the technical challenges involved?

Answer: Even though embedded systems vary in various functionalities, the programming fundamentals remain almost the same. The challenges in embedded systems programming is because of the following reasons.
Embedded systems have very limited resources (in terms of memory, storage, processing power) compared to a general purpose computing device like PC.

Because of the less memory availability and requirement of faster response, embedded systems have Real Time Operating Systems (RTOS). These RTOS have flat memory model where all processes in the system run under the same memory space. This will lead to lot of memory corruption and inter process communication errors. Debugging these errors are really challenging.

Embedded systems have a pre-defined performance requirements and response time.

Since the embedded software will be running in a dedicated hardware, troubleshooting them requires strong system level understanding and debugging skills.

more about flat memory model here

What are Embedded Systems?

Question: What are Embedded Systems?

An embedded system
is a special-purpose system which performs a specific task with its own hardware. The embedded system is different from a general purpose computing devices (Like PC) because of its size, functionality and resources. Since the system is dedicated to specific tasks, design engineers can optimize it by reducing the size and cost of the product to a larger extent which requires good designing skills. Embedded systems are often mass-produced; in order to have cost savings multiplied by millions of items.
Physically, embedded systems range from portable consumer devices (such as MP3 players, PDA's, Mobile phones, gaming devices) to large Enterprise products (such as Enterprise routers, Networking switches and Industrial automation systems). From an engineering point of view embedded systems development is very different from an application development.

another Definition:

An embedded system is some combination of computer hardware and software, either fixed in capability or programmable, that is specifically designed for a particular kind of application device. Industrial machines, automobiles, medical equipment, cameras, household appliances, airplanes, vending machines, and toys (as well as the more obvious cellular phone and PDA) are among the myriad possible hosts of an embedded system. Embedded systems that are programmable are provided with a programming interface, and embedded systems programming is a specialized occupation.Usually a low power consumption CPU with a limited amount of memory is used in embedded Systems

Certain operating systems or language platforms are tailored for the embedded market, such as EmbeddedJava , Embedded C, Windows XP Embedded and
Embedded Linux.
However, some low-end consumer products use very inexpensive microprocessors and limited storage, with the application and operating system both part of a single program. The program is written permanently into the system's memory in this case, rather than being loaded into RAM (random access memory) like programs on a personal computer.

source:http://searchenterpriselinux.techtarget.com/sDefinition/0,,sid39_gci837507,00.html

Electronics Helpful Websites

Welcome to the Electronics Club

Link : http://www.kpsec.freeuk.com/index.htm
My Rating : Excellent
Description :-
Helps IN :
If you are Looking for Tutorial That help You in the following

- How To Solder and How to build electronic circuits and understanding circuits diagrams
- Contain excellent explanation to some electronic components and how to connect and test them such as Resistors ,Capacitors , transistors , relays , switches ,LEDs

- Contain explained projects that make you practice
such as Drive a LED , Traffic light generator , dice , and more here

----------------------------------------------------------------------

Understanding Electronics Components
link : http://www.mikroe.com/en/books/keu/00.ht

Description :-
teaches the basic components and how the are used in circuits starting with resistors till transistors and ICs and other components like speakers and microphones .It also include some practical circuits using these components

Helps IN:
If you want t to start electronics fast without going into more details ,laws, calculations and so on .
it also helps as a revision if you studied electronics before and want to revise basics in a fast way.

added: 20-8-2008


-------------------------------------------------------------------------------------------

doctronics Educational Publishing for Design & Technology

http://www.doctronics.co.uk


Configure Eclipse to work with C++ and QT

Hi All ,
I Just wanted to provide a guide tutorial to help you for the start up configuration to write GUI apps in C++ using QT library and Eclipse IDE.

note:

Thses configurations done using : eclipse ganymede SR1 and OpenSource QT 4.4.3 . You can Map it easly for any other version .



Steps:


Step1: Setup Eclipse To Be a C++ IDE Envieonment


- download eclipse here

- inside Eclipse

-- Go to help menu and choose softwareupdates

-- select Eclipse C/C++ development platform / tools

swupdates



-- This Step is to Install and configure The CDT (C/C++ Development Tools). The CDT is Nedded to provides a fully functional C and C++ IDE for the Eclipse platform .

Click update and wait for installation to finish.

-- after finishing , you may restart your PC if u asked to do so.

Step2 : QT configuration


1- download QT , here

2- install it and during installation you may be asked to install MinGW (gcc),this is the C/C++ compiler. Download and nstall it if you already don't have it installed.

3- build it . Go to start Menu and choose QT > QT command prompt

- write the command "configure" and press Enter .

- Wait for the configuration process to be done. (don't be in hurry , it takes 15-30 minutes).

- after finish ,you will be informed that Qt is configured for building and asked to write the command "mingw32-make" to build it.

- Wait for the building process , it takes about 1-2 hours according to your PC capabilities.

after finish , close the command Prompt.

Now , You have a fully functional C++ IDE (Eclipse ) and you may Test the configuration by starting a new c++ project and compile and run it .

You also Have the QT library installed and built.

step3: integrate QT with Eclipse

1- download QT Eclipse integration here

2- install it in your System and during installation you will be asked to set the Eclipse path . Browse the file system and select the eclipse path in ur hard drive.

3- To start working , open QT eclipse integration from the path you installed it or from start menu > all programs >QT Eclipse integration and choose

start Eclipse with MinGW




Done.

Inside Eclipse , click File menu > New > other ( or press CTRL + N) and select QT as the project type and start

filenewothr


qtpro



click Next .. and start coding ;) .



Any correction are welcomed.

good luck

Time Delay C#

If you want to make a time delay in C# (Pause your program for any purpose) you may use this line

System.Threading.Thread.Sleep(timeinmillisecond);

and if you have a problem with the interface or controls update you may need to add this small line

this.Refresh();

good luck

How to configure QT with V.S.2005

youtube Video tutorials shows how to configure QT library to work with visual studio 2005 with example.

1-

http://www.youtube.com/watch?v=5mswLcSOh-w

2-
http://www.youtube.com/watchv=7mNCU9zAF0A&feature=related
3-
http://www.youtube.com/watchv=ILBYNde225Y&feature=related
4-
http://www.youtube.com/watch?v=fXrbqIBJWfU&feature=related
5-
http://www.youtube.com/watch?v=dc3VCL4FUis&feature=related

QT Tutorials

Start Learning QT : (check the following links)

1- How To Learn QT (have a look)

2-Tutorial 1 (coding by hand with out designer help)

3-Using Designer

4- address book tutorial



all found here



I will post here tutorials I find regulary .