Maker Pro
Maker Pro

Need help building a basic digital counting circuit.

Maveric169

Oct 15, 2014
12
Joined
Oct 15, 2014
Messages
12
Here is what I am trying to do. I have basically a rotating platform (think over-sized turntable) and I need a way to count the number of revolutions it makes up to at least 200. I have tried to find a kit at radioshack and online but they are either 2 digit or are far more complex than what I need (and way too expensive). I need to get this setup ASAP. From reading the forums I know things like this have been asked in the past but sadly most of the links to schematics and parts lists etc are no longer any good. Any help would be great even if it is a link to an existing product or kit.

Thank you again.

William
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Do you need to count partial revolutions, or only complete revolutions?
How fast will the platform spin?
What are you doing with the count? Reaching a set number and doing something, or displaying the current count?
Do you need to adjust the count?
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Hi William and welcome to Electronics Point :)

One simple solution is the CD4026 (aka MC14026, HEF4026) decade counter with built-in seven segment decoder (see http://www.digikey.com/product-detail/en/CD4026BE/296-14260-5-ND/528411). You would need one of these for each digit, along with a common cathode seven-segment display. You could use a three-digit display (see http://www.digikey.com/product-detail/en/LDT-C514RI/67-1425-ND/252629) or three single-digit displays (http://www.digikey.com/product-detail/en/TDSR1060/TDSR1060-ND/4074621).

The 4026 isn't able to supply a lot of current, that's why the single-digit display I linked above s designed to operate at low current. If you need high brightness, you'll need some kind of buffering between the 4026es and the displays.

For design ideas try this image search:

https://www.google.com/search?q=4026+counter+circuit&tbm=isch

There's a four digit counter there that shows you how to cascade them.
 

Maveric169

Oct 15, 2014
12
Joined
Oct 15, 2014
Messages
12
Gryd3- I only need it to count full revolutions.
The max speed the motor can do is 1725rpm so I would say that is the max.
Once the count gets to 200 I will stop the motor, remove the thread, reset the counter and do it again. (I am winding thread on a home built circular spindle.)
And yes I may need to use different counts at sometime.
 

Maveric169

Oct 15, 2014
12
Joined
Oct 15, 2014
Messages
12
Ok, after reviewing the information from the links KrisBlueNZ posted and expanding my google searches I found a few schematics like the one attached that I think I can follow. However, I have a few questions I hope you can still help with. Is there any advantage/disadvantage to using a single 3 digit led display over single digit displays? In the schematic it lists +5V, is that AC or DC? I am guessing it is DC but want to confirm. Lastly, the clock input signal to the first IC (right most), is that where my switch would attach?
Opps, one more question, Do you think a reed switch would work for my application? I could attach a magnet to the underside of the turntable and just mount the reed switch to the frame near it. Are reed switches sensitive enough to work at say 1750rpm?
 

Attachments

  • CD4026.jpg
    CD4026.jpg
    79.7 KB · Views: 802

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Pretty much everything you find will be DC. you can confirm by looking at the data sheet for any ICs you wish to use.
The reed switch will operate fine.

This would be a more manual method requiring you to hit stop when it reaches your number, but 3 segments will track 999 turns at a time.
I was under the impression you wanted to automatically stop the motor when the pre-determined count is reached.
If you want to do it manually, a circuit like you posted is fine.
 

Maveric169

Oct 15, 2014
12
Joined
Oct 15, 2014
Messages
12
Gryd3- Great to hear. Can you shed any light on these questions.

Is there any advantage/disadvantage to using a single 3 digit led display over single digit displays?

Lastly, the clock input signal to the first IC (right most), is that where my switch would attach?
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Is there any advantage/disadvantage to using a single 3 digit led display over single digit displays?
If you want high brightness, it's best to use the single ones, simply because the low-current LED option isn't available on the three-digit displays. Otherwise either one is fine, but the digits have to have all of their pins brought out. Some multiple-digit displays must be driven by multiplexing. These could be used with three CD4026es but only with a lot of extra stuff. So make sure any multi-digit displays you consider have three independent common cathode digits, and at least 24 pins total.
In the schematic it lists +5V, is that AC or DC? I am guessing it is DC but want to confirm.
Yes, as Gryd3 said.
Lastly, the clock input signal to the first IC (right most), is that where my switch would attach?
Yes, but if it's a mechanical switch you will need to debounce it. There are various ways; your best option would involve adding a resistor-capacitor delay cicuit feeding a CD40106 (aka 74C14 or CD4584) to clean up the signal. If you use a Hall sensor you don't need that.
Opps, one more question, Do you think a reed switch would work for my application? I could attach a magnet to the underside of the turntable and just mount the reed switch to the frame near it. Are reed switches sensitive enough to work at say 1750rpm?
I don't know but I'd say you'd be pushing it at 30 pulses per second. I'd go for a Hall sensor instead.
 

Colin Mitchell

Aug 31, 2014
1,416
Joined
Aug 31, 2014
Messages
1,416
"Maveric, don't worry about Colin."
What are you talking abut???

He asked for a kit:

"Any help would be great even if it is a link to an existing product or kit."

A count-down timer is exactly what he needs.

I have been selling these things for 20 years for exactly this purpose.
 

Maveric169

Oct 15, 2014
12
Joined
Oct 15, 2014
Messages
12
KrisBlueNZ- Thank you for that info. I have been researching Hall switches and they make several different types

"(The SS400 Series sensor ICs are small, versatile, digital Hall-effect devices that are operated by the magnetic field from a permanent magnet or an electromagnet, and are designed to respond to alternating North and South poles or to a South pole only. Bipolar, latching and unipolar magnetics are available. )"

I found these here http://www.onlinecomponents.com/hon...9102175-46ae-4828-956c-d1c5b8484c6ccsF2jgQo4O

I also found this here as well

http://www.digikey.com/product-detail/en/SS351AT/480-3610-6-ND/2614378

From my researching I believe I need a unipolar non-latching Hall effect switch. Am I on the right track here?
 
Last edited:

Maveric169

Oct 15, 2014
12
Joined
Oct 15, 2014
Messages
12
Ok, if I have all the components right for this project :confused:, I am planning on using a common bus breadboard (like this one http://www.digikey.com/scripts/DkSe...=635490731477171574&CSRT=13705570705318266456)

Attached is the circuit layout I put together based on the schematic I found online (also attached), can you all take a look and see if you notice any issues?

I know using a common bus breadboard will be a lot of work to break all the unwanted traces, however, I didn't really see much options considering the number of wires I will need to solder for this. I just figured it would make it easier to separate the wiring better, and the real fancy common bus boards are really expensive not to mention having a circuit board made is outrageous.

I also posted my parts list in attachment.
 

Attachments

  • CD4026.jpg
    CD4026.jpg
    79.7 KB · Views: 319
  • breadboard-circuit-design.jpg
    breadboard-circuit-design.jpg
    119.2 KB · Views: 543
  • Parts List.jpg
    Parts List.jpg
    103.1 KB · Views: 300

Maveric169

Oct 15, 2014
12
Joined
Oct 15, 2014
Messages
12
Found a problem with my last circuit design, I forgot to join the reset bar to the reset circuit. This diagram has it fixed.
 

Attachments

  • breadboard-circuit-design.jpg
    breadboard-circuit-design.jpg
    119.5 KB · Views: 521

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Yes, a unipolar non-latching Hall switch. Those two Honeywell ones look fine.

Re your design.

1. You can make the diagram a lot tidier if you use symbols to indicate connections to VCC and GND, you can avoid a lot of the long messy lines. Define the names of the positive and negative rails - for example, call them VDD and VSS, as is the convention with CMOS devices, or you can call them VCC and GND, or +5V and 0V. Then for pins 8 and 16 of the 4026es, and the cathode pins of the displays, just have a short wire going out and up to a net named with the positive rail, or out and down to a net named with the negative rail.

2. Each CD4026 should have its own decoupling capacitor, connected between pins 16 and 8 as directly as possible. I like to show these on the schematic right next to the IC. For example, show a wire from a VDD node (or whatever you call your positive rail) going down and then branching off into pin 16, and continuing down to a capacitor, with the bottom side of the capacitor connecting to a VSS node (or whatever you call your negative rail). That keeps everything nice and compact, and shows that the capacitor is associated with that IC. Also, the Hall sensor should have a decoupling capacitor as well. If you mount the Hall sensor off-board, with a three-wire connection, put the capacitor directly across the Hall sensor, at the end of the cable.

3. You seem to have confused the reset pushbutton with the VCC rail. It's connected between VCC and GND, and the RESET signal is tied to VCC. You need to separate that out. You're right with the 10k resistor from RESET to GND.

4. The displays won't be very bright, because the one you chose, the Lite-on LTS4301JR (http://www.digikey.com/product-detail/en/LTS-4301JR/160-1533-5-ND/408206) has a ligh output of less than 1 mcd at 20 mA current!

As I pointed out before, the CD4026's outputs can't supply much current, especially at only 5V supply voltage. They certainly won't be able to supply 20 mA, even if you use them without current limiting resistors.

The one I suggested (http://www.digikey.com/product-detail/en/TDSR1060/TDSR1060-ND/4074621), running at only 1 mA, will be seven times brighter than the one you chose, running at 20 mA!

If you want to reconsider your options, start with this Digi-Key filter: http://www.digikey.com/product-search/en?FV=fff40008,fff80024,980009,10c0001,3440002,87c0011,87c0015,87c0017&ColumnSort=543&stock=1&quantity=1&pageSize=250. I recommend the first one, as I said before, or the following group of Avago ones that are rated to operate at 5 mA.

5. You need a pullup resistor on the output of your Hall sensor. Those Hall sensors (like most Hall sensors) have an "open collector output" that can pull down to 0V but does not pull up to the positive supply. In the same way that the RESET line needs a 10k pulldown resistor because the pushbutton only pulls up, not down, you need a 10k (roughly) pullup resistor between the Hall sensor's output and the positive supply rail. You don't need (and shouldn't have) the 1 MΩ resistor and the 100 nF capacitor between the Hall sensor's output and 0V.

Finally, when you export and upload line drawings, it's best to use GIF or PNG, not JPG. JPG is designed for photographs and other continuous-tone art and doesn't do very well with line drawings. If you want your lines to come out cleanly, you need to use a low compression factor, which means a large file size. PNG is the best option.
 

Maveric169

Oct 15, 2014
12
Joined
Oct 15, 2014
Messages
12
KrisBlueNZ-
(1) I did the layout this way as to emulate how I would layout the components on a common bus breadboard, I know it is not the best schematic drawing but I was doing it more for layout and my own thought process thinking about how the common bus rails would work and where I would need to break the bus's etc. While I have a basic understanding and concept of electrical circuits, I consider myself a dumb newbie. LOL.

OK, now into the fire with the circuit issues.

(2) You stated that each 4026 IC needs to have its own decoupling capacitor, I can rework the circuit to do that, what size of a capacitor should I use for decoupling? 100uf?

Same question for the hall sensor. what size capacitor? and also, that would go between the VDD and the VSS correct?

(3) "3. You seem to have confused the reset pushbutton with the VCC rail. It's connected between VCC and GND, and the RESET signal is tied to VCC. You need to separate that out. You're right with the 10k resistor from RESET to GND."

I am confused with number 3. Can you elaborate on what you mean by "separate that out." I assumed that the reset pins from the 4026's would have to be tied to the reset pushbutton so that shorting the pins (by pushing the button, closing the circuit) would make it reset to 0's.

(4) I will make that change in the led displays. Thank you for noticing the power requirements.

(5) I removed the 1MΩ and the 100nf capacitor from the output to the ground, and put in a 10kΩ from the output the +5v rail.

I am using ExpressSCH for the schematic, it was only letting me export as a .bmp, so I was opening the .bmp in photoshop and resaving it. Will keep things in .png, .jpg is just a habit. LOL
 

Attachments

  • breadboard-circuit-design.png
    breadboard-circuit-design.png
    400.1 KB · Views: 406

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
2. Decoupling capacitors are typically 0.1 µF ceramic (disc or multi-layer ceramic). Yes, between VDD and VSS.

3. That's right, but have a close look at your schematic. The RESET node is connected to VDD, and the pushbutton is connected between VDD and VSS. You know how it should be done; you just drew it wrong.

5. That's right.

Re PNG format. That's good, but the file size is huge for a line drawing of that size. I reduced it from 400 kilobytes to 32 kilobytes by converting it from 24-bit colour to greyscale, then reducing the colour depth to four bits (sixteen grey shades). It looks exactly the same to me. I just don't like to waste space - all attachments have to be stored somewhere, and backed up...
 

Attachments

  • epoint 270840 breadboard-circuit-design #3 16-colour.png
    epoint 270840 breadboard-circuit-design #3 16-colour.png
    31.8 KB · Views: 456

Maveric169

Oct 15, 2014
12
Joined
Oct 15, 2014
Messages
12
KrisBlueNZ - Ok I added the decoupling capacitors for each IC.

I am still messed up on the reset circuit, I am just not seeing where I have it messed up. I connected the IC resets just like was done in the original schematic that I found online, I just added the button to it as the original didn't have a switch in it. (not sure how it was supposed to work in the original without a switch anyway). Do I have the physical connections correct, or do I need to connect things up differently?
 

Attachments

  • CD4026.jpg
    CD4026.jpg
    79.7 KB · Views: 259
  • breadboard-circuit-design.png
    breadboard-circuit-design.png
    18.5 KB · Views: 363

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Sorry for the delay. I've marked up your schematic. The red lines show where you have shorted the RESET net to the VCC net, and the blue lines show where you have connected the reset button from VCC to 0V.

epoint 270840 breadboard-circuit-design #3 16-colour.png
 
Top