I bought five rotary encoders off ebay.
I am not sure what kind of waveform they output but I assume it is this:
Is it possible to wire them so they all interrupt a single interrupt pin on Arduino Nano?
When I touch one of the knobs, the program stops and the microcontroller's attention is focused onto the input from the knobs.
This is the idea atleast. IS IT POSSIBLE?
Four knobs will code in a frequency for a frequency generator that I am building and tell my frequency generator to modulate frequency between two values that I preset with a period that I preset.
Haha, I was going to do a similar thing to make use of the AD9833 I now have sitting around but I will only use one encoder and make the encoder button press switch modes. I nether bothered trying frequency sweeps with the AD9833, is it any good (to lazy to write code now).
You will need to use a pair of PCINT to read each one and interpret whether the knob was turned left or right.
Alternately, you could use 4 potentiometers, read the analog voltage off each one and interpret that from 0-9 for each, only need 4 inputs then.
CrossRoads:
You will need to use a pair of PCINT to read each one and interpret whether the knob was turned left or right.
Alternately, you could use 4 potentiometers, read the analog voltage off each one and interpret that from 0-9 for each, only need 4 inputs then.
So is it possible to include 4 encoders into my project than? Thanks.
Is it possible to convert output from 4 rotary encoders into some numerical value and than feed it to the Arduino through 1 pin per encoder? What type of ICs am I looking for?
Is it possible to wire them so they all interrupt a single interrupt pin on Arduino Nano?
When I touch one of the knobs, the program stops and the microcontroller's attention is focused onto the input from the knobs.
This is the idea atleast. IS IT POSSIBLE?
Four knobs will code in a frequency for a frequency generator that I am building and tell my frequency generator to modulate frequency between two values that I preset with a period that I preset.
Thank you.
I've never used a rotary encoder, but I am pretty decent with counters and digital circuits.
Based on the reading I just did on rotary encoders, I would say no. You need at last one interrupt per encoder, and 2 would be better. (with only one interrupt you can only count rotation at half the resolution you can with 2 interrupts for an encoder.)
Without building a very complex circuit there's no way to track the rotation of more than one encoder using a single interrupt. You need to know every time a pin transitions from high to low or low to high, and there's no way to multiplex that onto a single interrupt and still be able to make sense of it, at least not without a lot logic building-blocks.
You could no doubt design a chip that would count the rotations of all 4 encoders and then send those results to the Arduino using I2C, but that would be a big job. I guess you could use a one-chip microcontroller to accomplish your goal
An alternative plan, would be to connect the outputs of the encoders to a shift register, and then simply read the shift register into the arduino and compare to the previous reading. Don't use interrupts at all. How fast does this thing have to respond, and how fast to you expect to be twiddling the knobs ?
Is Shift Register similar to a binary counter, thus to a Ripple Counter or Frequency Divider?
I looked at the logical structure of a binary counter and a shift register. Information harvesting is different. Am I correct?
Interrupts are a good method, if you need a very fast reponse to your device, and you have enough interrupt pins.
The problem in your case is, you want five of these encoders, and you don't really have enough interrupt pins.
The shift register idea is one way to get around that.
Another idea would be to build a circuit which detects a state change on any of your ten encoder lines, and triggers an interrupt. Your arduino can then check each of the ten encoder lines to see which one ( or more ) has had a state change.
Apparently the "shift/load" pin enables the input, so effectively you can use that to latch the input so it doesn't change while you are half-way through reading it.
Apparently the "shift/load" pin enables the input, so effectively you can use that to latch the input so it doesn't change while you are half-way through reading it.
This is what I originally tried to do - to find a circuit that would trip a single interrupt, making it quickly sample all rotary encoders for a period of time as soon as I touch one of them.
I am able to design either version of the circuit myself, neither parallel-to-serial nor single interrupt one. I googled a lot and couldn't find anything.
How do I detect change of state without effecting other aspects of the circuit?