Turning 555 IC PWM signal into useable information

Hello!

First time on the forum and first few weeks dipping my toes in Arduino, with still little experience in C (so thanks for your patience in advance!)

I have built a circuit for a galvanometer. Signal from two electrodes is processed by the 555 IC in astable multivibrator mode, and sent to input ~3.

My goal is to be able to calculate the frequency, pulsewidth, and duty cycle of the signal continuously in real time (this will then be printed to serial, and passed to Max/MSP where I will be using it to create MIDI signals.) For those of you familiar with PlantWave (formerly MidiSprout), this is the exact idea.

I’ve been going at it for 5 days with little progress. I would really appreciate someone explaining to me the process of turning the 555 PWM signal into a data type that I can use to find frequency, pulsewidth, etc. If I understand correctly, this is essentially sampling (which I’m familiar with in the audio world.)

Thank you so much!

Download the datasheet for the processor (ATmega328 assumed) and find the timer/counter 1 chapter and read about the Input Capture Unit. There's probably code somewhere already written to do this, just under a different name.

You may want to give this a read: [Frequency and Duty Cycle Measurement Using Arduino](http://Frequency and Duty Cycle Measurement Using Arduino). The frequency and period are reciprocals as in Frequency = 1/Period and Period = 1/Frequency. The duty Cycle is the On Time of the total period expressed as a percent. There are dozens of circuits out there using the 555 timer configured for a PWM signal out and I have no idea which you may be using?

Next an Arduino or just about any uC is capable of creating a PWM signal as long as you are good with the PWM frequencies an Arduino creates. It can create a PWM signal based on an analog input. Unless you want a PWM frequency specific to what you are doing with the 555 you may wish to consider just using the Arduino. Analog In / PWM Out.

Ron

Signal from two electrodes is processed by the 555 IC in astable multivibrator mode, and sent to input ~3.

The Arduino can probably replace the 555 IC. Please describe the electrodes and what it is you are wanting to detect.

A “galvanometer” is a moving coil current indicator, like an old fashioned panel meter.