Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Using pulses from a quartz clock to drive a solenoid... unexpected behaviour

Status
Not open for further replies.
OK, here's the deal.
First of all, the typical saturation voltage of ULN2803 is 1.3V, so your solenoid will only get (6-1.3)=4.7V across it. Assuming this is enough to pull it in, you need to make the following changes:
1. Since the collector current will be ≈4.7V/12Ω ≈400mA, and the minimum beta of the 2803 is 1000, you will need at least 400uA of base current. Since Vin≈3V, change R2 to (6-Vin)/350uA=7.5k.
2. U1 only needs to sink the current through R2, so the input current would calculate out to be about 600nA, but due to the internal resistors un the 2803, the threshold current is about 80uA, so R3 has to provide more than that. I would make R3=22k to ensure enough input drive to U2.
3. To allow Q1 and Q2 to sink the current through R3, change R1 and R4 to 33k each.

Summary:
R1=R4=33k
R2=7.5k
R3=22k

I think it will work. If you only need half the pulse rate, get rid of Q1 or Q2.
 
Last edited:
clock driver

I have used the odd quartz clock drive circuits too.
When the clock stepper motor is disconnected I usually fit a 1 kΩ resistor across the driver terminals.

Also I have succesfully used a small output TX from an old radio and used it as a step up TX to give me more voltage swing to trigger a driver transistor.
( off memory that was a 500Ω / 1kΩ centre tap TX. that one triggers one of my home made 4.19 MHz TTL clocks since 1990 and still works well. )
 
Brilliant Ron! Even at 4.5v it works ok, but at ~6v it fires every time.

Solenoid stepping circuit | Flickr - Photo Sharing!

This is really good Ron and Mike, thanks very much for all your help. And incredibly, I actually understand some of how it works too - thank you for showing your working out too Ron, really appreciate it. I used just one transistor to get a pulse every 2 seconds.

I have a 74HCT390E dual decade ripple counter (CD74HCT390EE4 pdf, CD74HCT390EE4 description, CD74HCT390EE4 datasheets, CD74HCT390EE4 view ::: ALLDATASHEET :::) that I have tried using to tot up the pulses into minutes-worth. Now I've wired up the counter, and my logic is sound because I've got eight LEDs lighting up in the correct sequence. Initially I tried taking the pulses directly from the clock module, and was surprised when this worked - I hadn't expected it to have enough juice to trigger the counter. However it often jumped and did two ticks at a time... Could that be a circuit in need of a pull up resistor? That was running the supply at 4.5v. Putting it up to to 6.3v (I've got a variable voltage supply.. the increments are a bit haphazard) made that not work at all - each pulse seemed to advance the counter by half a dozen or more. HOWEVER, the pulse coming from U1 was beautifully stable and doesn't skip anywhere.

RIGHT, that's great, I've got my little set of lights counting up to 99, being driven by U1, and the solenoid is clicking alongside. What I need next is an OR that will reset the counter when the 2 least significant bits of the second counter goes positive (hits decimal 30), and also feed the pulse into U2 to trigger the solenoid. I said that as if I knew what I was talking about?... I'm going to sleep on this tonight. My initial tests suggest to me that the trigger that comes from the pins of the counter can be used to reset itself (like when the "20" pin goes high), but it's such a short pulse that I can't measure it, and it can't also trigger U2 and the solenoid. If I wire U2 to a non-resetting output then it is happy to energise the solenoid as long as that digit is on, so it does have enough juice.

Should I have something else (555?) that get's triggered by a counter pin going high (signifying 30), and that fires a pulse to U2 and also back to the counter to reset it? Am I reinventing the wheel? I suppose it should actually be triggered by the 2x pin going low, rather than the 3x pair going high.

Rodalco - I read on another thread that it was reckoned that removing all the bits of the stepper motor threw the crystal off by a little bit - is the resistor across the terminals just to simulate the load of the coil? Would there be any harm in leaving the coil attached? Just wondering if it's worth it for the sake of accuracy.


Thank you all very much, it's incredibly helpful and generous!

cheers
Sandy Noble
 
If you want help with your counter, you need to be concise about what you want to accomplish. Your last post was rambling and confusing, at least to me.
 
Ok Ron, sorry about that, I was thinking out loud and it was getting late. I'm going to do some more work on this and maybe I'll get it sorted myself... But if not I'll be clearer!

Cheers Rodalco! I was very please to hear that click!
 
Further developments - counters, monostable 555s and grounding?

