Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: roboSonny on December 02, 2010, 03:21:59 PM

Title: sensors,digital or analog interface?
Post by: roboSonny on December 02, 2010, 03:21:59 PM
what is easier to program and work with?an analog or a digital interface sensor?
Title: Re: sensors,digital or analog interface?
Post by: UAE on December 04, 2010, 11:09:50 AM
Well it depends on the sensor and the microcontrollers ur using

for an example, if you are using an arduino there is a built-in function for reading analog values and this will make your life easier. On the other hand, if you are using a pic18f4520 you will have to write a function by changing different values of registers and could take you an extra few lines.

In general, the digital sensor is easier to use but it only can provide you with two values (0 and 1). Some times they use different kind of pulses to interpret different data.
 
On the other hand, the analog sensor will give you only one value that can be interpreted into more detailed information.

It is difficult to answer your question without details, it depends
Title: Re: sensors,digital or analog interface?
Post by: roboSonny on December 04, 2010, 01:24:03 PM
i intend to use axon.
Title: Re: sensors,digital or analog interface?
Post by: Soeren on December 04, 2010, 09:17:06 PM
Hi,

In general, the digital sensor is easier to use but it only can provide you with two values (0 and 1). Some times they use different kind of pulses to interpret different data.
Like a serial protocol that can give you any number of bits you need.

Analog or digital... Usually you need to use what the sensor provides, so better learn to deal with both.
Title: Re: sensors,digital or analog interface?
Post by: UAE on December 05, 2010, 03:00:05 AM
If you are using axon, I would say programming the analog sensor is easier

it is as simple as: analogRead(Sensor);
 or you could use it as a condition if(analogRead(Sensor)<30) StopMotor();

for the digital you might have to write a function to interpret its values

but the number of cycles and the time taken could be more in the analog(depending on the type of sensor)

and you should learn how to use both
Title: Re: sensors,digital or analog interface?
Post by: roboSonny on December 05, 2010, 05:02:21 AM
thanks for the help!