Tilt switch test rig

Rampz

Well-known member
I have been using these for a decade in a commercial product with a Picaxe 20M2.
Hello rq3 do you have info i can have on the use of them and how you do it to see if i can make it work in my project? Looking at the data sheet the Rotary eith on-axis or off-axis, look like sometyhing i could use, so any info on a part number and just some help on getting something working would be great, i came across it last night and it felt like something in a usable direction for my problem
 
Last edited:

PhilHornby

Senior Member
Exactly the issue I'm working with, the church allow the weights to be removed and the auto winding setup as shown in the pics replaces that,
...
the clock mech isn't required to be fully wound up and consistent tension on the drum against a spring for stored energy is enough
So the clock's been converted from weight-driven to spring-driven?
 

Rampz

Well-known member
So the clock's been converted from weight-driven to spring-driven?
Its the what all the companies do regards turret clocks, having large weights on steel cable hanging down the bell tower is not too great health and safety wise, so the removal of them is allowed, the spring version is applied to the winding handle connection point so is completly reversible and the weights could be re-hung if required, so its conversion in a way that causes no damage to the clock
 

rq3

Senior Member
Hello rq3 do you have info i can have on the use of them and how you do it to see if i can make it work in my project? Looking at the data sheet the Rotary eith on-axis or off-axis, look like sometyhing i could use, so any info on a part number and just some help on getting something working would be great, i came across it last night and it felt like something in a usable direction for my problem
Actually, I think it's way overkill for your need. Since the clock is driven by a spring, I would simply place a magnet on the periphery of the spring barrel and use it to trigger a reed switch or hall effect sensor. The Picaxe could read that as one count per revolution of the barrel. I can't think of anything simpler, more fool proof, or needing less energy (battery power).

After, say, 100 clockwise revolutions of the barrel, the clock needs winding. The motor winds the spring 100 revolutions anti-clockwise. Rinse and repeat.
 

Rampz

Well-known member
Thanks rq3 but its not that easy nothing can be attached or clamped to any other part of the clock than the spindle used to previously wind it, with the tention being spring based its not linear so, currently we aim to keep adding tention to the spring everytime the spindle move a Max of 15 degrees so the clock runs evenly, its better the motor winds a few degrees every few mins rather than a larger angle less often, the other issue there often isn't much room for the drive unit to move before it clashes with other parts of the clock, so the idea of accurately being able to start and stop the motor over a small amount of degrees reliability would be great.
 

rq3

Senior Member
Thanks rq3 but its not that easy nothing can be attached or clamped to any other part of the clock than the spindle used to previously wind it, with the tention being spring based its not linear so, currently we aim to keep adding tention to the spring everytime the spindle move a Max of 15 degrees so the clock runs evenly, its better the motor winds a few degrees every few mins rather than a larger angle less often, the other issue there often isn't much room for the drive unit to move before it clashes with other parts of the clock, so the idea of accurately being able to start and stop the motor over a small amount of degrees reliability would be great.
As an amateur horologist, and having built (and building now) more than one pendulum clock from scratch, by hand, I suspect you're going to have a problem doing that. Most clocks, and especially weight driven tower clocks, have a "sustaining" mechanism that uncouples the works from the drive source during the winding process. The typical longcase, or grandfather, clock has an 8 day reserve, so if it is wound every 7 days it never runs down, and the sustaining mechanism is only invoked once per week.

And of course, converting a weight driven work to a spring drive will involve a fusee, tapered spring, or other means of linearizing the non-constant spring.

Because the sustaining drive isn't perfect, trying to make it do its thing every few minutes will yield a clock that isn't a clock. It won't keep time. At all.

It's a shame that the nanny states have reached the point where a weight driven clock is considered a safety hazard, although I'm sure they have scientific data showing how many people have been maimed or killed by snapping cables and falling weights in church clocks. My own research finds two such souls since 1580, both of whom were trying to steal the lead filled brass weights. Even I am still surprised at just how heavy a grandfather clock weight can be (approaching 100 pounds).

On the other hand, hundreds of people are injured or killed every year by monkeying with garage door springs, which are comparable to what it would take to drive a large turret clock.

But this is all off topic. I wish you luck!
 

Rampz

