Shop OBEX P1 Docs P2 Docs Learn Events
Robox OJ-CG303 IR Obstacle Avoidance Sensor Module Questions — Parallax Forums

Robox OJ-CG303 IR Obstacle Avoidance Sensor Module Questions

kd8bxpkd8bxp Posts: 14
edited 2012-09-12 13:41 in BASIC Stamp
Good Afternoon Forum! :-)

This is my first post to the forums, but I have been reading and getting great ideas for my project! I am converting a "Electric Chariot" (they are the "cheap" FAKE Segways, that don't have stablization, and have 4 wheels) anyways, I'm converting one to a robotic lawn mower, got most of it working, not quite the why I want it yet...but close enough to move on to the next part of the project. I'd like to add a "drop" or "cliff" sensor to it, something like how the Roomba's know they are near stairs. Roomba's use IR and I figured that would be the way to go. At frist I was looking at using the Sharp GP2Y0A21 - but that uses an analog voltage, and would need to be converted, so I found a Robox OJ-CG303 IR Obstacle Avoidance Sensor module on eBay the problem is I can't find any information about it, the listing says it's digital, and lists the VCC/GND/DATA as being the 3 pins on the device. The picture of the device has a website of openjumper.com, that was less then helpful for me, I beleive the site is all in Chinese? So after doing quite a bit of searching on google and coming up with nothing, I decided it beter to jet ask if anyone has used this sensor, if they have used it how well did it work. I am hoping it would work something like the PING))) sensor or something like that, but not finding anything out about it I don't know what info it sends back to the microcontrol or if it needs some special "command" to even work at all.
And yes, I was looking at just the price of this device, so if someone knows of a better way to do what I'm wanting to do for just as little (under $5 US) please let me know that as well! :-)

Any info about this device will be helpful, and anyone who has used it and wants to share the code would even be better :-)

Thanks, LeRoy KD8BXP

