Go Down

Topic: "Directional Switch" Design (Read 2072 times) previous topic - next topic

tspecsp

All,

This is not Arduino related, but I have an interesting problem that I hope someone more electrically inclined can help me with (I'm more mechanically inclined myself). Here's the problem: I have a drawer and I want an LED to turn on when the drawer passes the halfway point as the drawer closes. When the drawer is closed completely, the LED will turn off. However, I do not want the LED to turn on when the drawer is being opened.  I would like to keep the solution as simple and "dumb" as possible, so I would like to avoid a microprocessor if possible.

I have already looked at JK flip-flops, but haven't been able to find much practical information on how to implement one of these in a physical circuit.

I have also looked at hall-effect sensors, but I haven't been able to find any that  have a "directionality" to them.

Anybody have any ideas?  

u0421793

A single optointerrupter (A) at the beginning of travel point, a pair of optointerrupters (B and C) at the midpoint, and a single optointerrupter (D) at the end of travel point.

Detect the transition of B = true followed by C = true, turn light on, detect transition of D = true, turn light off.

Remove A from system altogether, as it turns out that it is not required. Might come in handy for some other project.

Christopher Singleton

Ian,

If you want to do this without the use of a microcontroller, then I think that you will need to use a mechanical cam to activate the switch.

You could do this by cutting a tapered cam profile in a long piece of plastic or wood that is mounted to the drawer. The cam would need to be hinged in such a way to allow the cam follower (attached to a micro switch) to activate the switch when the drawer is being closed . . . yet take a slightly different path (bypassing the cam) when the drawer is being opened.

Some ball point pens that operate by pushing the button once to extend and pushing it a second time to retract, work on a similar principle.

Osgeld

2 microswitches, 2 bumps and a dual flip flop like a 7474
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

tspecsp

Thanks for the ideas!

I've found some good information about how flip flops work, but I'm still unsure how I would physically implement it. Do you know where I could find a sample schematic of one being used?

Graynomad

#5
Oct 12, 2010, 03:42 pm Last Edit: Oct 12, 2010, 03:47 pm by graynomad Reason: 1
Something like this



Apply power with the drawer open, the light will come on because both FFs are set by the RC circuit.

1/2 close drawer, FF1 gets clocked with 1 on D, light stays on. FF2 changes state.

Drawer closed, FF1 gets reset, light off.

Open drawer, at 1/2 pos FF1 is clocked but has 0 on D so no light. Also FF2 changes state.

Close drawer, at 1/2 position  FF1 gets clocked with 1 on D, light stays on. FF2 changes state.

Drawer closed, FF1 gets reset, light off.

etc etc.


I think that's about right although my brain hurts when I do this stuff and I often get my levels arse about face.

The 1/2 closed switch should provide a positive level and MUST be debounced, the closed switch input should provide a low level and doesn't need to be debounced.


_______
Rob

Rob Gray aka the GRAYnomad www.robgray.com

flyboy

No need for flip flops or any electronic parts other than some switches.  Use two microswitches.  On switch #1, connect the common terminal to +V and the NC terminal connects to the NO terminal of switch #2.  Common terminal of switch #2 connects to one side of light bulb or LED.  Other lead of light goes to ground.

When drawer is closed, one of the two switches is open and the other is closed -- light off.  When drawer is half open, one switch is closed and the other is open -- light on.  If drawer is opened past the second switch, one switch is open and the other is closed -- light off.


tspecsp

@Rob - That helps a lot. I've been trying to understand this logic stuff for a while now and that explanation clears some things up for me. I have one question though: Should the 1/2 closed switch be a momentary switch, or does it need to remain closed while the drawer is closed?

Thanks!

Graynomad

#8
Oct 13, 2010, 02:54 am Last Edit: Oct 13, 2010, 02:54 am by graynomad Reason: 1
Both switches would be momentary, the FFs remember the state. The "closed" switch would in fact remain activated when the drawer is closed, but that doesn't matter.

There are no end of limit switches good for this.

@flyboy. I like the idea of not using any logic at all, but does this differentiate between opening and closing the drawer?

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

macegr

A flipflop circuit is nice but will be plagued by contact bounce.

A switch could detect direction of motion by dragging a probe on the side of the drawer, closed only during drawer close. A simple cam could close and open another switch at the correct times.
Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store

flyboy

I made an assumption in reading your requirements that it didn't need to be directional.  If it does indeed have to be directional, a flip flop or some other electronic logic would probably be required.

Graynomad

Quote
A flipflop circuit is nice but will be plagued by contact bounce.
True, but easily fixed.

Quote
If it does indeed have to be directional, a flip flop or some other electronic logic would probably be required.
That was my take, but macegr's cam idea is good if you have the where-with-all to make the cams (ie an axacto knife and some balsa wood  :)).

Despite my being into electronics I'm all in favour of a non-electronics approach.

______
Rob

Rob Gray aka the GRAYnomad www.robgray.com

tspecsp

@Rob: Alright, thats what I thought.  Also, what do you mean by this:

Quote
There are no end of limit switches good for this.
?

Graynomad

#13
Oct 13, 2010, 05:38 am Last Edit: Oct 13, 2010, 05:41 am by graynomad Reason: 1
Just that there are very common. These are the sort of thing that would be good for any of the above ideas.

http://au.farnell.com/honeywell-s-c/bz-2rw53-a2/microswitch-wire-hinge-lever/dp/1262131

http://au.farnell.com/honeywell-s-c/sl-b1/limit-switch-spdt/dp/1525113

The wire actuator is often good because you can band the wire to get the actuation point just right.
______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

tspecsp

Ahhhh, haha. I see what you mean now. I originally read it as 'There are no "end-of-limit switches" good for this.'  Thanks a lot for all the help!

Go Up