Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
LinkBack Thread Tools Display Modes
Old 6th June 2008, 10:19 AM   (permalink)
Default Most Basic Doubt Of Digital Electronics!!!

how do we give a digital 1 or 0 to a wire..(does giving a wire 5v makes it digitally 1 and giving 0v makes it digitally 0??)
suppose i have four input wires connected to a microcontroller giving following inputs:
1st wire : 5volt
2nd wire : 0 volt
3rd wire : 3 volt
4th wire : -3 volts
are these inputs analog or digital??
if they are analog then how do we give a digital input??
if they are digital inputs then which of them would be 1 and which would be zero??
please do not ignore my question thinking it to be too basic!!! i have searched from winki..to google to get my answer but couldnt get it...
thanks!!!
tech_vaibhav_eee is offline  
Old 6th June 2008, 10:25 AM   (permalink)
Default

A voltage is always a analog value. For convience we choose to view/use it as a digital value/signal by saying a voltages between A and B are a ONE and between C and D are ZERO.

So if we put a voltage between A and B on a wire and hook it to a digitial input it will show up as a 1.

The voltage level for zero and 1 are defined by the logic family (chips) you are working with.

HTH

Last edited by 3v0; 6th June 2008 at 10:27 AM.
3v0 is online now  
Old 6th June 2008, 10:37 AM   (permalink)
Default

Thanks !!
If I Am Giving A Digital Input To A Microcontroller, How Do I Decide Whether I Have Do Give It 5v, 3v Or Any Other Voltage To Make The Input Digitally 1..(is It Decided By The Programming Code Given To That Microcontroller??)
Also Suppose 5volts Represents Digital 1, Then How Would The Microcontroller Respond To Any Other Voltage?? (i Mean Will The Voltage Like 3volt Would Be Any Analog Value For The Microcontroller??)
tech_vaibhav_eee is offline  
Old 6th June 2008, 10:51 AM   (permalink)
Default

First please not not send me email asking me to respond to a post.

Quote:
Originally Posted by tech_vaibhav_eee View Post
Thanks !!
If I Am Giving A Digital Input To A Microcontroller, How Do I Decide Whether I Have Do Give It 5v, 3v Or Any Other Voltage To Make The Input Digitally 1..(is It Decided By The Programming Code Given To That Microcontroller??)
Also Suppose 5volts Represents Digital 1, Then How Would The Microcontroller Respond To Any Other Voltage?? (i Mean Will The Voltage Like 3volt Would Be Any Analog Value For The Microcontroller??)
As I said
Quote:
So if we put a voltage between A and B on a wire and hook it to a digitial input it will show up as a 1.

The voltage levels (A,B,C,D in above quote) for zero and one are defined by the logic family (chips) you are working with.
First you have to know what logic family you are working with. That tells you what the upper and lower limits (ABCD) are for 1 and 0.

The micro controller does not use code to determine the value of a digital input. It is done in hardware.

A digitial input expects voltages to fall in the 0 or 1 range. I do not recall what happens when it does not. I expect that it depends on the logic family.

Try googling for info to read on the subject.
3v0 is online now  
Old 6th June 2008, 11:43 AM   (permalink)
Default

sorry for the email!!
ur reply was very useful...can u clear my just one more doubt:
now if i have to make a line follower, can i do the following:
i will use a ir sensor which gives an output voltage of about 1.7v when ir rays falls on it... i will connect this output to an opamp which will convert 1.7v into a higher voltage lying between the limits of digital 1(say 3v...).....this output of 3v will be given to a digital input pin of a microcontroller which will read it as 1...(i am talking about just 1 of the sensors right now)
now i have two doubts after this:
1)can we use a comparator instead of using a opamp??
2)how does the microcontroller controls the motor driver using theseinputs?
also, please correct me wherever i am wrong with the working given above....
tech_vaibhav_eee is offline  
Old 6th June 2008, 12:48 PM   (permalink)
Default

There are several ways you can read a sensor.

If you have a sensor that puts out 1.5V when active you can use an op-amp to amplify the voltage so that when the sensor is 1.5V the opamp will output 5V. That can be read by a micro controller digital input.

It is also possible to connect the sensor to a comparator. If you setup the comparator right the comparator will output a one when the sensor is at 1.5.


You could also hook the sensor to a micro controller analog input and read the voltage. When the voltage is at about 1.5V you know the sensor is active.

Motors are controlled using digital outputs. The micro controller outputs do not provide enough current to run a motor. So the outputs are used to switch transistors which actually drive the motor. If you want the motor to reverse you need to use a H-Bridge. If you want variable speed you use PWM (Pulse width modulation). Many times we use both to get variable speed and direction control.
PWM is often done inside the micro controller. The H-Bridge is a separate board or chip.

