![]() | ![]() | ![]() |
| | |||||||
| 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? |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| 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!!! | |
| |
| | (permalink) |
| 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
__________________ search engine for electronic partsJunebug USB PIC programmer kit., USB Bit Wacker, 3v0's Homepage The 15 Minute Printed Circuit Board! (+drill time) Last edited by 3v0; 6th June 2008 at 10:27 AM. | |
| |
| | (permalink) |
| 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??) | |
| |
| | (permalink) | ||
| First please not not send me email asking me to respond to a post. Quote:
Quote:
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.
__________________ search engine for electronic partsJunebug USB PIC programmer kit., USB Bit Wacker, 3v0's Homepage The 15 Minute Printed Circuit Board! (+drill time) | |||
| |
| | (permalink) |
| 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.... | |
| |
| | (permalink) |
| 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.
__________________ search engine for electronic partsJunebug USB PIC programmer kit., USB Bit Wacker, 3v0's Homepage The 15 Minute Printed Circuit Board! (+drill time) | |
| |
| | (permalink) |
| thanks a lot..... | |
| |
| | (permalink) |
| 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." | |
| |
| | (permalink) |
| @ sceadwian what happens if we give an voltage which is outside these limits??? | |
| |
| | (permalink) |
| somebody please reply... | |
| |
| | (permalink) |
| 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. | |
| |
| | (permalink) |
| 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. | |
| |
| | (permalink) | |
| Quote:
__________________ "Remember, you're special.....just like everyone else." | ||
| |
| | (permalink) | |
| Quote:
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). | ||
| |
| | (permalink) |
| 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... | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| 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 |