Notifications
Clear all

Question about Hall switches that I am planning to use as limit switches.

78 Posts
6 Users
29 Likes
3,910 Views
(@pritchs)
Member
Joined: 1 year ago
Posts: 28
Topic starter  

@zander Ron, my understanding is essentially the same as yours with one difference. As I understand them, Hall switches pull the pin to ground when a magnet is brought into range producing a falling voltage. The pin stays low until the magnet is moved out of range at which time there is a rising voltage. This way the interrupt isn't kicked off multiple times for one encounter with the magnet regardless of whether the interrupt is set to falling, rising or changing.

As always, someone please correct me if this is wrong.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2530
 

@pritchs 

Why do you assume that you can ignore bounce, or do you handle that in code ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@pritchs)
Member
Joined: 1 year ago
Posts: 28
Topic starter  

@zander Hi Ron, I would be glad to when it's finalized - if ever.... 🤣 

The original project was "inspired" by the YouTube video below. As usual, I thought I could adapt it to my needs and do it better. 😆 😆 😆 😆 He has several videos of various iterations of his project. His is designed specifically to mount a camera and slide along a rail while keeping the camera aimed at a specific point in space. From his videos, it appears to work great. Me, I'm a woodturner, and my club hosts demonstrations each month, and an overhead camera is almost a must. However, cameras in that position are difficult to adjust w/o disrupting the demonstration, so my goal is a remotely controlled camera mount that will slide, pan, tilt, and zoom. 

sp


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2530
 

Posted by: @ronbentley1

@will 

Not really, my comment was born out of my experience with switches triggering interrupts.

So then, this (Hall or reed switches) is not a case where it's required ?

 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@pritchs)
Member
Joined: 1 year ago
Posts: 28
Topic starter  

@will Hi will. I'm planning on using a belt. This mechanism will need to travel around three feet, possibly a little more. I figure a lead screw that long could be hard to find.


   
ReplyQuote
ron bentley
(@ronbentley1)
Member
Joined: 2 years ago
Posts: 385
 

@will 

Quite possibly.

Ron B

Ron Bentley
Creativity is an input to innovation and change is the output from innovation. Braden Kelley
A computer is a machine for constructing mappings from input to output. Michael Kirby
Through great input you get great output. RZA
Gauss is great but Euler rocks!!


   
ReplyQuote
(@pritchs)
Member
Joined: 1 year ago
Posts: 28
Topic starter  

@ronbentley1 Ron, I think you are right as to the photocell being a better choice. I've already ordered a few to play with. You are also right in the devil being in the details of the code! I had a devil of a time trying to get the code to do what I wanted it to. Much of my flailing was caused by my lack of understanding of Hall switches and interrupts, but it still would have been tricky had I known how they work from the beginning.


   
ron bentley reacted
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2530
 

Posted by: @pritchs

I'm planning on using a belt. This mechanism will need to travel around three feet, possibly a little more. I figure a lead screw that long could be hard to find.

A belt is probably the best choice. Another problem with a leadscrew is that they're hard to get absolutely straight and square out of the mount, so they can wobble quite noticeably.

You may find some noticeable "give" in a belt that long and it may stretch a bit over time, so make sure that you build in a generous belt tightening system.

 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2530
 

@ronbentley1 

OK, thanks.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6966
 

@pritchs Same for a reed switch, but technically as @will mentions you have to de-bounce both and if an ISR is involved that is a bit of tricky code. A simple limit switch can either cut power, or signal a stop command (might need to debounce it too but no need for an ISR) Worried 1 switch can fail, put one on each side and wire in series. I used to work with steel mills and elevators that share a lot of similar controls as the slider. Never used a hall, used lot's of limit switches some many lbs in weight and some photocells.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@pritchs)
Member
Joined: 1 year ago
Posts: 28
Topic starter  

@ronbentley1 Ron, in this case that's exactly what I wanted to happen in order to stop the stepper. The pin gets reset when the magnet is removed so that also fits with what I need.


   
ron bentley reacted
ReplyQuote
ron bentley
(@ronbentley1)
Member
Joined: 2 years ago
Posts: 385
 

@pritchs 

But still an excellent learning outcome!

😊

Ron B

Ron Bentley
Creativity is an input to innovation and change is the output from innovation. Braden Kelley
A computer is a machine for constructing mappings from input to output. Michael Kirby
Through great input you get great output. RZA
Gauss is great but Euler rocks!!


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6966
 

@pritchs Sorry I need to ask some qualifying questions in order to know how to respond. How many years have you been a photographer, what gear are you using, how many decades of full time programming (40hrsx50wks) have you been doing, how many languages, how many OS's and applications?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2530
 

Posted by: @zander

@pritchs

Worried 1 switch can fail, put one on each side and wire in series.

I think parallel would be better in case one switch fails open, then the alarm will never be raised ?

 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2530
 

Posted by: @will

@pritchs 

Why do you assume that you can ignore bounce, or do you handle that in code ?

On further consideration, since this is more or less an emergency alarm situation, de-bouncing is probably not desirable and you'll want to react immediately.

 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Page 2 / 6