Maxbotic Ultrasonic sensor how to control?

Digital Fiber, Photoelectric, Laser Range, Optical, Temperature, Rotary Encoder, Ultrasonic, Gas, Gyro, Accelerometer, FlexiBend, Flexiforce, Compass......

Re: Maxbotic Ultrasonic sensor how to control?

Postby ober » Sat Mar 20, 2010 2:08 pm

Good to hear that.

In that case, you will need to configure the Pin and PWM output and change the duty cycle. But I am assuming PWM is being used for motor speed control, so you do not have any more PWM port.

Anyway, to get analog output, you can apply simple RC low pass filter. A resistor and capacitor will do.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: Maxbotic Ultrasonic sensor how to control?

Postby Light » Tue Mar 23, 2010 9:52 am

ober WROTE:Good to hear that.

In that case, you will need to configure the Pin and PWM output and change the duty cycle. But I am assuming PWM is being used for motor speed control, so you do not have any more PWM port.

Anyway, to get analog output, you can apply simple RC low pass filter. A resistor and capacitor will do.


can you give me more details on why i can't use PWM output ? i still got CCP1 and CCP2...haven't used them yet as you can see from the code.

and lets say i want to use RC to get analog output.......all i have to do is send the distance value a any output pin and then connect the RC circuit to that pin ? is that how it is done or more programming is needed ?

thank you
Light
Novice
 
Posts: 19
Joined: Wed Dec 02, 2009 2:57 am

Re: Maxbotic Ultrasonic sensor how to control?

Postby Light » Thu Mar 25, 2010 3:30 pm

any answer ?
Light
Novice
 
Posts: 19
Joined: Wed Dec 02, 2009 2:57 am

Re: Maxbotic Ultrasonic sensor how to control?

Postby ober » Fri Mar 26, 2010 11:58 am

You can still refer to PR23 sample source code, it uses PWM to control the speed of motor. I am expecting you should know how to connect a RC (resistor and capacitor) circuit to obtain simple low pass filter. You will need to play with the frequency and RC value to get a good analog output.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: Maxbotic Ultrasonic sensor how to control?

Postby luqman hakim » Sat May 01, 2010 6:10 pm

what does mean this notation...
from PR23 source code..
//max vslue 2.55v = 2.55/5 *1024 - 1 = 522, resolution = 10mV/ inch, 10m/5*1024 =~ 2

i supplied my sonar sensor 5.0 V... so by follow the scaling factor Vcc/512..
the value is 5V/512 = 9.76mV per inch..
luqman hakim
Newbie
 
Posts: 11
Joined: Wed Jul 01, 2009 3:49 pm

Re: Maxbotic Ultrasonic sensor how to control?

Postby ober » Tue May 04, 2010 9:16 am

luqman hakim WROTE:what does mean this notation...
from PR23 source code..
//max vslue 2.55v = 2.55/5 *1024 - 1 = 522, resolution = 10mV/ inch, 10m/5*1024 =~ 2

i supplied my sonar sensor 5.0 V... so by follow the scaling factor Vcc/512..
the value is 5V/512 = 9.76mV per inch..


The calculation is based on max output voltage from sensor, not the supply voltage of sensor. If you supply with 5V, the max output voltage will still remain 2.55V as stated in the sensor data sheet.

And I do not see the scaling factor of Vcc/512 in the formula given, where did you get this? Especially 512......
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Previous

Return to Sensor

Who is online

Users browsing this forum: No registered users and 11 guests

cron