Pages: [1]   Go Down
Author Topic: "Directional Switch" Design  (Read 1433 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?  
Logged

London, GB
Offline Offline
Sr. Member
****
Karma: 7
Posts: 332
Nothing works.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Ontario, Canada
Offline Offline
Full Member
***
Karma: 0
Posts: 117
Arduino . . . the little board that could!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

2 microswitches, 2 bumps and a dual flip flop like a 7474
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8443
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

« Last Edit: October 12, 2010, 08:47:05 am by graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Central Indiana, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 202
So many projects, so little time...and money!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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!
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8443
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: October 12, 2010, 07:54:29 pm by graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

SF Bay Area
Offline Offline
Edison Member
*
Karma: 10
Posts: 1235
Arduino Ninja
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store

Central Indiana, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 202
So many projects, so little time...and money!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8443
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley).

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

______
Rob

Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8443
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: October 12, 2010, 10:41:33 pm by graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Pages: [1]   Go Up
Jump to: