Shop OBEX P1 Docs P2 Docs Learn Events
What's your input to this Sensor Project? — Parallax Forums

What's your input to this Sensor Project?

th1961th1961 Posts: 6
edited 2007-02-01 12:13 in General Discussion
Hello everyone,

I am trying to introduce electronics to my two sons (& myself) by building a fun project with them. You guys have some great projects that you are dicussing and I heard this is the Best place to start, so we are hoping you can give us some direction. I did come across this web page on infrared train detection·( http://www.mrollins.com/irled.html ). The gentleman contacted me and said that his solution will Not work because the IR is not sensitive enough. I've never done this type of thing before, I'm not an engineer,··I do have some technical skills. I am a web developer and I did programming in RPG II for the IBM AS/400 for about 10 years; so it's a learning experience for me as well.·

Are you familiar with table hockey? Here is a link to what the game looks like:
http://zebtech.com/th/photelectric-sensor-diagram.jpg

Here is an overview of what we want to do:

THE ISSUE:
When playing table hockey, sometimes the little 1 inch diameter puck goes into the net and bounces out so fast that sometimes we are not sure if the puck went into the net or not.· The red goal you see in the picture is about 3 inches high by 4 inches wide.

THE SOLUTION:
When the little black puck fully crosses the red goal line and goes into the goal net, we would like to turn on a red light for 4 seconds indicating that a goal was scored. I don't think this can be acheived with one sensor, but a series of sensors that create a "curtain" across the entire opening of the goal. When just one of these sensors are tripped I want to turn on the red light. *A special note, the puck cannot be modified in any way.*

Here are some "Mock-Up photos" of how it might work:
http://zebtech.com/th/mock-up1a.jpg
http://zebtech.com/th/mock-up2a.jpg

I'm thinking we can achieve this by using infrared beams or photoelectric sensors. We've searched on the Internet and have come up with nothing. Of couse I'm not sure what I'm looking for.· Can you please help us.

Thank you in advance for your time.

Sincerely,
Dad

Comments

  • JonnyMacJonnyMac Posts: 8,940
    edited 2007-01-25 20:30
    What about using a single sensor per net that can't be crossed until the puck is all the way in? If you can get a low going sensor then it could be fed into the trigger pin of a 555 configured as a one-shot that lights the scoring light. Pretty easy, really. Since you're new to electronics, let me [noparse][[/noparse]strongly] recommend "Getting Started In Electronics" by Forrest M. Mims.

    Of course, if you decide to go the microcontroller route, I'd suggest the SX28 from Parallax. You could use PORTB interrupts to monitor the detection and display the appropriate light; heck, you could even have the SX keep track of the score.

    Post Edited (JonnyMac) : 1/25/2007 8:52:35 PM GMT
    600 x 285 - 7K
  • metron9metron9 Posts: 1,100
    edited 2007-01-25 22:04
    I would think you could use an array of sensors like you have shown you may need to use sensors you can bias or a strong light from above the net. Wire NPN photo transistors in series so they are all on when the light is on. When the puck covers one of them the power will go off so you need a hex inverter and then wire that to a simple RC circuit using a capacitor and resistor combination that will hold the gate on a transistor or fet open for the required time. The power to your light will flow through the fet.

    Power
    IRSENSORs
    HEXFET
    Restor/capacitor---gate of Mosfet
    LIGHT

    Cant draw a schematic now but if you need one I can do it later tonight.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • th1961th1961 Posts: 6
    edited 2007-01-26 02:53
    JohnnyMac and metron9,

    Thank you so much for the help.·This is GREAT! ·I did buy·the Radio Shack Electronic Sensor Lab Kit a month ago·from someone and it does have the "Electronic Sensor Lab Workbook" by Forest Mims III (Copyright 2001).

    Metron9 you are correct, because the puck can be lifted in the upper left and right corners, there has to be what I call a "full curtain" of sensor area, from top to bottom, side to side. I would really apppreciate it if you can draw a schematic. Thank you in advance for your time.

    ·
  • metron9metron9 Posts: 1,100
    edited 2007-01-26 16:09
    Did you find a hex inverter at radio shack, need the part no for wiring. What transistor or fet are you going to use so I can calculate the resistor/capacitor for the on timer.

    Do you want to use a battery pack say 3 AA batteries for power and then just 2 LED's at 20ma or less for the on goal lights. Post a list of components you have perhaps just a PNP transistor could be used instead of the hex inverter.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!

    Post Edited (metron9) : 1/26/2007 4:14:14 PM GMT
  • th1961th1961 Posts: 6
    edited 2007-01-26 18:20
    metron9,

    This is what came in the Radio Shack Sensor kit (as far as the detailed specs of each unit, I would have to look at it,·I don't have it with me where I am right now.)
    • Console
    • Removable Sensors (6)
    • Sensor Interfaces (5)
    • Integrated Circuits (34)
    • Resistors (17)
    • Capacitors (10)
    • Light-Emitting Diodes (3)
    • Transistors (2)
    • Miscellaneous Items (Springs/Clips/Wire Segments)(74)
    • Owner's Manual
    My guess is that I will probably have to buy all the parts.· I·don't have a hex inverter; Radio Shacks web site does't list one either.

    You recommendation of 3 AA batteries for Power sounds good.·It the future an AC adapter would be a nice option, but I'm not going to worry about that just yet.· I need to crawl before I can walk. :-)

    I look forward to hearing from you.
    -TH1961

    Post Edited (th1961) : 1/26/2007 7:36:34 PM GMT
  • metron9metron9 Posts: 1,100
    edited 2007-01-26 21:15
    I think the batteries should last years. I buy 5V regulated supplies for under 3 bucks from mpja.com I also have jacks that fit the plug it comes with.

    I just got my digikey shipment today with hundreds (yes I do go overboard sometimes) of photo transistors. I will of course be experimenting with them so I may just be able to mail you finished units or breadboarded ones. I have tons of hex inverters waiting for the chance to be used.

    The lowest cost photo transistors are 12 cents each so the arrays of 6 on each side wont be much. Can we have drilled holes with them in the bottom perhaps we could even use epoxy to fill them in and sand it and polish it down to make a nice insert. I have 3mm size so the holes wont be very big, may need to put some led's on the inside lip on the top of the net to have this work in any light conditions though. Could use infared or UV if you dont want to see the light. Actually a thin piece of acrylic bent around the front of the net an sanded could be used as a light pipe to light the photo transistors and serve as the goal light, maby even blink it a few times on scoring hmmm I smell a 555 timer in this now, hmmm maby just use a tiny13 .. or, .... hmmmm...thinking... thinking..thinking...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • th1961th1961 Posts: 6
    edited 2007-01-27 03:19
    I'm listening tell me more. blush.gif· Those sound like great ideas.
  • WarrlokWarrlok Posts: 77
    edited 2007-01-28 23:58
    hey guys i,m new too,but it seems you could take a 9v battery or less ? and run to a cap then to a couple of resistors ( enough to bring it down to 3v) and trigger it from a contact switch ,,, not shure u want o do it the easy way since your learning/teaching..i,lll try it later

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Problems are the "roads" of life,
    solutions are only "onramps" to the next problem



    ············································· "Brad Smith"
    ·
  • th1961th1961 Posts: 6
    edited 2007-01-31 23:59
    Hi Warrlok,

    Thank you for the suggestion.·If I understand you correctly, I'm not sure if the switch will work?? Can you elaborate please?

    Thank you again.
  • metron9metron9 Posts: 1,100
    edited 2007-02-01 07:30
    Ok I just finished the programming on the hockey puck goal sensor. The layout goes like this.

    I have 5 sensors in series (you will want a few more to go across the full net) I soldered them to a board put foam around them and stuck a piece of clear lexan with a 1/4 inch clear space blocking the rest out with black tape. I would have used black epoxy to encapsulate themand just leave the little bump that receives the light vi sable but I misplaced my epoxy, it's around here somewhere.

    5V into one side of the sensors to a 1k resistor the other side of the resistor to a 10k pot the other side of the pot to ground
    This makes a voltage divider. Where the resistor and pot connect i measure that point with an ADC on a tiny13
    I left shift to drop off the low bits and get a number from 0 to 255
    To tune the system you turn the pot until the LED turns off. Then back up till it goes on and a bit more, this sets the sensitivity.


    The adc measures the voltage compared to the VCC
    I have one variable initialized at 127
    I compare the adc value with the variable
    If it is lower than the variable I make pin5 LOW and change the variable to 255 go back to loop
    If its higher than the variable I make pin5 HIGH and reset the variable to 127
    This allows hysteresis of 127 turning off and back to on so a value near 127 won't false trigger from noise.

    PIN6 will go high for 4 seconds when the sensor is triggered
    PIN7 will toggle for 4 seconds at 4 HZ in case you want to put in a beeper or something
    PIN4 will go from high to low from a high for 4 seconds then back to high in case you want a low signal instead of a high signal.
    PIN3 is the ADC

    PIN4 ground and PIN 8 VCC +5V

    I have tested it using a pencil putting pressure on the pencil and snapping it across the sensor as fast as I can like you might fire a spitball across the room.

    The scope shows a 1mS drop, that is the shadow that the pencil makes as it goes across the sensor.

    Some math:

    The pencil is traveling across the sensor with a shadow size of about 1/4 inch
    we take 1/4 inch times 1000 (1ms per quarter inch travel) and get .25 * 1000 = 250 inches, about 20 feet per second or 275 miles per hour. So if your puck travels less than 275 miles per hour it should work out fine for you. Not sure how fast it will pick up an object but it's limit should be the time the ADC takes to read divided by 2, I do two ADC reads and throw the first one out so there should be no false triggering.

    You do need to light the top with a constant light output, room light is fine but it needs to be over the game so you dont cast a shadow on the sensors. Perhaps put some led's on the rim of the goal or hang lights above the game.

    I will program 2 chips and send you 20 sensors and a schematic. You can find the pots and wire up whatever you want for the goal light.

    PM me your address.

    You could use the high or low signal as input on a stamp to do any other tasks you can think of as well, perhaps turn on a nice little sound chip with some band playing that funny organ music they usually play when someone scores.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!

    Post Edited (metron9) : 2/1/2007 7:39:51 AM GMT
    2048 x 1536 - 2M
    475 x 328 - 9K
    526 x 152 - 13K
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-02-01 07:38
    Metron9 -

    Just out of curiosity, how are you going to differentiate between the hockey puck blocking the sensor verses shaved ice blocking it?

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • metron9metron9 Posts: 1,100
    edited 2007-02-01 07:46
    Well only you can prevent your drink from spilling over the net so put that drink down before you spill it. Popcorn and potato chips could be a problem as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • th1961th1961 Posts: 6
    edited 2007-02-01 12:13
    Metron9,

    Thank you very much for the help.

    TH
Sign In or Register to comment.