Arduino BPM- researching and building the display

breadboard with the start of the display
Breadboard with display and audio conector

I have started construction of the Display of my bpm counter, I decided to use the 7 segment displays instead of sending it to the serial connection, from what others have told me is that the serial connection lags a little and may screw up my timing of the audio signal.

I plan on hooking up 3 out of 4 digits using the same kind of method as building a POV display, by flashing the digits one at a time, fast enough, it will look like all 3 are on, but in truth only one digit will display for a very short time…. I have a drawn schematic right now, as soon as I finish the display I will post the schematic with a picture, and explain a little more on how i accomplished it.

The audio half has given me some trouble, I have not found a good example of how to measure the music and get a BPM. all the examples I have seen use human interaction, A few examples I have seen, use either a button or a piezo electric element, and all that it does is measure the time between taps, then averages out the last few to get the BPM, this does work but you still need human interaction, this is not ideal when listening to multiple tracks at the same time

My plan is to use a 741 OP-Amp to level the signal from the audio source and change it into a square wave that is measurable by my Arduino or other MC, Personally I would like to be able to select what audio range it is measuring but lets start simple and get a working measurement of some simple audio track and go from there.

The 741 op-amp is a versatile chip and can be used in so many applications from comparators to audio amplifiers. A great resource that I used to get a good idea how op-amps work (since I little experience in using them) is http:\talkingelectronics.com

the exact page I used is http://www.talkingelectronics.com/projects/OP-AMP/OP-AMP-1.html

the site has some great info, but the one on op-amps really goes into detail and has helped me design the (hopefully) ideal circuit for this application. A schmitt trigger looks like the ideal setup. I chose this as a starting point, the schmitt trigger only sends High signals, when a upper and lower threshhold are met other wise it is low on the outputs.

I will get more into my op-amp experiments once I start experimenting with them.

Look for my display update in the next few days!!!

P.S.  If any of you have any experience in op-amp circuits, your help will be appreciated greatly.


8 Responses to Arduino BPM- researching and building the display

  1. Pingback:Tweets that mention Arduino BPM- researching and building the display — Justin's Tech -- Topsy.com

  2. Avatar CodeKiller
    CodeKiller says:

    Hi, i’m looking to the same goal and found your site a few months ago, and as i have not enough time (or just too lazy :P), I’d like to share some resources i had run into:
    http://www.iq-technologies.net/projects/games/006/index.html
    disco light controll circuit with “beat detection”
    – sound.westhost.com/project62b.htm
    another disco-light with beat drive
    http://www.limpkin.fr/index.php?post/2008/11/02/The-RGBW-lighted-carved-plastic-glass-and-its-power-supply
    another light, now with mega8 and not realy readable schematic :S
    – tim.cexx.org/?page_id=374
    a realy simple analog detector
    – instruct1.cit.cornell.edu/courses/ee476/FinalProjects/s2000/chan/
    some theories, etc…
    -www.gamedev.net/reference/programming/features/beatdetection/
    and the most referred

    but what is the most accurate, free and publically available (but of course not an option for slow uCs) is the SoundTouch library’s method:
    http://www.surina.net/soundtouch/

    • thanks for the links! what i gather from them is that i will need a low pass filter for my input which shouldnt be to hard to make, as for the Sound Touch library my uC is a little to slow to run it. Nothings wrong with being lazy, because im guilty of it too.

  3. Avatar CodeKiller
    CodeKiller says:

    Actually I have some how-to-work algos in my mind, as the above ones either not precise enough, or not tolerate diversion enough (not real-time). So my idea:
    sampling from ADC-pin, adjust gain (agc), software LPF (or use ext hw but feed the unfiltered too to an ADC to detect if there is any input other than beats)
    pass_1:detection) measure peaks for some beats
    pass_2:prediction) as now you know, where the next beat kick in, you can predict when/where it should peak, but extend by a little threshold so it can adapt to a small bpm change
    – if there is beats but out of phase (and neither in distance *2, *4 or /2, /4) for some time, it’s the best to fall back to pass 1
    – if there is signal (over some threshold), but no beat (like in looooong breakdowns) and maybe tolerate some secs of silence, it’s the best to assume the bpm is the same as it was

    (to share my projects with you: i’m working on a dj player for psp– still very buggy | upgrading one djx700 as in circuit as in effect-processor’s code– too much insanity …)

    • I like your idea about using the ADC so i looked into it and found a good place to start, im starting to build the circuit so i can start playing with some code. also i like you idea about the different passes, once i learn some assembly i will incorporate that into my design. thanks for the great ideas. 🙂

      Your project sounds cool, never really played with the PSP, I just might find a used one to use your dj player and how are you upgrading the code on the djx700?

  4. Avatar CodeKiller
    CodeKiller says:

    And what about the C++? AFAIK the Aurdino supports that, no need for ASM. The link is great.. for DSP .. but for BPM i think it’s a bit overkill. As the BPM is more like a measure than an actual signal processing. (the LPF is only avg calc). I suggest you, to start with simple VU-meter, to get use to the ADC, AGC, and led-refresh. (and some clock code is also important as the precisity depends on it)
    As my projects: the psp-player ( ruckus_mod ) can found in http://smfinc.web.elte.hu … sorry it’s been a while since it has been updeted, but working on new method of memory-management (currently around 2000 entry in one directory is more than likely to kill the prg)
    the djx700 is a longer story – the original effect processor in the mixer is consist of a well known 8032 uC, some gates/latches, a 27c512 (64kbyte program) for the uC (unprotected!) and an obscure/obsolete TMS57002 as DSP and of course an audio codec…
    after dumping the eprom, i could disasm the code, modify and burn into a new eprom .. but instead of (e)eprom, i bought an SST 27SF512 flash for easier handling (which is compatible with the 27c512) – needed me to build a burner – then to redo the writing program, as it wasn’t compatible with the SST
    as for the DSP part, i could track down one of the code designer (based on the names in the code), and asked him for information, and at last, he provided me the programming guide which i can’t thank enough
    now i’m heavily RE-ing the code to get some starting ground for the upcomings >:-)
    (sadly, the BPM counters’ not so good code is in another, protected uC)

  5. In your 3rd paragraph you are talking about what I would like to build, can you send me the links to the info on that. I have tried to purchase one of these (http://www.drumperfect.com/Groove_Guide_PRO.htm) they say that they are out of them for an “extremely extended” amount of time. So I might just build one. I have a chance to borrow one to dissect it, but it would be nice to see others ideas on the same concept.

    • I will send you an email once i gather my materials and possible builds for that machine, that should be easier to build than what i am building since it looks like its a switch connected to the drum kit, and counts the time in between each hit.
      And thank you for your inquiry