Hello again, I have done some more work on this myself, but am once again at an impasse, and I wonder if anyone would be good enough to cast an eye over my schematic, and see what I'm doing wrong!

**broken link removed**


I have added a 74HCT390E dual decade ripple counter, that I am using to count up to 30 (30 pulses per minute from the clock module). This much works ok, except that I'm confused about how to handle the reset. I anticipated using an AND of some sort on QA and QB of the second decade counter, and feeding that back into the reset of that counter. While trying to get this to work, I rigged it to reset every 40 pulses instead (just to see if it worked at all) by wiring the reset to QC and that works.

I added a monostable 555 circuit that it triggered by the falling edge of a pulse, and this is connected to the output of QC, so that the same falling edge triggers the reset and also triggers the 555 to fire a pulse. This pulse in the diagram lights an LED, but it would eventually fire the solenoid, I'm guessing via one of the channels of the 2803.

The problem:
I have tested triggering the 555 using the QA pin of the first counter, which means it should trigger every 4 seconds (2 seconds high then 2 seconds low). And it does fire when the pulse goes low, and the pulse from the 555 is the right length, but it upsets the rest of the circuit badly as long as the pulse is on. When I use it to trigger the solenoid, then the counter goes really fast (it's trigger signal is like noise I think) for the length of time that the solenoid is energised. When I disconnect the solenoid and just trigger the LED alone, then it does something similar, but it just jumps one pulse ahead when the LED is first lit.

I don't really understand what's happening at this stage, superficially it seems like the counter is disconnected, or it's signal is swamped when the solenoid is drawing current. I thought it might be a problem to do with sharing the 2803 package (driving the solenoid) because it was more obvious then, but it still seems to happen when driving just an LED, but only when it very first lights. It is stable for the rest of the half a second or so that it's lit.

How to trigger the reset is another problem, but I guess that is more straightforward.

I hope someone can drop some knowledge! Thanks!
 
Last edited:
Some confusion about the 5V/6V supply??? The counter cannot run on 6V. The 555 cant have its RESET wired to 6V while the VCC is at 5V???
 
Hi Mike, thanks for your reply, ahem, the voltage difference was an error on my part, the supply voltage is common to the whole circuit at about 6.13v. I also hadn't realised that the HCT used a lower supply voltage either, so I've added a resistor to the +v for the counter that brings the voltage down to 4.8v.

Not sure if I was clear before, if I power the solenoid directly with the pulse from the 555, then it seems to work ok, in that the pulse is the right length and the counter progresses as it aught to, during, before, and after the actuation, except that it's inverted. That is, the solenoid is energised continuously, and only goes limp for half a second. I understand why that is (I think? - because only during the pulse is a parallel circuit made through the 555 that is of a lower impedance than the solenoid?), and hoped I could use one of the channels of the 2803 to do it properly.

I have also tried using a discrete NPN transistor (3904) instead of the darlington pair package, with the same result.
oscilloscope2.jpg

I have rigged my arduino as a little scope, and here is a couple of screen grabs showing the voltage I see going into the clock input pin of my counter, and also the voltage on the QA pin of the first counter (oscilloscope1.jpg). It's right-to-left. Whenever the 555 circuit triggers the solenoid there's another little peak or trough as long as it's on. It's during this pulse that the counter is going crazy. Measuring the supply voltage to the counter shows me that there's a corresponding dip in voltage to about 4v while the solenoid is energised.

Is this a supply conditioning / isolation from the big draw of the solenoid type thing? Hopefully I have explained a little more clearly now. I am getting a clearer picture too, I think. Perhaps the counter is effectively being turned off, and when it comes back on, then it's lost count, or has counted randomly?

Thanks again, it's very much appreciated!
 
Last edited:
LM555 creates a huge current spike on the power supply every time it switches. You should have a 10-100uF cap from vcc to ground on the 555, in parallel with a 100nF. You should also have a 100nF cap from each IC's vcc to ground. These 100nF caps need to have short leads, and be connected as close as possible to the IC's power pins.
The spike from the 555 is probably the cause of your malfunctions.
 
BTW, your resistor-sharing scheme for the LEDs won't work, because the LED input voltages aren't mutually exclusive. You also can't get much drive current directly from HCT. If you want more than about 5mA, you should use transistor drivers.
Also, the ULN2803 clock buffer is unnecessary, and has marginal logic "0" levels. You can drive the HCT390 clock directly from your NPN collector. The phase doesn't matter.
 
Hi Roy, that's brilliant, thanks for the help - I added caps of almost the right values in the places you suggested, and that almost fixed it - but then I noticed that the trigger circuit I'd followed specified a polarised 47uF cap across the supply rails, and I'd not added it. Probably because I didn't have one, but I tried a 10uF electrolytic and it worked! I will try to get a 47uF one for later.

So thank you, that was really helpful indeed. I always wondered what all the caps were for - I guess that's decoupling?

I know the resistor sharing on the LEDs isn't very clever, it was a pragmatic choice based on the number of resistors of a particular value I had handy. I never intended to have the LEDs as part of the circuit actually, but added them for diagnostic purposes. Now I think I will make them a permanent part, or switchable-onable for in-place diagnostics at least. I also wondered whether the 2803 was necessary in this current configuration. I had tested the circuit without it in the past, but for some reason concluded that I did need it - I think it was before I added the 555 part though.

Right! The resetting has got me a bit confused (you'll be surprised by that, no doubt). I have wired between the 555 trigger and the QB pin (which is high during ticks 20-39) of counter2, and made an AND gate from diodes to reset counter2 when QA and QB both go high (ie when 30 is reached). When counter2 is reset, then QB will go low and trigger the 555. I'll update my diagram tonight if it's useful.

At least that was my theory... What actually happens is that while QB is lit and approaching 30 ticks, instead of QA lighting as well, then it skips straight to QC and QB being lit. If I disconnect the reset, then the AND gate does correctly go high while QA and QB are on, but when it is low it's still registering about half a volt.

Thanks again!
 
Last edited:
Update your schematic to reflect exactly what you have - including decoupling caps, LEDs, LED current limiting resistors, the AND gate, etc.
 
Thanks Ron, This is the whole circuit now


That circuit is what I thought would work, and it doesn't. The counters run fine and reset at the right times, but the solenoid never fires. I think I can kind of see why.

If I attach the 555 input to the output of the AND gate, then it runs rather erratic. The QB pin on the counter2 does not light at all - QC lights instead, and the counter resets after QA and QC have lit. The solenoid rarely fires, and if it does, I can't see that it was very related to a particular counter state.

If I disconnect the 555 portion of the circuit from the output of the AND gate, then the counters work as expected, QA lights (10-19), then QB (20-29), and then resets on the 30th tick.

I also tried omitting the 2803 for the first stage, but the counter didn't seem able to catch the low pulses, so it's still there for the time being.

Help much appreciated!!
 

Attachments

  • linearclock2.gif
    linearclock2.gif
    26.2 KB · Views: 167
Last edited:
R11 does not seem like a good idea, as the supply to the LEDs has to come through that. I suggest that you link that out, and I would assume that with it in there the brightness of the LEDs depends heavily on how many are lit.

That could also be compromising the triggering of the 555
 
Thanks Ron I'll give that a shot tonight!

Diver, Not sure what you mean by link it [R11] out? - I added R11 in there to reduce the voltage to less than 5.5v (the counter's supply limit), but appreciate that my simplistic solution is probably not the best!

I am also interested in knowing if I've over-complicated the design. I would, eventually like to have this powered by batteries (4x C- or D-cells probably), and am concerned if I'm doing something very wasteful (like keeping the 555 powered up in between pulses - although it's not really doing anything). The solenoid will be pinging every minute.

cheers guys, really appreciated.
 
By linking it out, I mean replace it with a link. If I had said remove it, that could have implied that I was suggesting removing any feed to the IC.

Using a resistor to reduce the voltage is a very bad way of doing it, because the voltage dropped by the resistor depends on the current through it, and the current through it will vary from practically nothing to quite a lot when several LEDs are on.

If your 6 V is regulated, you could almost certainly get away with a link. The 74HCT390 is rated at 4.5 to 5.5 V, while the 74HC390 is rated at 2 - 6 V. The input voltage levels of the 74HCT390 are supposed to meet TTL levels, and outside the 4.5 to 5.5 V they probably won't, but I don't think that you will damage the IC when the nearly identical one is rated to 6 V.

Or just fit a diode that drops about 0.6 V at whatever current goes through it.
 
Right, I see your point Diver. It ran on 6.13v (the output of my regulated psu) apparently happily before without bursting into flames, but I haven't tried it again since adding the decoupling caps. I'll root through and see if I can find a diode I can use.

Thanks!
 
Status
Not open for further replies.

Latest threads

Back
Top