Well-known member
Thanks rq3 I am doing nothing new, the product in question has been fitted to turret clocks across the UK and Europe for over 15years, the original manufacturer has passed the building of the units to a new owner and electronic control had gone wrong and I said I would assist it updating the control systems, firstly with 555 times now moving to picaxe giving additional functions, an ongoing issue has been the reliability of the tilt switches used and either making them more reliable or look for another angle sensor, these magneto multi axis sensors look like they could give a really reliable angle sensing set up.
Pic of the drives again for you
 

Attachments

Last edited:

papaof2

Senior Member
A quick check pf their web page makes this device the most accurate you're likely to find that easily interfaces with a PICAXE. The datasheets can be downloaded from that page.
 

PhilHornby

Senior Member
...the other issue there often isn't much room for the drive unit to move before it clashes with other parts of the clock...
Serious question...

Are you sure this is a good subject, for your first major Picaxe project?

Presumably, you're putting your name to this - and certifying that it won't go berserk and mangle the clock at some point in the future?
 

Rampz

Well-known member
Are you sure this is a good subject, for your first major Picaxe project?
Really good question, i came to picaxe as a route to make the manufacturers product better over an above the 555 timers i had been using for 12 months previously which were a huge improvement on the issues they were having previously, if you look at my first project on here titles "switching issues" that is the picaxe control set up i have designed to replace the 555 timer and it has additional fail safe features beyond what i could do with the timer in the space i had to fit it all, there is a limit switch should the motor move too far, if you look in the picture above you will notice a black cord attached at one end to the clock stand and at the other to the end of a white nylon plug that you will see goes through and out of the control box on the motor, if it drives too far the plug is pulled out and that removes all power to the motor, in the control circuit it is fitted after all control circuits and before the motor, so is the fail safe and this has been in the manufacturers units for many years i understand.

So all in all i think the picaxe is an improvement and with the huge help i have had from several members of the forum i am happy to put my mane to my involvement in the project.

Before i became involved the motor junction box had a row of 5 connector blocks, a micro switch and several smd components soldered in a lump and shrink sleeving all pushed into the box, now we have a pcb that fits snugly in the box with a pcb terminal for every wire in the position they enter the box, space on the pcb to lay the smd components out correctly, a set of 4 header pins for the timer pcb to sit on, which will be replaced with the picaxe version.

Previously the system at the power supply had a low voltage cut off setup to protect the battery from deep discharge, this was a 4 pole relay with a pot inline with the supply and a push button the set the latch set-up, the relay used to drop out around 10.5v, but the relay used 65ma and dureing mains fail was using quite a lot from the battery over the 168 hours a church would ideally want but never managed.

I altered this design to a 555 using its comparator driving 2x P-channel mosfets which brought the running current down to about 12ma, i could see with picaxe i could move a step further and have voltage monitoring being done by the picaxe along with its timing duties, this reduced the standby current hugely.

As it was with 3 drive units on a quarterly chiming turret clock, with the 555 based control system and low voltage cut off the standby current was around 52ma, going over to picaxe this should reduce to around 4ma max, when on battery the control system now takes about 600mah from the battery during the wanted 168hr backup whereas before the main current draw on the battery was the control system not the motors and the reason they never got the back up they wanted.

It seems if the code is good then the reliability of the picaxe is better than any previous set ups
 

Attachments

David_Reynolds

Well-known member
I have been musing over what has been said about the operation of the tilt switch and its failures, and I would like to throw my two penneth in if I may. It seems that the action of this switch is never going to be instant, it could sit with the ball or the blob of mercury just nicely feathering against the contacts. This will never be agood thing since even with very small currents flowing, that may not be enough to give a signal and turn the machine on there will be etching of the presented surfaces . Over time, this will mean that the balls or blobs will not actually contact fully unless vibrated or shaken, due to the impurities produced by the etching, not good .
Indeed some of them are only rated to a few milliamps. So you are always going to have trouble, unless you can produce a snap type of action in the package as suggested by Buzby, or some solid state positioning solution.
If the rig you have set up is working OK then the switches that trigger multiple times would appear to be a little bit dodgey, since your rig is going to be much faster than the clock,I suspect.

