need counter project - slightly OT

Started by Thomas P., October 15, 2003, 04:57:10 AM

Previous topic - Next topic

Thomas P.

I'll build a little winding machine to wind Wah-inductors. What I need is a small counter project to count the turns if already got during the job.
If anyone knows one it would be great.

thanks
god said...
∇ ⋅ D = ρ
∇ x E = - ∂B/∂t
∇ ⋅ B = 0
∇ x H = ∂D/∂t + j
...and then there was light

Paul Perry (Frostwave)

Seeing the ingenious wah rockers people here have made, it must be possible to convert a pedometer! (one rotation via cam gives one 'step').

Thomas P.

god said...
∇ ⋅ D = ρ
∇ x E = - ∂B/∂t
∇ ⋅ B = 0
∇ x H = ∂D/∂t + j
...and then there was light

Thomas P.

Oh - now I got it :oops:
I should have used the dictionary before posting :wink:

I not quite sure if this works. The one I've got counts by the up/down movement during a walk. Since my machine only rotates I can't see how it should interact with the pedometer (except if I have a small stick slapping it every rotation).

Regards,
tomboy
god said...
∇ ⋅ D = ρ
∇ x E = - ∂B/∂t
∇ ⋅ B = 0
∇ x H = ∂D/∂t + j
...and then there was light

Mike Burgundy

can be done with discrete ports even, but why not use a LED/LDR combo and a PIC plus simple display?
I reckon that's easier than input/shift-register-counter/BCD converter/display driver in "discrete" packages, especially since we're wanting 3 digits at least. (come to think of it - you could even do without a clock on the discrete one if you keep in mind it'll be a certain number of turns behind depending on circuit design)

Peter Snowberg

There are many electromechanical counters out there, but I don't think they will be fast enough unless you ran you winder very very very slowly.

There are ready-made digital counter modules and that will be your easiest and most inexpensive option if you can find them surplus. I don't have the link anymore, but I recently saw these counters at one surplus supplier for $6US.

If you cannot find such a counter module, a PIC and LCD would be the easiest. Of course this is not much of an option if you don't already program PICs.

I looked at the descrete logic way of doing this and it would be large task. You build most of an LED clock in the process. I would use a 555 to condition the signal (one pulse per rotation from a reed switch or Hall sensor), and then use BCD counters (like the 74LS192) to measure the turns. If you want to go over 9999 turns, use 20 bits, otherwise you need 16 BCD bits. You can then take those 4 (or 5) four bit BCD numbers and feed them to displays with built-in BCD decoders, or to decoder/driver chips (like the 7448) and then to regular LED displays.


Good luck with your winder! :D

-Peter
Eschew paradigm obfuscation

Thomas P.

Well, seems like you knew it - I don't program PICs :(

But the method with the BCD is quite interesting! Maybe you can tell me more?
god said...
∇ ⋅ D = ρ
∇ x E = - ∂B/∂t
∇ ⋅ B = 0
∇ x H = ∂D/∂t + j
...and then there was light

Paul Perry (Frostwave)

If you are running at high speed, you could use a bicycle odometer. These sometimes trigger via a magnet that goes past each rev. You could put a magnet on your shaft (?!) and see how many turns correspond to a yard, or whatever the bike odometer is calibrated in.
Easier than maing a cam whack your pedometer :)

Peter Snowberg

More? OK. :D

First: power this whole circuit from a regulated +5V supply. Even a 7805 regulator and two caps will work fine for this.

I would use a reed switch and magnet to count the actual rotations.

That would feed into the trigger of a 555 monostable multivibrator to give you a clean pulse. You will have to play a little the timing constant (one resistor and one cap) to match your setup, but the example values should work just fine. Here is info on that circuit:

http://www.visionics.ee/curriculum/Experiments/555%20Monostable/555%20Monostable1.html

Take the output from pin 3 of the 555 and feed that to the clock input of the first 74LS192. You will need one 74LS192 for each digit in your counter. That chip has a carry output which you then connect to the clock input of the next 74LS192. Connect them all in the manner, one after the next.

You will need to wire all the counter reset lines together and then wire this to a "zero" switch to reset your counter. You also have to ground the preset inputs.

Each of those counter chips will have four bits of output in BCD (binary coded decimal) format. There are displays with internal BCD converters, but they are expensive if you don't find them surplus. You will probably have better luck using regular 7 segment LEDs and then using a 7448 (or similar) to convert the BCD signals into 7-segment patterns.

That is all there is to it. The data sheets I linked to above should tell you the rest of what you need to know about using these chips.

