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.

Beerpong cup detector

Status
Not open for further replies.

d4j0n

New Member
I want to figure out when a cup has been removed. I saw a video of a firefighter themed table that could tell when a cup was removed, said it was via IR sensor.
**broken link removed**

As far as I have figured out by myself, i think I need something along the lines of this:
http://www.me.umn.edu/courses/me2011/robot/technotes/irbeam.html

Instead of a direct exposure from the IR LED to the sensor, I think both detector and IR bulb will be pointed through the glass at the cup and the reflection will (hopefully) turn on the IR sensor. I'm worried if the acrylic that the IR LED will be shining through will reflect the IR LED regardless of cup presence...

My question is a very basic one: How do I make this design toggle between two different colored LED's? My limited knowledge tells me I need something equivalent to a multiplexer *lol.* My goal is that the home team colors will be lit when the cups are down, and once dominated by the away team, THEIR colors will be the only ones left after all the home cups are gone. I'm actually a computer science student so my experience in circuit design is limited to a few basic classes (that also means I can't recognize some of the symbols used in circuit schematics), but I have done a bunch of solder projects on my own. I've pretty much forgotten how to calculate what resistors are needed though...

Budget is the main concern here... If anyone has any other ideas/suggestions for implementation, feel free! Remember, this is a beerpong table so best if it can be kept "under the glass."

So, in summary,
1. Does the approach seem sound? Is it OK to stream 20 of these things together with no change to the resistors and such? I will be working most likely at 12v, I'm using computer type 4 pin molex...neon cold cathodes will be going in the table as well. It won't be connected to a computer power source but rather one of those wall plug thingies that have a single wire w/ molex plug...they're used to test molex devices (do I need AC or DC?).
**broken link removed**

2. 850nm LED and 880nm phototransistors...will this pair work out or do the wavelengths have to be exactly the same?

3. What resistors will I need?

4. Is the wire gauge I use in this project important? Connected in parallel with the 12v lights/IR/neon cathodes, there will be 220v hair dryer fans being used (floating ball holder). What gauge wire should I use between those fans and what gauge after the 12v molex? Do I need anything special to properly connect insulate the 220v fan wires besides solder and shrink? I'd prefer not to use the 12v wall wart and the hairdryer plugs separately connected on one split extension cable...would like this to be a slightly more waterproof, self contained, and safe application.

Thanks!

**EDIT** Now using reed switches. My schematic so far:
http://farm4.static.flickr.com/3384/3600122858_f718836296_b.jpg
Excuse the handwriting, that's an "LED chaser" circuit at the end. It was suggested to me by someone else that I use CMOS/MOSFETs instead of transistors...
 
Last edited:
As far as I have figured out by myself, i think I need something along the lines of this:
IR Light Beams

might want to modulate the ir led @ 40khz & use ir remote receiver

**broken link removed**

You can get these parts pretty cheap @ surplus elect stores like all electronics or bgmicro etc.

Instead of a direct exposure from the IR LED to the sensor, I think both detector and IR bulb will be pointed through the glass at the cup and the reflection will (hopefully) turn on the IR sensor. I'm worried if the acrylic that the IR LED will be shining through will reflect the IR LED regardless of cup presence...

possibly -- might want to prototype it...

My question is a very basic one: How do I make this design toggle between two different colored LED's?

bicolor led, e.g.:

T1 RED/GREEN LED, 3 LEGS | AllElectronics.com

Anyway... sounds doable to me! Start simple and build up. Prototype...

Michael
 
I'm actually using reed switches right now. The problem I'm having now is figuring out what kind of capacitor to use for my chaser circuits (I want to fade the blinking). Can I just hook up the appropriate capacitor in series between resistor and LED without changing resistor values? I want a fast on switch and a slow dim off. I looked into RC time constants but I'm not sure if that circuit applies to what I'm doing.

I'm straying away from bi-color LED's because 1. I already ordered 100 of each color and 2. I want to use nice bright clearwater LED's instead of the milky ones. I have the schematic at the bottom of my original post, I hope it's correct.
 
Last edited:
So how many of the LEDs will act independent of each other? For example, maybe all the LEDs under one glass activate together. The more that work together the fewer components needed to drive them.

Not that I've done it, but I would think you could use a cap to allow slow fade out. It'd have to be in parallel with the LEDs and the power source. I'm not sure what size... would think the LEDs offer the resistance so you'd have to figure out what that resistance is and then determine size of C based on time period desired? If you figure LEDs drop something like .7V then figure out their working current, you can then calculate their effective resistance and go from there I suppose.

Here's what I'd recommend for figuring out how to switch colors. I'd write it out in psuedocode -- the step by step of how it will behave. Or, if you've studied agile methodologies, write out the alternate paths for each use case. And/or diagram the state machine. Then post that up here. From there, we can figure out how to control the lights.

My inclination is to say you might want to use a microcontroller and program it out. But it's also possible to do it with logic ICs, too; totally feasible to create a state machine with logic ICs. The ins and outs of how to switch colors we'll get to later. But it is basically either an MCU that turns one set of LEDs on and another set off, or else it is some circuit logic that does the same based on the sensor input and current state.

E.g., let's say you have four cups, two each side. Red LEDs are tied to the IR sensor, so when it is logic high (you'll have to use ckt to convert to logic levels), they are on. When cup is removed, IR sensor is logic low, and this turns off red LEDs and turns on green LEDs. Simultaneously the falling edge of the IR sensor, perhaps, sends a clock signal to a set of flip-flops or a counter or something that helps keep track of state of the machine. When the next cup is removed, it clocks the flip-flop/counter/whatever again and that then outputs a signal to turn on all the, let's say, green leds everywhere. So green LEDs light if (a) the state machine says to do so OR (b) the IR sensor says to do so. You use logic OR gates (or equivalent boolean circuit) to make that happen.

