Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: pete2009 on June 24, 2009, 12:20:04 PM

Title: Digital vs Analog inputs
Post by: pete2009 on June 24, 2009, 12:20:04 PM
I see most board provide a ton of digital and only a few analog inputs. I have a proble there. Collision sensors, photo diodes and similar devices have analog outs.
Why is the digital more popular then?

Title: Re: Digital vs Analog inputs
Post by: RoboChan on June 24, 2009, 12:24:43 PM
Can't you use digital as analog??
Title: Re: Digital vs Analog inputs
Post by: pete2009 on June 24, 2009, 12:28:17 PM
Hi,

While I don't know the answer to that question, I stand corrected on my initial assumption. There are a few rangefinders there with a digital connection.
Title: Re: Digital vs Analog inputs
Post by: chelmi on June 24, 2009, 12:30:24 PM
Digital input are quite simple; but analog inputs are far more complex and take a lot of space on the chip.

If you need more analog inputs, look at analog multiplexer or external ADC like this one http://cds.linear.com/docs/Datasheet/2309fb.pdf (http://cds.linear.com/docs/Datasheet/2309fb.pdf) or this one http://www.analog.com/static/imported-files/Data_Sheets/AD7992.pdf (http://www.analog.com/static/imported-files/Data_Sheets/AD7992.pdf)

Can't you use digital as analog??

Unless you meant to use them to access external DAC, I don't see how it is possible. Analog inputs can often be configured as regular digital I/O, in this case the analog/digital converter is completely bypassed.

Hi,

While I don't know the answer to that question, I stand corrected on my initial assumption. There are a few rangefinders there with a digital connection.

Digital rangefinders have a digital (!!!) output. They have a predefined range and outputs a 1 (or 0 I don't remember) when they sense an object in this range. You cannot get the actual distance of the object though, as opposed to analog rangefinders.
Title: Re: Digital vs Analog inputs
Post by: BEAMer on June 25, 2009, 07:30:32 AM
hi,

Quote
Digital input are quite simple; but analog inputs are far more complex and take a lot of space on the chip.


i totally agree with chelmi.....

If you need more analog inputs, you can use multiplexers.

But if you are using collision sensors and obstacle detectors, you don't need continuous measurement of the voltage. you just need to know when you are about to hit the obstacle! so generally we use comparators. They give you digital outputs, compatible with the controller boards. so you don't have to worry much!


Title: Re: Digital vs Analog inputs
Post by: BEAMer on June 25, 2009, 07:34:57 AM
A comparator will give a 'high' or a 'low' output when the input voltage crosses a fixed reference value. there are lots of ready made comparator chips available.

More over, there are lots of microcontrollers with built in comparator modules (Eg: PIC16F877A). this can reduce your hardware........
Title: Re: Digital vs Analog inputs
Post by: Soeren on June 26, 2009, 05:35:16 PM
Hi,

Can't you use digital as analog??
Yes, in several ways, but the one I would recommend you for real analog (i.e. not just a comparator or a compare register), is a V/F converter (V/F = Voltage to Frequency) - then you just measure the frequency of the signal and multiply the number with a constant.
Title: Re: Digital vs Analog inputs
Post by: BEAMer on June 27, 2009, 07:52:38 AM
oh.... thats a good idea.  But how do i convert a voltage into a signal with varying frequency? by using a tank circuit or something?
Title: Re: Digital vs Analog inputs
Post by: TrickyNekro on June 27, 2009, 04:09:37 PM
most common example..... NE555....

But there are many specialized IC's for that....