Comments

  • kd8bxpkd8bxp Posts: 14
    edited 2012-09-02 06:03
    I guess no one is using or has used these IR Sensors?
    I went ahead and ordered a couple of them, should be here in a couple of weeks, so I'll report back as to what I find out about them, and if they are useable or not.

    Thanks, LeRoy, KD8BXP
  • ercoerco Posts: 20,256
    edited 2012-09-02 15:49
    http://www.ebay.com/itm/New-Arduino-Robot-Infrared-Ray-IR-Sensor-Module-Obstacle-Avoidance-Detector-/150883065223

    Looks to be a 38 kHz IR receiver and an IR LED combo sensor. Nothing you couldn't make yourself, or build two of in the BoeBot course. It's an on/off sensor that will either detect an IR reflection or not. Its reliability and range will depend mightily on the color and reflectivity of the object. The Sharp sensor your mentioned is vastly superior, even though you need an ADC to read it. It will give you an analog measurement which can yield an actual distance measurement, much more useful than the yes/no answer your sensor will give you. And the Sharp sensor doesn't care (much) about object color & reflectivity.

    Any IR sensor will be useless outdoors in full sunlight, but you knew that. Ultrasonic sensors (PING, SRF04, etc) are far better outdoors.

    http://www.parallax.com/dl/docs/prod/acc/SharpGP2D12Snrs.pdf Sharp Appnote
    http://www.junun.org/MarkIII/Info.jsp?item=73 Cheap Sharp Sensors
  • kd8bxpkd8bxp Posts: 14
    edited 2012-09-02 16:07
    erco wrote: »
    http://www.ebay.com/itm/New-Arduino-Robot-Infrared-Ray-IR-Sensor-Module-Obstacle-Avoidance-Detector-/150883065223

    Looks to be a 38 kHz IR receiver and an IR LED combo sensor. Nothing you couldn't make yourself, or build two of in the BoeBot course. It's an on/off sensor that will either detect an IR reflection or not. Its reliability and range will depend mightily on the color and reflectivity of the object. The Sharp sensor your mentioned is vastly superior, even though you need an ADC to read it. It will give you an analog measurement which can yield an actual distance measurement, much more useful than the yes/no answer your sensor will give you. And the Sharp sensor doesn't care (much) about object color & reflectivity.

    Any IR sensor will be useless outdoors in full sunlight, but you knew that. Ultrasonic sensors (PING, SRF04, etc) are far better outdoors.

    http://www.parallax.com/dl/docs/prod/acc/SharpGP2D12Snrs.pdf Sharp Appnote
    http://www.junun.org/MarkIII/Info.jsp?item=73 Cheap Sharp Sensors

    My thoughts was to enclose it in a dark tube, and point it more or less straight at the ground (Have it float just above the ground) and put it on the very bottom underside of the bot hopefully keeping the light out (?), but yes I knew in full day light they would be almost useless outside. I do think I will need to add a 2nd PING sensor, my partner doesn't like this idea and thinks I just need to move the ping sensor I have very high and point it more toward the ground, I think it will not beable to "see" far and will need to move very slow...then again, the stamp doesn't seem to be fast enough to keep up with the wheels now, so slow is probably better. I don't know, may try both ways and see what is better.

    The cheap IR I did order, as far as I what I want to do a simple on/off state will work, even in a dark tube thou I'm not sure how well they will work, and may need to come to a small inside robot :-)

    The other thing I am running into, I am quickly running out of pins, and I am looking at adding a 2nd stamp now, there are quite a few other sensors I would like to add to this and I'm down to 4 pins left I beleive. Before any of that happens thou I really just need to get the basic robot working :-)

    Have you used the OJ-CG303 before?

    Thanks for the info, LeRoy KD8BXP
  • ercoerco Posts: 20,256
    edited 2012-09-02 17:44
    kd8bxp wrote: »
    The other thing I am running into, I am quickly running out of pins, and I am looking at adding a 2nd stamp now,
    Have you used the OJ-CG303 before?
    Welcome to robotics! Everyone needs more pins.

    No, never used or seen that sensor before, just Googled it.
  • kd8bxpkd8bxp Posts: 14
    edited 2012-09-04 17:02
    asked the eBay sellers yesterday if they had any documention for the OJ-CG303, they directed me to http://www.arduino.cn/forum.php?mod=viewthread&tid=1149 and google translate was able to translate most of it, they said they would send me detailed instructions in the next day or so (Hope it's not in Chinese!)

    Anyways, I don't know much about the arduinos, but it looks like it's a serial device, and does act as a on/off switch...so hopefully it will be pretty easy to use. Someone that knows a bit more about Arduino C might beable to help get a working code for the Basic Stamp 2

    LeRoy, KD8BXP
  • ercoerco Posts: 20,256
    edited 2012-09-04 21:37
    Not serial, just digital high/low. Read it with a simple IF inx=0 command.
  • kd8bxpkd8bxp Posts: 14
    edited 2012-09-05 05:57
    erco wrote: »
    Not serial, just digital high/low. Read it with a simple IF inx=0 command.


    Sounds great!, and that is what you thought it was to start with :-) When it finally gets here I'll report back how it worked.

    LeRoy, KD8BXP
  • kd8bxpkd8bxp Posts: 14
    edited 2012-09-12 13:41
    Got the sensor today, I never did get the "extended" data sheet from the seller, and probably will have to ask again for that, but, don't know if I will really need it, because @erco was correct,
    if inx = 0 works just fine, and works for what I want the sensor to do.

    I build just a simple "This is Zero" , "This is One" program,just to see what the states of it were, and was quite surprise that when I took it outside (bright daylight) and with no shield around it, it worked just fine.

    It has a 555 timer on it, and red/green LED.
    if the led is RED it sees something, if it's green it doesn' see anything, not too sure what the 555 is doing, unless it's just timing the pulses of the IR...it also has what looks like 6 or 7 surface mount resistors, and 3 surface mount caps. and 1 variable resistor, I haven't messed with the variable resistor, it seems just fine to me. So not sure if it is a distance thing or if it's a sentivity thing.

    I am still planning on putting it in a dark tube, but quite happy that it worked as well as it did outside

    LeRoy, KD8BXP
Sign In or Register to comment.