The only half way setting that I can suggest is that no actual current is allowed on the switch except for the occasional pulse to check its state, say every hour maybe for just a second. A program like this would not be waiting for the switch feathering, more for it to be fully on.
I would suggest a pin to drive a transister through the switch and if it carries current your test is met, and the motor can be set to rewind.
Of course pull up or down resitors can be used to make sure the switch is not floating but it will only have any connection to the controller when the transister is switched. Also keep the current down to less than five milliamps, and I think the switches would last many years.
Give me a good slapping and tell me if It does not make any sense.
 
Last edited:

Rampz

Well-known member
Give me a good slapping and tell me if It does not make any sense.
Thank you for your input its all welcome, in my latest design the tilt switch is connected to an optocoupler via a 2k resistor that then inputs to a leg of the picaxe, the reason for the optocoupler is in the previous setups its always been supply voltage taken to tilt switch and then fed to timer etc, i need to keep everything backwards campatible with previous builds of the motor unit. Also the optocoupler stops me having any chance of phantom powering isues from a transistor etc

Over the last 15 years its always been some type of tilt switch with hit and miss results i understand, i say hit and miss but more mean a slight failure of some kind every few years on a unit, but they never got to the bottom of the issue, sometimes a clock would stop after many months or would be fine for years.

I don't feel the use of a tilt switch is the way forward, its moves just so slowly, the eye can't see the drum rotating its that slow, i feel like you more of a snap action needs to happen, yet still the makers needs to keep it simple to build and setup, often these units are send for self install and you can just imagine the problems that causes.

Some sort of solid state positioning solution looks very promising buts currently way over my head, the current builder does have 2x test turret clocks where i can trial designs and are currently running both 555 timer control solutions and now a picaxe version, its lucky that the existing mosfet being used is a logic level device and is tried and tested in this application
 

Buzby

Senior Member
I like the idea of no physical make/break switch, but a sophisticated angular position detector does seem a bit of overkill, and might need different setting on different clocks..

The Hall Effect 'ball in tube' idea would have a snap-action if the tube was bent slightly. A piece of clear hose, a ball bearing, some clips, and a Hall Effect sensor seems to me to be the best solution. Mount these on a board, so it can be rotated as a whole to suit whatever clock it's in, and easy to see if it's working as required. ( Even better if you can have one 3D printed, or made of glass. )

You say nobody ever got to the bottom of why the original Hall Effect 'ball-in-tube' failed. The only mechanical failure mode I can envisage is the the ball failed to reach the sensor. Maybe it got stuck due to thermal expansion, or the plastic 'tube' swelled due to damp, or a spider nest blocked the way.

Cheers,

Buzby
 

Rampz

Well-known member
You say nobody ever got to the bottom of why the original Hall Effect 'ball-in-tube' failed. The only mechanical failure mode I can envisage is the the ball failed to reach the sensor. Maybe it got stuck due to thermal expansion, or the plastic 'tube' swelled due to damp, or a spider nest blocked the way.
The original hall effect and ball was inside a machined block of plastic of some sort, the original manufacturer had changed from this method to a pre built tilt switch just before he stopped production due to ill health, we have never found out what the reason for the change was, the units he built with the ball were tight machined and glued together i have never managed to open one. the block was then rotated and fixed in the position required in relation to the position the motor was being used on the clock etc. i'm open to all ideas of a reliable long lasting solution, but the finished sensor does need to look the part on the finished unit, i have no understanding of 3D printing etc so i am forced down the what can be found off the shelf so to speak
 

David_Reynolds

Well-known member
Right,
I am trying to get it, my first thought is that you are driving an led via the tilt switch, that in turn will give a positive signal to the IC.
First have you checked the current that is needed for the opto to work?
The opto is also a transister by it's output, I only use optos for miss matching voltages or isolation purposes.
Does it require around say five milliamps?
This current that is required to switch on may mean in real use it could get ten minutes of feathering, producing bits of soot, maybe silver or chrome crystals forming or other compounds, that my start to cover one of the poles, electrolytic action is a bitch that could become a killer later on.
If you supply the switch with your voltage maybe 5V say through a 1K then you limit current to 5mA put this to the collector of a small signal transister. the collector of it can be pulled down by a 10K resistor to 0V parallel it with a small value capacitor to stop any floating.
You have a Picaxe chip, so it shuold not be to difficult.
Set a output pulse every so many minutes for a second or two to the base pin, don't forget to pull this down with 10K to make sure that it does not missfire, unless there is an internal setting for pull up or down within the IC. plus you can save a furthe few milliamps.
If the emmitter / source is fed to a receiving pin and goes high you should have a reliable setup, the rest you have got working as you need it.
IMHO if you are feeding the switch with current all the time it may be is why they get so hit and miss, but using more electronics to test for positions sounds like it is getting too complex for the relatively simple job it is to do, but hey sometimes it is the way forwards as I witnessed one day when a firm came in to change some fifty year old relay based control panels. They would have been a couple of hundred pounds to renew in the same way. Replacing them with smart new CPUs with nice but totally uneeded touch screens at around ten thousand pounds each, Wow I bet someone got a nice bonus for that!
They failed once in a while but at least they diagnosed their own problems and displayed it on the screen, (mostly).
 

