# BPM Generator with display?

Trying to figure out how to design this with decent precision but having trouble getting this started. I've worked with 555's before but not for precise counting that can be modified in steps.

I'm trying to come up with a 5 volt system that accurately pulses an output of +5v that is measured and displayed in pulses per minute, or beats per minute, between 60 and 240. The BPM should be adjustable by 2 momentary buttons which will step the timer +1 and -1. It would also be great if there could also be a second set of buttons for +10 and -10 steps.

Is using a 555 timer the wrong way about this? Is there something more precise I can use to reference the gating? Is there already an IC out there that can do this on its own and do a compare to calculate the maths?

Apologies for not posting what I have so far. I'm on version 80-something on my breadboard and nothing has been working accurately so far. I also want to stay away from having to program roms and stick with discrete IC's. Again, I DO NOT want to be programming chips.

I think what I'm after might be a function generator with a frequency counter, but I don't know if that's the best way to go.

• 555s and accuracy do not mix. This is a much better fit for a microcontroller (Arduino etc) with a crystal oscillator. – Brian Drummond Oct 26 '15 at 14:57
• @BrianDrummond I'm trying to stay away from Adruino and keep things simple and low-cost though... – Dorian Oct 26 '15 at 15:07
• I think that you have a terrible misconception about an MCU based design. There are many choices of MCU components that will yield the simplicity, low cost and precision that you are searching for. A discrete IC design will be way more complicated in comparison, especially when you bring the buttons and display into the mix. The MCU can do it all with ease. A final thought is that once you achieve the MCU based design you will never look back at trying to do 1970's or 1980's style design for this type of project. – Michael Karas Oct 26 '15 at 15:21
• @MichaelKaras That is also something new that I'm not sure I want to get into. For me, transistors and vacuum tubes get things done lol IC's are fine as well, but still new to me. But MCU's, I don't even know where to start there, and I don't want to get into programming chips... – Dorian Oct 26 '15 at 15:27
• How much of this functionality have you got on your breadboard for version 80? – HandyHowie Oct 26 '15 at 15:32

If you want to implement something without using any programmable parts beyond a custom-frequency oscillator, it should be possible to build a circuit that takes a 3-digit BCD frequency and outputs a signal with that many beats per minute using an oscillator plus five off-the-shelf chips. Feed a 1,092,267Hz oscillator into a CD4060 to scale it down by a factor of 16 (DIP-packaged oscillators at Digi-Key have a 1Mhz minimum speed). Feed that 68,266.7Hz signal into a cascaded sequence of three CD4527 chips set up for the "ADD" mode to yield an output of (1-999)/4,096bpm, and feed the output of that into a CD4040 to get the desired output rate as well as various power-of-two multiples and submultiples of that. Higher taps of the first CD4060 may be used to provide various power-of-two multiples of 66.7Hz [perhaps usable as "beep" tones].

If you have three BCD thumbwheels, you could would only need six main electronic parts, all DIP; quantity-one prices at Digikey would be:

3x CD4527BE  -- $0.80ea ($2.40 total)
2x CD4060BE  -- $0.56ea ($1.12 total)
oscillator   -- $3.02ea ($3.02 total)
\$6.54 total


Assembly should be fairly straightforward on 0.1" perfboard since the only interconnections other than power and ground would be the oscillator output feeding the first CD4060, the output of that feeding all three CD4527, each of the first two CD4527 feeding two signals to the next, and the last CD4527 feeding one signal to the last CD4060.

• Ah yes! Now you're speaking my language :) This is the perfect started point I needed! Simple, all-hardware and no messing with any programming. Thanks! – Dorian Oct 27 '15 at 19:18
• If you wanted to avoid even a programmable oscillator chip and do everything with 'classic' CMOS parts you could use a 3.2768 MHz crystal and divide by 3, using e.g. a 4018 and a 4011, to produce the 1.092267 MHz clock. Then you should try doing the same job with a microcontroller and decide which was easier. – nekomatic Oct 28 '15 at 9:36
• @nekomatic: I like the idea of using the 3.2768Mhz crystal with a divide-by-twelve (I think that would suffice to get the number of beats per minute into range for the 4060; I find it odd that there are 14-bit and 24-bit counters with the upper bits available, but nothing I could see with e.g. bits 18-20 available). So same number of chips, but no custom oscillator. Not sure how a 4011 would fit in, since I only see seven-segment patterns available from that. BTW, another approach that might be educational if one had an EPROM programmer available but not one for a microcontroller... – supercat Oct 28 '15 at 13:52
• ...would be to build a shift-register-based state machine. I'm not sure how large it would need to be for the indicated purpose, but such things can be pretty powerful. Finally, another interesting observation is that the COSMAC microprocessor from the 1970s had enough boot-strapping logic that it was possible to use in a ROMless configuration if one entered a program using IIRC ten switches, eight LEDs, and a button. That might get one far enough to have something that could program a modern parallel EEPROM chip. – supercat Oct 28 '15 at 13:56
• @supercat the 4018 datasheet ti.com/lit/ds/symlink/cd4018b.pdf says an additional 4011 is required to divide by an odd number, and I just quoted it verbatim - looking more closely, what you actually need is an AND function which you could implement with several other possible parts, or (probably) two diodes and a resistor to Vdd. – nekomatic Oct 28 '15 at 14:13

This could easily be done with a microcontroller. 240 BPM is 4Hz. By using a microcontroller with timer peripherals it would be easy to get accuracy in the +/-0.01% range.

Suggest a microcontroller such as PIC or AVR or MSP430 with a small display, buttons. An LCD display could be used to save power, and there are micros with LCD controllers on board. Cost and circuit complexity would be very low.

You can prototype this with something like an Arduino.

Whilst you could use a 555 and attach a frequency counter to it (and adjust the knob as it drifts off frequency), the frequency counter would best be implemented with a micro and thus it's easier to simply synthesize the frequency you want correctly in the first place.

You can find open-source LCD module display frequency counter designs based on the PIC16F628, for example, but they're probably not directly usable for such low frequencies. To get 1 BPM resolution with a simple frequency counter requires a 1 minute gate time, so period counting and math would be a better approach- actually more difficult than generating a set frequency.

As the others have said, a PIC or Arduino is the way to go but if you're determined to avoid programming ...

You could consider using CMOS chips with a a high frequency oscillator with a crystal for stability. You would then use a counter chip to count pulses and give the present count on its output pins. These would be fed to some logic to give an output pulse at a certain count and reset the counter.

Alongside this you would need some other counters to set the reset point for comparison. Unfortunately, here is where things get messy. If you were happy to count 100, 200, 300, 400, etc., pulses it might be doable but the problem is you want to specify beats per minute so you'll need to calculate 1/BPM to give you counts for even BPM steps.

Think again about the programming. Micro's have been doing well for the last while. I think they're going to catch on!

• If one can use a custom oscillator frequency, I don't think things work out too difficult for converting a decimal BPM value into frequency using off-the-shelf CMOS. Even using a boring frequency of 1.00MHz wouldn't be too bad, though it would be necessary to have a divider chain that could divide by 60,000 (i.e. 240x250). Actually, come to think of it, that might be doable in two chips, yielding the same parts count as my other design, though I think having the power-of-two sub-multiples could be helpful and the two-chip divide-by-60000 wouldn't accomplish tat. – supercat Oct 27 '15 at 17:26
• Maybe, but the problem is that every time you hit the + or - button you need to calculate a new divider and it's a reciprocal (1/BPM) function. e.g., for your 1 MHz master clock the number of counts would be - 60 BPM -> 1,000,000 pulses; 61 BPM -> 983,606.6 pulses; 62 BPM -> 968,741.9 pulses. To get even one-BPM increments will be very complex whereas it's a simple calculation in a micro. – Transistor Oct 27 '15 at 18:56
• Using a three decimal rate multiplier chips will make it possible to take a 12-digit BCD value and yield an output at a multiple of the desired speed which can then be scaled down using a fixed divider. No need to generate any kind of reciprocal. Using up-down buttons and counters to set the rate rather than thumbwheels would require more circuitry, but I don't know how flexible that requirement is. – supercat Oct 27 '15 at 18:58