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!.
thanks for the circuit.. i would like to ask if i can use breadboard instead of the easypic4 board? because i don't think it's available in our place..
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!.
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.
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.
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.
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?
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?
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?