What we'll have to do, though, is to get a really clear handle on the state machine, then convert that to boolean tables and then we can convert pretty easily to the logic circuits needed to drive each LED.

Hope this helps.

Michael
 
Again, I ditched IR switches in favor of reed swithces. Each cup circuit will be independent of one another, as shown in the circuit linked on the first post.

I think microcontrollers are a bit overkill...the state diagram would just be this:

S1 <-> S2

S1: green on red off
S2: red on green off

Transition between the two of course being the presence of a cup.

A kind soul worked this out for me:
**broken link removed**
Based on this diagram, what capacitors would you recommend? Drop in right before the resistor of the LED arrays? Capacitors don't muck up resistances and current, correct?
 
Last edited:
Very cool -- way to keep it nice and simple!!

Seems like that ckt oughta work great.

Capacitance ... if it is in parallel with the LEDs, won't affect resistance inline with the LEDs. Basically they are like a mini battery. Apply power and they charge up (they do, literally, store charge, by definition) then when power is removed, if they have a path to discharge that power, they do so.

I'll have to think about the cap size. IIWY I'd just try a few different ones. 1uF, 10uF, 100uF and see what each do.

Do you know what current the LEDs are supposed to be running just to make sure? (Ask your friend? or check the specs for the LEDs you bought)

Michael
 
I've been researching how to do this for awhile and didn't know if when I try to do it around late June if I should use IR sensor, REED sensor or maybe just a simple switch where having a cup with a tiny bit of beer would be able to push it down. When you get to work do you think you could put a part list up that you used for each sensor and how you did it please! Also are you going to put glass over all this or Plexiglass? I was thinking about plexiglass so I could have a bottom solid piece, where all the lights on the table are under to prevent them from breaking when beer gets spilled. And then a second sheet on top of the first sheet with holes cut out for the cups to rest in. Do you think that this idea would effect how the sensor worked? Thank you very much and hope you get it to work and will tell how!!!
 
Shimniok, LED's are drawing around .20ma current and 3.5v (bright ones). The designer of that circuit assumed lower intensity LED's...2v or something. Totally noob question I know, but just so I'm clear, if you charge a cap with an input of 12v, when power is cut, it will be dishing out 12v down to 0v for a short period of time, correct? So for a super simple fade off, just set up the cap in series before the led's?
To test out what capacitance I need, short of using a variable cap, I add up the values by wiring in parallel? (forgot which wiring arrangement adds capacitance....I need to go double check)

maxpac34, plexiglas/acrylic is probably going to be plenty strong enough for this application. For my table I'm not using any kind of cup holding holes, it will be free arrangement after the first set of cups because my friends tend to choose creative arrangements during re-racks. Any type of movement triggered switch will probably be bad idea. Moving parts + liquid = bad idea so pressure switches are out. Reed switches are triggered by magnets. The rest of the design is all up to the creator. Churn out your own design and work it out from there!
 
Last edited:
Well I will do my best, I'm not an engineer, I am doing management science, which is basically econ with some higher level math... I just like to build stuff and have the ambition to start a project or want to do one. I have one electrical engineer friend and two ME guys. All of them would help me if I asked, but I need to come up with the idea since they wont. I don't know how really so thus I'm researching because my knowledge is limited but growing fast, well hope you get yours to work and maybe just give a little detail on how once you finish otherwise I'll just try to figure it out I guess. Thanks!
 
My suggestion if you are so inclined is to actually just enroll in an intro circuits/EE class. This kind of stuff is a bit tricky to learn on your own...
 
No thank you if I did this at UCSD (where I go to school) I think I would get blown out of the water pretty bad, I will just get my friend to teach me, I just don't know if I want to go with IR or REED.
 
Ahahaha i go to UCSD too!!!!

I guess we really are the only school who plays serious pong around here =P

If you need help prototyping over the summer you can contact me if you like. I'm actually headed out to frys today to get parts (done with finals). I'm actually a CS major so I only have taken basic EE classes...the intro classes aren't THAT bad.

rofl. gl with finals!
 
Last edited:
I think you're on the right track. Keep at it. You don't need to be an EE to figure this stuff out.

You want the cap in parallel with the power source... it basically acts like a surrogate power source when the power is cut. If you put it in series, then no DC current will flow through it. Which would be bad. :)

I think you want to protect the ckts from beer. :)

I think that circuit you have is workable. Caps are cheap. I would get a grab bag of electrolytic caps from Radio Shack or maybe order a few sizes like I suggested (1uF, 10uF, 100uF, and why not 1000uF) and try them out. The bigger caps hold more charge and so will power and fade out the circuit longer.

It will behave just as you want: instant light up, slow fade out.

Michael
 
So I just got back from Fry's...ended up with a bunch of non-polarized (didn't notice) electrolytic caps. Besides them not having any particular orientation, what's different about em? I think I see a problem...are they still able to string up in parallel? The selection wasn't spectacular there and I was a little bit confused with the naming scheme...some were labeled with uf and some were labeled mf.. I assume that's both referring to µ

to my surprise there were no 555 chips :confused: there was a 4017 decade counter though...
 
Last edited:
caps are caps aside from polarization... should work great. The main issue is how much charge it'll hold. Erm, I am pretty sure mfd is microfarad. I've seen a few caps labelled that way. If it were milifarad the cap would be gigantic.

Michael
 
That's really funny that you go to UCSD too. It's a small world. Well makes it a lot easier to ask for help I guess haha. Well did you ever consider a hall sensor? Just an idea I got from someone else because I heard REED's my be a little bit bigger and hard to fit under such a small area next to 9 other ones.
 
Well the 20 or so switches I ordered seemed to be comparable to a US quarter so I think the reed is gonna be ok (hopefully).

I do in fact have a breadboard, been tinkreing all day. Unfortunately I think I may have messed up my 4017 chip... one of the outputs always doesn't work. This was the output I was experimenting with a capacitor fader. Is it possible hooking transistors to the LED chaser has burnt out one of the chip outputs?

By the way, 2v LED's drawing 20ma seem to have no affect with even 100mfd capacitors...Also a parallel or series array of them should be draining the caps even faster, correct? With a fat 1kohm resistor the delay seemed just right, but the on state was unacceptably dim. If I use a bigger capacitor, doesn't this also mean that it will take longer to charge?
 
Last edited:
Unfortunately, yeah. If the chip can't source as much current as you asked it to it could cause trouble. :( You may need to have some kind of driver circuit between the 4017 and the LED.

Throwing the resistor in there should slow down the fade out... but also will cause voltage drop so the LEDs aren't seeing the 'full' 2V...

The caps will tend to charge very fast if I am not mistaken -- a cap looks like a short if it is discharged when the circuit powers on. Maybe we need some small resistor to limit inrush current, I dunno...

Yeah a string of these in parallel would drain a cap faster (total current would be sum of each). A string in series would have the same current through the series circuit, but they'd all be dimmer and/or you'd need higher voltage across all of them because total voltage drop would be sum of each.

They do make bigger caps... 1000uF ... 10000uF (altho that is starting to get pretty dang big and expensive).

I wonder if you could throw the larger resistor in series and use higher voltage fed to circuit. With the resistor you need, the LEDs run dim. Well, that is because of the voltage drop. If you increase the voltage substantially and pick the right resistor to ensure 20mA, that does two things. First, your LEDs have appropriate brightness. Second, your cap is getting a lot more charge (energy) stored in it and so I am thinking it would provide a longer fade out time.
 
Maybe the right answer is to drive the LEDs with transistor and use cap to store charge and slowly ramp down the base voltage/current. The base would use a lot less current than the raw leds so smaller cap might work... would have to figure out how to get this to work with the circuit diag you posted... may need tweaking...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top