Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help please

Status
Not open for further replies.

wowowee

New Member
happy holidays;

can anyone tell me what rcx is? the schematic in the link below shows that the receiver and transmitter is connected to rcx..

**broken link removed**

**broken link removed**
 
wowowee said:
ok.. can i use pic16f877 instead of the lego rcx? what does lego rcx do?

The RCX is a complete computer system, with various sensors and motors etc. that plug into it. There's no reason you can't use that ultrasonic sensor circuit with a PIC, but it makes sense to remove the RCX specific parts - which are all the opto-couplers etc. and the bridge rectifier circuit.

In fact, you may as well not use the 16F84 as well, and modify the software from it to use your 16F877 directly instead. In any case, you would need to modify the F84 software to feed something else rather than an RCX.
 
okay.. the ultrasonic transmitter circuit starts from the 10k potentiometer and in the left of it are the parts for the rcx, right?
i'm planning to use pic to trigger the transmitter circuit. correct me if i'm wrong, can i connect an i/o pin of a pic to pin4 of the 555 timer and gnd to pin1?
 
Yes, the four opamps are the ultrasonic receiver, with the last one as a comparator giving a logic level output. As long as the 555 is fed off the same 5V as the PIC, there should be no problem gating it via pin 4 - however, you could also generate the 40KHz directly from the PIC instead!.
 
Nigel Goodwin said:
however, you could also generate the 40KHz directly from the PIC instead!.
Yes it makes no sense using another chip to do that when it can also be done with the PIC.
 
Nigel Goodwin said:
Yes, the four opamps are the ultrasonic receiver, with the last one as a comparator giving a logic level output. As long as the 555 is fed off the same 5V as the PIC, there should be no problem gating it via pin 4 - however, you could also generate the 40KHz directly from the PIC instead!.

how do you generate 40khz from the pic? i never thought the pic can generate that much.
is it by using the pwm?
 
Last edited:
I'm not a PIC person but I assume you use the timer to produce a pulse on an output port every 25:mu:S
 
wowowee said:
how do you generate 40khz from the pic? i never thought the pic can generate that much.
is it by using the pwm?

Simply set a pin high, wait half a cycle, set it low again, wait another half cycle and set it high again - repeat for as many cycles as you need.

I cycle of 40Khz takes 25uS, and a PIC takes 1uS per instruction cycle with a 4MHz clock - so you want 12.5uS delay (which you can't do with a 1uS instruction cycle). So you can delay 12uS one half cycle, then 13uS the next, giving 25uS full cycle time and 40KHz.

With a 4MHz clock it's simple enough to do the delay with NOP's, but for a 20MHz clock it needs too many, so you can use a delay loop.

My IR tutorial shows how to do it.

Notice that even for generating 40KHz, the PIC spends the majority of it's time just wasting time! - speed is rarely an issue, as they really run quite fast.
 
Hero999 said:
I'm not a PIC person but I assume you use the timer to produce a pulse on an output port every 25:mu:S

okay thanks. i just found out that the pwm output can generate 40khz.
 
wowowee said:
okay thanks. i just found out that the pwm output can generate 40khz.

You're missing the point - by doing it in software it not only means you're not restricted to a PIC with PWM (and limited to that specific pin), it means you can produce exact numbers of cycles of 40KHz very easily.
 
Nigel Goodwin said:
You're missing the point - by doing it in software it not only means you're not restricted to a PIC with PWM (and limited to that specific pin), it means you can produce exact numbers of cycles of 40KHz very easily.

i'm sorry i can't get it, what you mean is that its upto the software?
 
Nigel Goodwin said:
Read my post above about how to do it, it's really VERY easy!.

oops.. sorry, i didn't notice it but i get it now. i'm just getting stress up because i don't know much about electronics. thanks man.
 
what will happen if two ultrasonic range meters (in the link below) face one another? i mean the ultrasonic modules will face each other. will there be any problems regarding the ultrasonic pulses? or will it work just fine?

**broken link removed**
 
wowowee said:
what will happen if two ultrasonic range meters (in the link below) face one another? i mean the ultrasonic modules will face each other. will there be any problems regarding the ultrasonic pulses? or will it work just fine?

Only if they transmit at different times - otherwise the tranmission from the other one could be mistaken for a reflection and give the wrong range.
 
Nigel Goodwin said:
Only if they transmit at different times - otherwise the tranmission from the other one could be mistaken for a reflection and give the wrong range.

okay. what if there are three ultrasonic range meters forming a triangle in which the ultrasonic modules will face the sides of the range meter. will it work?
 
Status
Not open for further replies.

Latest threads

Back
Top