My student and I have designed our bumpers where the ball connects the two terminals, triggering a transistor and the solenoid fires, pushing the ball away.
The bumper works when you use a button to fire the solenoid but doesn’t work when the ball is used to connect the terminals as the ball is not in connection with the terminals for long enough to make the solenoid fire completely. The ball gets shot out, connection is broken and the solenoid stops pulling down, meaning that the ball often gets jammed or very weakly shot out.
As I said before, my knowledge of electronics is simplistic at best. Is there some way that we can make the solenoid fire for slightly longer despite the ‘button’ no longer being pressed? Is there some sort of capacitor or something that will do the job?
Thanks very much,
You could use a 555 timer for this purpose:
Let us know whether you think you’re up to that and we can go into more detail
A circuit showing how you are driving the solenoid would be useful (read essential) here.
The solenoid is being driven by a Tip 120 transistor that is ‘grounding’ the 12V power supply to the solenoid. The Tip 120 is being ‘triggered’ by a ‘switch’ that is closed when both terminals are connected by the metal ball. The problem is that the metal ball is not there for long enough to pull the solenoid down hard.
This may do what I need it to. The one shot LED timer on that page looks about right. Would it be able to supply the required current?
There is one basic problem here. From your circuit above the transistor is switched ON with s positive voltage applied to R7 and thus the base. A 555 timer requires a GROUND on the trigger input to start the timer, the other way around.
What you need is somehow grab that momentary positive pulse and extend it. Could be a bit tricky. The first thing that probably comes to mind is a capacitor but from what you say the pulse would not be there long enough to charge it so I think that idea is out.
Will have to think about that one. The solenoid will have a finite time to operate, do you know what that is.
Thanks for the advice. Yes I am pretty sure you are right. Sending 5V through the resistor to the transistor when the switch is closed by the ball.
The solenoid would only need to pull down for about 0.2 of a second longer than it currently is. The ball would move away pretty quickly.
If I were to try a capacitor, where would it go in the circuit? Across the solenoid? Can I damage the circuit if I put it in the wrong way? What value / type of capacitor would be the most likely suspect?
A capacitor will not do this. It can work to do things like delay the release of a relay or solenoid but is usually got to be quite large due to the relatively low coil resistance in these devices. For this to work a cap has to be charged fully then will discharge slowly through the coil until the device releases. In your case a capacitor of any size will not have time to charge.
I have an idea that might work which I will post later today as I just don’t have time right now.
I don’t suppose you know just how long the ON pulse you get from the ball contact do you ??? It would be pretty useful. My idea depends on it being long enough to turn on a Mosfet. Mosfets have a sneaky little property that we might be able to use here.
Talk soon. Cheers Bob
Thanks for your reply. I can see where your head is at and from your description of how a capacitor works, it may work if I can get the ball to stay in contact for longer before the solenoid fires.
I may be able to change the design of the bumper so that the bumper ‘catches’ the ball and makes it stay there for longer, charging the capacitor and lengthening the time the solenoid is pulled down for. From it’s behaviour in testing, I think I just need another 1/10th of a second or something like that to ensure the solenoid pulls all the way. There can’t possibly be much more time needed than that.
At the moment, I have no real way of determining the time that the ball is in contact with the bumper but it fires upon contact and so it would be very fast. I would think the ball is only there for 1/10th of a second.
Keen to try any solutions you can think of
In electronics 1/10th of a second is a very long time, 100milliseconds (mSec). To put it into perspective 240V mains frequency is 50Hz, that is a period of 20mSec and is considered to be veeerrrrrrryyy slow.
More info pls.
Is this 5V or 12V. A more complete circuit would be good.
Also need to know the value of R7 and the DC resistance of the solenoid coil.
Where did this transistor come from, likewise the 15KEXX. The transistor is a 50Mhz power amplifier and the 15KE is a transient voltage suppressor (sort of a zener diode), the XX part I think is the breakdown voltage. Neither device really designed for this job.
Did you build this bit up or purchase a module. If you built it this could do with some changes. Like replace the transistor with a Mosfet and the 15KE thing with a schottky diode. Would make extending the ON time a bit easier and less messy too.
Also need to know the current capability of the 5V supply if the ball actually switches 5V
The solenoids are 12V. I have a voltage regulator bringing it down to 5V to supply a bit smoother power to power the arduino.
R7 is 1K. Don’t know the resistance of the solenoid. The transistor is a Tip 120. Nevemind the labels on the diagram. I just used whatever looked right in the Fusion 360 library. The diode is not a schottly diode but all of these things can be switched out. I got 10 boards made on PCB way. We have made one prototype where everything works, except this problem of the solenoid not staying on for long enough and that’s where we’re at.
It may be very simplistic of me but the timer James suggested if it works on being ‘grounded’, isn’t that what is happening with the transistor? Could we tap into that somehow?
The supply we are using is a 12V 1 amp but in relation to the switches, that power runs through the voltage regulator which is the standard LM7805.
I have done my best to get a good schematic diagram of the system. It has 4 bumpers, 2 lights, LCD screen and an MP3 module all running through an Arduino Mega. I understand that it is not technically correct and has lots of flaws but as long as it works while the markers are marking it, I don’t really care.
I am not going to conduct a course on 555 timers.
That is exactly what it says. A momentary ground gas to be applied to the trigger input (pin2) to start the timing sequence.
Sort of, there is a fair voltage drop between emitter and collector of that transistor. This drop in a Mosfet is only millivolts which makes them more suitable for that application.
Don’t quite see how and the output current of a 555 is somewhat limited.
I am going to suggest changing that transistor for a Mosfet. I am sure it is a drop in fit and device elements coincide, G = Base, S = Emitter and D = Collector. The value of R7 might change as we have to have time to charge a capacitor. The R and C to be added. The idea is to delay the gate discharge and give the solenoid more operating time.
This is going to be a bit trial and error. Give me a bit and I will come up with some values for R7 and R and R and C. R might be pretty large as we have to charge quick and discharge slowly. As you seem to have another transistor hanging off the same connection (which is quite important and you failed to show earlier) we will probably have to use a diode to prevent discharge of C down that path.
Give me a bit of time and I will see if I can come up with some values to try.
You also say the diode across the solenoid is not as shown. Well what the hell is it. It should be a schottky. Please get out of this habit of presenting a circuit which is not accurate IN ALL RESPECTS this includes devices and values. for instance the terminal blocs are marked 3A/250V. This had me confused a bit as I related this to the solenoid. I now realise it is just the rating of the terminal block itself and has nothing to do with the matter in hand.
I think presenting documents like this is not going to get too many marks from the examiners. Could even get you a fail.
The parts used are almost all correct. Fusion 360 has libraries of components and when I couldn’t find the correct component, I just substituted one that had the correct hole pattern so the PCBs could be made. This is what leads to the circuit being ‘incorrect’, that and the fact that I don’t actually know what I am doing. I understand this could be misleading but to a novice, this is very complicated and daunting.
I couldn’t get the schottky diodes from our supplier so they gave me an IN4001. They said that they will work for our little solenoids. If I can get the schottky diodes to replace those from somewhere else then I will.
Yes the terminal blocks are just being used to connect the power to the board and the MP3 module. It is designed to be plug and play for Year 7 students.
In terms of getting marks from the examiners, I am a design and technology teacher with over 20 years experience. My students have come 1st, 3rd, 5th, 6th, 7th and 10th in the state over the years and we are generally 10-15% above state average so I am aware of what the markers are looking for. This particular project is one of the most complicated we’ve attempted so if it works and her folio tells the story well, she should get very good marks. Just need these bumpers to be more effective by pulling down for what is, as you pointed out, an eternity in electronics terms.
A bit slow but so are solenoids so should be OK for you. I personally would use schottkys to be on the safe side but these should be ok.
The word “almost” is what I am on about. What you have done by substituting to enable a board layout is all good but when you post a circuit the part numbers and values etc can be edited and the correct ones inserted. You can call any part what you like on the printed sheet. Makes no difference to the PCB files. Even some notes on the printed page would be of some help.
Regarding teaching. I really do appreciate what you are trying to do and take my hat off to you and your fellow educators. If I were looking for a profession in today’s climate I would have to think long and hard before I selected teaching. Probably would not have the patience.
BUT, that does not help things at this end if the information provided is not accurate or there is not enough of it. If the person trying to help has to rely on too much guesswork and make many assumptions (it is a sure thing that some will be wrong) getting a meaningful result can take quite a long time with a fair share of frustration.
Getting to your problem. A Mosfet has what can be a very useful trait. There is a small capacitance between source and gate. When a voltage is applied to the gate this cap charges up. When the voltage is removed this charge remains and the input resistance of the Mosfet is so high it will not discharge this cap and the device will stay ON for a very long time. Even if powered OFF then later powered ON again the Mosfet will still be ON. This condition could be there for weeks or longer. This cap is normally discharged with a resistor of about 10k from gate to ground (normally Source).
My idea would be to use this effect in a controlled manner by fitting an external cap and discharging resistor. The idea that the Mosfet would stay conducting enough until the voltage gets down to about gate threshold level, something a bit less than 2V for a “logic level” Mosfet. For a charge of 5V this would be about 1 time constant where the charge would reduce to 36.8% of initial value in this time. This would be R and C on that little circuit. You estimate you want 0.1Sec, That equates to an R/C combination of 1MΩ and 0.1µF. Now we have to have time to charge this cap which will take 5 time constants. Charging is via R7, 1k so 5 time constants would be 0.5mSec so the ball would have to stay in contact for this time which I think would not happen. We can reduce R7 to 100Ω then the 5 time constants would be 0.05mSec which would give C that much more time to charge. The thing to remember here is that the instant of switch on when the ball makes contact this C is a short circuit to ground. R7 being 100Ω will limit this “inrush” current to 50mA which should be safe enough. A diode will be required in series with R7 and I think this SHOULD be a schottky as we don’t want to miss any of that precious plus from the ball contacts.
So my first try would be Mosfet STP36NF06L, C = 0.1µF (100nF), R = 1MΩ and for the series diode 1N5819. R7 = 100Ω. Try this, if C does not charge enough it might have to be reduced to maybe 0.01µF in which case R has to increase to 10MΩ But that is getting large enough to have other funny problems.
If this does not work things might get messy, I am trying to get as simple as possible with minimum components. That Mosfet will go straight in where the transistor is now. Connections are the same.
All you can do is try
Edit: C should = 0.1µF. Have changed text above. Bob
The Mosfet / timing solution I posted above could be a bit hit and miss. The whole thing depends on being able to fully charge C. This is a bit up in he air as the duration of the pulse produced by the ball hitting the target is unknown.
The use of a 555 timer to “stretch” this pulse as James suggested would be more predictable and controllable so I have come up with an alternative circuit.
This has a few more bits but only depends on the button pulse being long enough to trigger the 555. This requirement should be easily met as it only requires a pulse in the order of a couple of µSec to trigger.
A bit of a down side is the requirement to have a trigger pulse to ground. This is OK as all that has to be done is connect the common of all the switches to ground instead of +5V. This circuit then simplify interfaces between the actual button and where the button would normally connect. In other words this circuit becomes what is at the moment the button output point.
The timing components can have the same value as the Mosfet circuit. The above timing components are R1 and C1. R1 = 1MΩ and C1 = 0.1µF will give you an output pulse of 0.11Sec. I suggest if you want to shorten this time you lower R1 value and if you want to increase it increase C1 value. The formulas are on the circuit and as you can see this arrangement could be a lot more predictable than the Mosfet circuit (which would be OK if we could guarantee the C charging time was long enough) and easily tailored to suit
Your suggested time of 0.1Sec seems a bit long and you may be able to shorten it a bit. Keep in mind it will take a finite time for the solenoid to operate and release and this could be several mSec. Without the data sheet and not knowing what model solenoid you have used that is unknown.
You have said the whole system works except for the too short pulse from the ball switch (button) so you should not have to change anything except for remove the switch commons from 5V and reconnect to ground. Connect the actual button to the circuit trigger point then the output becomes what would have been the button pulse but now “stretched”.
What value are the “pull down” resistors like R2, R3, R4 etc. They don’t want to be too low or low enough to worry the 555 output. I would think about 10k would be enough . The 555 can source about 150mA but it is advisable to keep it pretty well below that. The 1k base resistors will limit the base current to something like 4.5mA each and there are 2 of those and the pull down is effectively in parallel with these so the 555 output should cope OK. The Arduino input current should be negligible
Something else to think about.
Thanks for your excellent work on this!
I think this solution is more bulletproof and extending the pulse using a timer is likely to get the job done.
I do have an issue with the button wiring and the way that the system interfaces with the arduino though.
In addition to triggering the solenoids to fire, the buttons also tell the arduino that they’ve been hit and they add points to the LCD scoreboard. Wiring them to ground, to the best of my knowledge, would prevent that part of the system from working. Everything I’ve seen on button wiring for arduino seems to have 5v going to it.
It did, however, make me think of an entirely different solution.
The arduino, once triggered to add points to the scoreboard by the ball closing the switch could also then be told to output 5v at a pin for a certain period of time. If that pin was connected to where the button is sending 5v to the resistor then the transistor, I think the pulse would be extended for the delay time and that would make the solenoid pull down for as long as the delay is set.
I am going to try that out in isolation on a breadboard today. It will rely on the arduino working fast enough but it is definitely worth a test. If that doesn’t work, I will create your circuit on a breadboard and ‘insert’ it into the system. If that works, it is likely to be easiest at this point to create it on a piece of veroboard and attach it to the bumpers themselves. I am trying to avoid having to remake the PCBs but that may be inevitable.
Fortunately her project deadline is still a few months away so we have time to fix it.
Thanks for your work on this project. I and my student really appreciate it. If the arduino method doesn’t work, I’ll order the parts needed asap.
Arduino inputs can be wired either way. If you wire them so that they are switched to ground then you can use the internal pullups to set them high when the switch is open. If they are switched to high then you need the pull-down resistors to ground so they are held low when the switch is open. So wiring them for a ground connection is actually simpler.
I think this is by far the best solution. There are plenty of pins available on the Mega. It has the advantage that you can very easily adjust the delay to suit the relays.
Timing is unlikely to be a problem unless there is some other activity that consumes a lot of time for the Mega.
Some delay between receiving the signal and firing the solenoid is acceptable - the ball does not have to be still in contact with the bumper for it to be pushed. However too much of a delay will result in a drop in the push force that the solenoid can apply because the ball will have recoiled to a greater distance. Also, the delay should not vary too much, because the direction in which the ball is pushed is affected by its distance from the bumper at the moment of contact. Both issues can be addressed by using interrupts to handle the switch inputs. The code to fire the solenoid is short enough to include in the interrupt service routine. Other processes related to the switch, such as updating the display and sounding the bell, should be controlled by a flag that is set in the ISR and then checked later when the CPU finishes the loop. Minimising the processing at the time of interrupt ensures that the ISR does not affect other processes, such as creating a flicker in a display update that is occurring at the time.
If you re read and study that 555 circuit carefully you are not taking the Arduino pins to ground. You are simply replacing the existing button 5V with the 555 output which is also 5V or whatever voltage you use on the 555 (which in your case would be 5V). You only have to take the existing button “common” connection from 5V and connect to ground. ALL of what is now connected to the button “output” will now connect to 555 output (pin 3). There should be no need to change anything except for button wiring.
If you get a PCB right first time you would be considered something of a magician.