Again time to google.
3v0 is online now  
Old 6th June 2008, 03:34 PM   (permalink)
Default

thanks a lot.....
tech_vaibhav_eee is offline  
Old 6th June 2008, 10:36 PM   (permalink)
Default

Check the specifications for the micro controller you're using, it will list the voltage required to trigger a state change on it's I/O lines. Just as an example the tiny11 AVRs that I use will read any voltage bellow .3 volts as a digital 0 and any voltage above 3 volts as a 1.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is offline  
Old 7th June 2008, 06:27 AM   (permalink)
Default

@ sceadwian
what happens if we give an voltage which is outside these limits???
tech_vaibhav_eee is offline  
Old 7th June 2008, 10:47 AM   (permalink)
Default

somebody please reply...
tech_vaibhav_eee is offline  
Old 7th June 2008, 06:21 PM   (permalink)
Default

Input pins on a digital IC have protection diodes. If you are running 0 and 5V logic, then the diodes start to kick in at 5.3V and -0.3V typically. They can only handle so much current, so if you give them too much current they blow and you've damaged that input pin.
speakerguy79 is offline  
Old 17th August 2008, 09:40 PM   (permalink)
Default

this next question of mine may sound very stupid..but please help me with it..
in many of the replies i read u people talking about current given to the pins of the chips...but frm what i understand only a voltage is given to a pin..say 5v or 3v..so how does a current flows to the pin when there is no potential difference??
for example the following lines...

Input pins on a digital IC have protection diodes. If you are running 0 and 5V logic, then the diodes start to kick in at 5.3V and -0.3V typically. They can only handle so much current, so if you give them too much current they blow and you've damaged that input pin.
tech_vaibhav_eee is offline  
Old 18th August 2008, 02:25 AM   (permalink)
Default

Quote:
Originally Posted by tech_vaibhav_eee View Post
this next question of mine may sound very stupid..but please help me with it..
in many of the replies i read u people talking about current given to the pins of the chips...but frm what i understand only a voltage is given to a pin..say 5v or 3v..so how does a current flows to the pin when there is no potential difference??
for example the following lines...

Input pins on a digital IC have protection diodes. If you are running 0 and 5V logic, then the diodes start to kick in at 5.3V and -0.3V typically. They can only handle so much current, so if you give them too much current they blow and you've damaged that input pin.
What speakerguy79 was referring to was providing to high (>5V) or too low (<-0.3V) a voltage to the inputs. By providing a higher (or lower) voltage, you thereby increase the current flow through the protection diodes, which could damage them if it's excessive. The negative swing of the input voltage is typically caused by over-shoot from the switching waveform. Transients can also cause this.
__________________
"Remember, you're special.....just like everyone else."
rezer is offline  
Old 18th August 2008, 03:08 AM   (permalink)
Default

Quote:
Originally Posted by tech_vaibhav_eee View Post
so how does a current flows to the pin when there is no potential difference??
For TTL logic, the Thevenin Equivalent circuit you would see if you looked into a logic input may be
a high value resistor in series with a voltage source,
this voltage being the threshold at which a 1 or 0 is decided.
Current will flow into or out of a logic pin depending on the voltage you put in.

Old books on TTL circuitry spent some pages modelling this equivalent input circuit.

You can find the value of the Thevenin equivalent voltage by measuring the voltage on a floating logic pin (except for CMOS; the equiv. circ. for this is a small current source).
Willbe is offline  
Old 18th August 2008, 03:46 AM   (permalink)
Default

thanks 4 replies..
k.. i am basically working on a line follower project ...i read that the microcontroller runs on very small current and and this much current cant run a dc motor...so we have to increase the value of current..how do we do that...(can l293d do this for me??)...andwhy do we worry about current in the first place?? shouldnt we just keep the voltage given to the pins in their desired range and the current will take care of itself??
please help me out..i m really confused...
tech_vaibhav_eee is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Book suggestion, basic electronics edeca General Electronics Chat 12 26th June 2008 07:41 AM
very basic electronics for student jumides General Electronics Chat 3 2nd February 2008 02:34 PM
What is a good book for basic electronics? Souper man General Electronics Chat 9 18th May 2007 09:57 AM
basic electronics question Super Mario General Electronics Chat 5 11th December 2003 05:43 AM
What basic electronics book do you recommend :)) Super Mario General Electronics Chat 3 1st November 2003 06:23 PM



All times are GMT. The time now is 04:17 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker