Microcontroller action potential generator


Scott Harden writes:

Here I demonstrate how to use a single microcontroller pin to generate action-potential-like waveforms. The output is similar my fully analog action potential generator circuit, but the waveform here is created in an entirely different way. A microcontroller is at the core of this project and determines when to fire action potentials. Taking advantage of the pseudo-random number generator (rand() in AVR-GCC’s stdlib.h), I am able to easily produce unevenly-spaced action potentials which more accurately reflect those observed in nature. This circuit has a potentiometer to adjust the action potential frequency (probability) and another to adjust the amount of overshoot (afterhyperpolarization, AHP). I created this project because I wanted to practice designing various types of action potential measurement circuits, so creating an action potential generating circuit was an obvious perquisite.

See the full post at SWHarden.com.

Check out the video after the break.

Join the Conversation

1 Comment

  1. First of all, let me post a reference about what Action Potential is in terms of Physiology (since DP isn’t adding much value these days – other than essentially dragging an dropping links here)…


    OK, that’s done.

    Now, A-P stimulus typically runs into the 100’s of Hertz repetitive based on stimulus time profiles (i.e., look-up time domain delays). Given the relatively low repetition rate and some need for waveform shaping, I think this application lends itself to a micro-controller running as a DDS arbitrary waveform generator (ARB). This would go far towards eliminating much of analog interface parts in this design, as well as adding enormous flexibility. Use a simple R2R 8-bit DAC for the output. Monolithic thin-film SIP passive DAC parts are readily available and cheap. Don’t forget to add a smattering of LPF to the DAC output to suppress unwanted spurious above (roughly) the Nyquiist rate. There are plenty of examples of AVR DDS implementations out there on the Web, especially for Arduino – pick one as a starting point. I think something like the use of an 8-bit AVR part for this sort of application because there are Tons of Arduino baseline examples to start with. But when you get down to a final design, you’ll want to clock a typical AVR (e.g., ATMega328) at 20MHz and program key parts in your DDS in assembler to take advantage of the excellent clock-per-cycle efficiency (and reduced complexity) of the RISC AVR parts. This is where I suggest you depart from an IDE like a raw GCC tool-chain or (gawd forbid) the Arduino IDE and move to the free (but not open source) ATMEL Studio IDE (or whatever it’s called today) from ATMEL/Microchip. (One only wonders how long the likes of free unencumbered ATMEL IDE survives before the Greed-Heads at Microchip kill it off).

    There are also a bunch of dirt cheap “Function Generators” available from China on ebay etc. that have arbitrary waveform generation capability that should (theoretically) be a drop-in for this application. But as with anything from China these days – YMMV.

Leave a comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.