I would build at least two digits of the counter on a breadboard before soldering anything.

Final parts list:
1 - 7805 regulator
1 - 555 timer
1 - reed switch and magnet
4 - 74LS192 BCD up/down counters
4 - 7448 BCD to 7 segment display drivers
4 - 7 segment displays (I don't remember if the 7448 wants common anode or cathode)
1  - reset pushbutton switch

You will also need resistors for the displays (probably ~470 to 680 ohms, 28 pieces), decoupling caps for each chip (100nF is perfect), a 10K pull-up resistor for the reset switch, and a resistors with 2 caps for the 555 circuit. (values of 10K and 100nF)

That is all. 8)

Good luck! :D

-Peter
Eschew paradigm obfuscation

Thomas P.

Wow - that was fast :D

Thanks for that!!!

In the meantime I've found a kit from a german supplier based on PIC. It's very comfortable since it can be programmed and can turn-off.
Bad news - costs 50 bucks.
god said...
∇ ⋅ D = ρ
∇ x E = - ∂B/∂t
∇ ⋅ B = 0
∇ x H = ∂D/∂t + j
...and then there was light

Thomas P.

Quote from: Peter Snowberg4 - 74LS192 BCD up/down counters
4 - 7448 BCD to 7 segment display drivers

I checked some of my suppliers and I can't find these two chips. Is there a difference in code between us and europe?
Ordinary 74-types are 74HCxxx or 74HCTxxx.

Regards,
tomboy
god said...
∇ ⋅ D = ρ
∇ x E = - ∂B/∂t
∇ ⋅ B = 0
∇ x H = ∂D/∂t + j
...and then there was light

Peter Snowberg

The 7448 is an older chip so you won't find them made in the HC or HCT flavors. The 74192 is available in HCT, but may be rare.

74LSxxx is the most common here at least in 1970s-80s equipment. There are many other families too, 74xxx (the original), 74Sxxx, 74Fxxx, and on and on it goes. The HC and HCT mean High-speed CMOS, and High-speed CMOS with TTL switching levels.

Two ways for you to go here.

(1) Anonomousexperimentalist (Colin) has been buying parts on eBay and reselling them here for amazingly good prices. In his parts are many TTL chips and I would not be surprised if he had everything you needed except the displays. You might be the only one to need these chips for a very long time. Not many people are building vintage digital thanks to the ease of PICs. Leave him a message in one of his eBay threads.

(2) You could use different chips with the same function.

I just found the CD4026B which says it is a BCD counter with 7 segment decoder built in 8). That would replace both chips. The CD4033B seems to be about the same. Hey wait....

:arrow: 74C925 - 74C926
http://www.fairchildsemi.com/pf/MM/MM74C926.html

WOW! Perfect chip for you. It will drive 4 digits using the single chip, 7 resistors and four NPN transistors (2N2222, etc.).  If you don't have over 4 digits, either will work fine. If you want to add a 5th digit, you will need the 74C926 because it has the carry output.

You could use any BCD up counter with a carry output as the counting chip. There are multiple choices for chips if you use 4000 series CMOS, but I would try to find the 74C926. That will make things very easy.

Now the question is can you find one or two? The very good news is that this is a current chip and you can actually request samples at Fairchild's web site. :D

-Peter
Eschew paradigm obfuscation

R.G.

It's simpler than all that.

Go find yourself a four function calculator that you don't mind trashing.

They can be found free.

Open it up, find the "+" key's contacts, and bring those outside the case on two wires. close the calculator back up.

Arrange for your winder to make a switch close once per revolution. This can be a reed switch, microswitch, anything that gives you one metal contact switch closing once per revolution.

Now, set up your winder, turn on the calculator, and on the calculator enter "0+1=" almost every calculator ever made will leave "1" in the accumulator and add it again with each "+" key make. Run your winder, the calculator counts. You can manually adjust the count on the calc if you have to.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Peter Snowberg

R.G., that solution is poetry. 8) 8) 8)

-Peter
Eschew paradigm obfuscation

Ansil


Thomas P.

R.G. you're a genius!!!

This is absolutely perfect since it is a good point to start my experimentations.

But I'm still into Peter's method since I like to know more about that logic-thing. So far I tried to simulate it but there are some more things about the setting of those chips that I don't know yet (maybe I just forgot to turn some pin low etc.).

Thanks to all those who helped me and to those who will :wink:
god said...
∇ ⋅ D = ρ
∇ x E = - ∂B/∂t
∇ ⋅ B = 0
∇ x H = ∂D/∂t + j
...and then there was light