Rampz

Well-known member
Supply votage to the tilt switch is 10.5-14.4vdc depending state of charge of the battery, i don't have the optocoupler data sheet to hand being at work, i need to keep everything backward compatible where i can, i'll post my current circuit diagram when i get home, so you can see what i am doing, along with optocoupler data sheet
 

Buzby

Senior Member
The original hall effect and ball was inside a machined block of plastic of some sort, ... i have never managed to open one. the block was then rotated and fixed in the position required in relation to the position the motor was being used on the clock etc.
If only he had used a clear plastic cover for his machined block !.

It doesn't cost much to have 3D stuff printed, but most suppliers need a 3D graphic file to work from. It also doesn't cost much to have a local engineering company route a channel in a small block of aluminium, and if you visit you can usually just describe what you want with a simple sketch.

I envisage a block about 10mm thick, 25mm x 30mm, with a 5mm wide x 5mm deep channel cut in it, closed at each end. A thin clear plastic sheet traps a 4mm ball bearing in the channel, and has a sensor in one end.

Overall I think this would make the most reliable, and visible, solution that uses simple components.

( Note : There are two types of Hall detectors. One type is just a sensor that detects magnets, the other has a magnet built in, and detects the change in magnetic field when a piece of iron etc. is brought near. This second type is how most commercial miniature proximity switches work, and there are plenty of them to chose from. The first type are what you usually see as components in a 'transistor style' package, and don't work well with non-magnetised targets. )

Cheers,

Buzby
 

David_Reynolds

Well-known member
Found a decent quality tilt switch in farnell by the looks of it, well sealed and filled with inert gas, rated upto 0.25 A at upto 60V . cheap enough to try. Farnell number 540614 .
 

Rampz

Well-known member
Found a decent quality tilt switch in farnell by the looks of it, well sealed and filled with inert gas, rated upto 0.25 A at upto 60V . cheap enough to try. Farnell number 540614 .
Thank you David that is exactly the part we are current using but from RS Components, same part number same manufacturer
 

David_Reynolds

Well-known member
And it still troublesome?
If so then perhaps you should use a 4834756 it is mercury and is sealed American made by the look of it and takes DC 120V to 0.5A

It is still going to end up causing trouble but if you can find a way to apply AC or +and- DC then it would cancel out elecrolytic action to a great degree.
 
Last edited:

Rampz

Well-known member
Yes sometime works fine other times on other clocks intermittently stop for no reason a quick flick and off it goes again, mercury based switches are much worse
 

David_Reynolds

Well-known member
or this one 2374762 needs to plug into a base clip but that means it can be changed out very quickly. much lower in current , 0.1A
but still should cope.
All are worth a look at, I cannot see why mercury tilt is worse than ball bearings other than maybe the dither ruins them as I have said DC for any very slow switch is not good, but under normal use they should be good for a few hudred thousand operations.
 

Rampz

Well-known member
I cannot see why mercury tilt is worse than ball bearings
The mercury ones that were tried were in a glass envelope and they were all slightly different shape, the mercury didn't seem to move about consistently.

Looking at the part number for the second option looks interesting the data sheet speaks that they doesn't want to be any vibration where its used, turret clock depending on design do have a certain amount of vibration in operation, and i think the builder like to have the tilt switch hidden in the middle of a block.

I have a previous units pic attached, showing how they used to look and now the previous tilt switch would be soldered and sleeved inside it, the old one in the pic is hall effect based and rattles when shook

I just managed to take it apart and there is a brass tube with a magnet glued into it, it rolls in a machined guide way as you can see, you would think this was a great solution

While playing with it, it can be noticed that if the block is not perfectly level the little brass tube can rub against the case and not move, i would say the spindle on a clock is rarely dead level.
 

Attachments

Last edited:

David_Reynolds

Well-known member
Very expensive looking as well. Have you thought about optical switch using the same sort of pendulum idea?
But narrow to pass through the slot, vibration does not matter since the opto will switch the motor on with its first pulse.
The ones I have seen have their own control PCB will mean that you will have to mount them in a normal small box I suppose the pendulum could be part of a steel washer
fastened onto a shaft with spacers to keep it central to the switch.
The main problem is it would have to be a supply of 5V. 0V. and switch would be 5V .
Mounting the box, you may have to put it on an external plate to be attached by a screw where the original one was to avoid damage.
I am assuming here that you can change the part that I see in those photos?
Surely you do not have to keep it?
The device unless it is burnt out by some over voltage should last for many years.


One more thought why not try a standard reed switch in the existing system if you mount it correctly , the 14mm long ones, I cannot see any reason for them to feather they would tend to have a snap action when the magnetic field is stong enough to close them, there might be a few microseconds of bounce but no problem. remember that because they are magnetised parts the orientation of them in the field may have to be adjusted to suit.
With a powerful magnifying glass you will be able to get them right each time.
You will know what I mean if you have ever fitted an alarm system. They being glass are a bit delicate but cutting the ends off and soldering some really flexible wires should be OK.

Dave.
 
Last edited:

Rampz

Well-known member
Yep i am thinking of loads of different ways that could work with the present setup, optical is an option too like you say, i am very interested in the triaxis sensors mentioned above, a shaft acting like a pendulum weighted at its end, shaft going through drive body with magnet attached to end, pcb with sensor on other side in a block that could be rotated to calibrate the sensor, the whole clock winding setup is an expensive item anyway so if a really reliable solution is going to cost say £100 extra per motor drive unit then its still within do-able, the shaft could pass under the current motor control box with the chip on the bottom of the pcb in the control box picking up a magnet drilled into the shaft, maybe these items can be calibrated by holding the motor in its highest position pushing a button to memorise that location and through raw data determine if its going clockwise or anti clockwise by a set amount of degrees and use that to trigger the picaxe. After someone gave the idea based on what i had found already no further info seems forthcoming.

many ideas to consider if i can get accurate counting of angle i would say i'm heading in the right direction to a very reliable solution even if its going to cost, since these sensors can be used with a Picaxe seems a good thing to explore further
 

Rampz

Well-known member
Ok I have found a uk source for the MLX90316EDC-BCG-000 triaxis sensor any ideas for basic connection and ideas on code, I don't feel its use is overkill with all the problems we have had in the past and the positional accuracy I need coupled with repeatably of activation at exactly the same spot 100% of the time

Edit

i can see these are the unprogrammed version, i need the ones with PPA in the part number and i can get them too, PPA being pre programmed for an analogue output, that i assume a picaxe would use its readadc10 to give a change of angle detection
 
Last edited:

David_Reynolds

Well-known member
I thought you were just jacking up some spring tension, how accurate do you need the positioning to be?
How often does it pulse in normal use?
The original powered system cannot have been very close unless it pulse every few minutes. If I understand it the tension has to remain in certain limits after all the old weights would have been a constant strain, so regulation would then be fairly easy.
 
Last edited:

Rampz

Well-known member
It will pulse every between 10 and 20 mins a pulse lasting as long as the tilt switch operates plus 400ms, the angle being 15 degrees but with the tilt switch activating where ever it likes and sometimes not at all that angle could be a lot longer pulling the limit switch out, i prefer to get the best accuaracy where ever i can within reason, that gives me much more leeway for errors, if i could be accurate to the nearest degree then i have something i can work with, with the movement being slower than can be seen by our eyes, its likely its beyond the design of a tilt switch, a magnetic rotational sensor seems to be a good route, i have spoken to the current manufacturer today he had come across these sensors a couple of years ago, but it was way over his head and he carried on without it.

Optical is still a good idea if i can be sure the activation is 100% repeatable for a given position, if i was wanting detection through 90 degrees then it would be a whole lot easier, the manufacturer of the motor drive would prefer a small angle that the current 15 degrees, more often and shorter drive pulses would give a more even winding tension.

If I understand it the tension has to remain in certain limits after all the old weights would have been a constant strain, so regulation would then be fairly easy.
Yes the smaller the activation angle the better to give the impression of a wound up weighted solution as previous
 

David_Reynolds

Well-known member
I get it so if you were to pulse it just a few degrees it will be more accurate than pulling the spring up a lot more.
There is a way to offset some of that , use two springs opposite each other pulled to 2/3trds their max then fix the arm to the centre.
When leverage is put on, the strain is a lot more linear, as one is relied and the other takes more strain.
 

Rampz

Well-known member
There is a way to offset some of that , use two springs opposite each other pulled to 2/3trds their max then fix the arm to the centre.
When leverage is put on, the strain is a lot more linear, as one is relied and the other takes more strain.
Something to look into, its trying to get that info across to a self installer with limited places to attach springs, I need to design out as much as possible towards idiot proofing it, if you know what i mean.
 

David_Reynolds

Well-known member
Yes. I get it, I may look into an optical solution just as a matter of interest and see if it can give you smaller angles of control I think it might , and be a lot less demanding than the axis unit, since it is only on or off even if it dithers.
The axis unit you have to interface it with a controller rather than just displaying a position via some serial interface.
Though there are people on this site that might have already done it.
Or maybe the suppliers have some sotfware for it.
 
Last edited:

PhilHornby

Senior Member
Having re-read the thread, some thoughts - which are don't believe are duplicates :cautious: ...

  • Wouldn't the tilt switch be better placed down at the bottom end of the arm (that is connected to the spring). That way it would move through a larger arc.
  • When power is applied to the motor, could a sudden jolt applied to the tilt sensor be upsetting it?
  • What about electrical spikes from the motor, upsetting the electronics? (I've encountered this with two of my projects, which worked perfectly on the bench, but not when deployed - I fixed both in software...)
25168

and for anyone having trouble with their own Turret Clock, see: The Turret Clock Keeper's Handbook :)
 

Rampz

Well-known member
Wouldn't the tilt switch be better placed down at the bottom end of the arm (that is connected to the spring)
Thank you PhilHornby, its a good thought, if you look at the middle drive in that picture you will see they don't always have the extended bar as that one does, but moving as far as possible away from the axis would increase movement and may well help.

Your second point i am already considering, on the motor unit that winds the clock the movement is say every 15mins, but on the unit that does the bells etc, it is also only every 15mins but ones triggered the motor can be driving in short pulses for 30 seconds depending on the hour its striking, and during that time the tilt switch appears to be shook back and forth, i wondered what effect that was having

Your third point, when i was first involved in the project, the setup was, a tilt switch with a large snubber network to counter debounce and trying to lenghten the pulse time driving a n-channel mosfet driving the motor, it appeared during those times the the snubber network was almost welding the ball in the tilt switch and the result was it was burning mosfet out all the time, i went over to 555 times as my route and that made operation of the tilt switch much better, but 555 timers have issues on start up with false triggering, problems with supply can falsely trigger them too, we are wondering if there are any situations where maybe electrical noise could actually stop the 555 from triggering at all, now my design has gone to the PICaxe, although i have working pcb and am happy that the code does everything i want from it, they aren't out on clocks yet and not yet gone into testing, more testing needed to get the coded delays right and the voltages that are monitored by code set correctly, but then will be the first time i have a device running code where possibly further issues can be delt with in this way.

Page 11 of The Turret Clock Keeper's Handbook, the "Winding Squares" are the only place we are allowed to attached and electrical wining tech, we can't tough anything else, a company did use to clamp around the winding drum and use motors and weights to shorten the weight drop height keeping the weights within the clock room, but that was not liked by the powers that be and these days are often removed, even the clamping of tech to the winding squares is done with steel set screws with brass tips so not to mark the winding squares
 
Last edited:

hippy

Technical Support
Staff member
if you can find a way to apply AC or +and- DC then it would cancel out elecrolytic action to a great degree.
To avoid 'DC-induced corrossion' one can do something like this -
Code:
    |     ___         /          ___
B.0 |----|___|---.---O  O---.---|___|---.
    |            |          |           |
B.1 |------------'          |           |
    |                       |           |
B.2 |-----------------------'           |
    |                                   |
B.3 |-----------------------------------'
    |
And then alternate reading the switch with current flowing in opposite direction each time -

Code:
  Input B.0
  Input B.1
  Input B.2
  Input B.3
  Low   B.2
  High  B.0
  switchClosed =  pinB.1 ^ 1
  Input B.0
  Input B.2
Code:
  Input B.0
  Input B.1
  Input B.2
  Input B.3
  Low   B.1
  High  B.3
  switchClosed =  pinB.2 ^ 1
  Input B.3
  Input B.1
The advantage of this is there are still only two wires going to the tilt switch. It also means that voltages and current are reduced.

But, while DC-induced effects may explain failures after months or years I wouldn't have expected that after just weeks or days. I think it's more likely some sort of physical effect, like when one can sometimes tilt a plank with a brick on it to near vertical without it breaking the bond of friction.

Given it has 'never really worked reliably' the obvious option is to go solid state, get something which returns some kind of pitch angle rather than just an unreliable on-off indication.
 

Rampz

Well-known member
like when one can sometimes tilt a plank with a brick on it to near vertical without it breaking the bond of friction
Yep with the rotation being so very slow that effect could be giving ever changing results, do we think we will get elecrolytic action with a hermetically sealed & inert gas filled sensor?

If that is the case i need to go upto a larger picaxe 14m2 maybe i'm tight enough on space as it is.

Given it has 'never really worked reliably' the obvious option is to go solid state, get something which returns some kind of pitch angle rather than just an unreliable on-off indication.
I was looking through the data sheet for a solid state angle sensor as rq3 had spoke about previously and found a simple connection diagram, that looks possible with 0-5v becoming a 0-65000 ish on an input pin.

I wouldn't be interested in reading the angle, if i could save the ouput value as being my top position and save to eeprom and work out what the raw data point was for 15 degrees either way of saved position and use that difference to trigger my output then i can see a reliable route forward.

There may well be many other options acroos other methods
 

Attachments

Last edited:

Rampz

Well-known member
It is still going to end up causing trouble but if you can find a way to apply AC or +and- DC then it would cancel out elecrolytic action to a great degree.
David i missed this in your previous post, i have used half wave rectification in the past for external parts exposed to moisture, do we think we will get this action in a completly sealed item with an inert gas fill?
 

David_Reynolds

Well-known member
How stupid of me.
If you reverse the operating action of your switch then electrolytic action should not be a problem.
When the switch is properly made no etching can take place, so no bad contacts, so change it so that it is normaly closed, only operating the motor when the switch breaks, it will do this fairly quickly since when a current is flowing there should be very small attraction keeping it in place until the weight gets too much and the ball will break away.
Sorry it took me so long to think of it total tilt angle of the switch by this will not be altered.
I cannot tell you if the mercury ones will work in the same way but if you try a glass one you can see for yourself.
tilt it as slow as you can and see if it snaps cleanly away, the switch position ideally is dead centre of the drum shaft.
I like the Idea of the MLX positioner as well , as long as the program will fit on the Picaxe, I looked into the multiaxis ones and they need a lot of room on an CPU for their operation, way more than a small picaxe.
Do not take my word for it, look into it first.
As a famous waiter used to say " I know nothing ".


Regards,
Dave.

PS. put a small 10 to 22nF cap across the contact to divert current momentarily when it breaks.
 
Last edited:

Rampz

Well-known member
I can't find any documents online that speak of electrolyic action being a problem in ball type tilt switches, but there is a whole range of electrolytic tilt sensors that are multi pin and use an internal liquid and an ac supply is needed with a frequency between 25hz and 4000hz depending on the model, in the code above by Hippy any idea what the hz of the polarity changing could be? This is a possible route too
 

David_Reynolds

Well-known member
I can't find any documents online that speak of electrolyic action being a problem in ball type tilt switches, but there is a whole range of electrolytic tilt sensors that are multi pin and use an internal liquid and an ac supply is needed with a frequency between 25hz and 4000hz depending on the model, in the code above by Hippy any idea what the hz of the polarity changing could be? This is a possible route too
Hi Rampz did you catch my previous note.
 
Top