Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Rotary volume encoder to infrared advice needed please.

Status
Not open for further replies.
Ok,thanks again for the answer,but I'm in England so most of those companies are irrelevant for me.We do have Mouser over here,but I use Farnell or Radiospares mainly.I do know about designing and making PCBs etc and have been doing similar to this in cars for some years now.I have good and stable power supplies working for the source unit which is a domestic media server,the DSP unit and the outboard DACs.
What I do need more help with though is statements like this "Just make it possible to add a J-K flip flop and reset circuit like a schmidt trigger inverter, so a couple of IC's." as I have no idea how to make this into a working electronic circuit without a schematic showing EVERYTHING I need to do to make it work.
 
Could I use something like this instead,it's more local to me so easier than getting stuff shipped from Canada?

**broken link removed**
 
RS Components has a few possibilities: http://uk.rs-online.com/web/c/?searchTerm=rotary encoder&sra=oss&r=t

Can you give me an idea of how many UP/DOWN presses of the current volume control (assuming it is UP/DOWN is the full range of volume?

That will help a lot.

====

I read the instructions again for the IRMimic and it operates differently than I expected. If all else fails, read the manual.

There is a drastic difference as to how the chip operates in keypad mode: http://www.tauntek.com/IRMimic2-keypad-schematic.pdf and switch mode: http://www.tauntek.com/IRMimic2-MCU-with-switches-schematic.pdf

There is an extra "send" push button that needs to be used.

So, in the row/column mode, we can use an FET optocoupler and an encoder that has UP/DOWN pulses.

In the switch mode, I'm a little unsure if we can use the clock/direction encoder, but it may work. Have the clock pulse operate the send switch and the direction mode set one of two of the CSEL switches.

I think it means that there are now two choices for the ELM part and you might be able to use the encoder you linked to without the ELM part.

As a gotcha, some encoders don't have a nut for mounting. They rely on the PCB, so that's a consideration too.

I initially thought that pressing a button would send the command just as the keypad mode would, but I don't think that's the case.

In any event, while looking at the board, you should be able to install the header upside down and/or select another type and mount it on top of a 0.1" pad per hole board. The LED's might be 0.1" apart and you could probably put a 2 pin header/plug in each place. There's a hole where you could put a spacer and fix it to the board.

The IRMimic has a 5V regulator that can be disabled.
 
Last edited:
I need to plug my laptop into the DSP to put it into learning mode to teach it a volume command,I won't be able to do that until thursday when I'm off work next but will let you know when I know the answer.
I already have a rotary encoder mounted to the front panel of the radio I'll be using for this,so will be removing the one it comes with.Either on the PCB or remotely if the pin spacing isn't the same.

Can you do me a list please of part numbers for everything I'll need to build this?
 
So, you got the Mimic and not the Mimic2? The mimic2 does macros which you don't need. Don't solder the header.

IRMimic-assembled-kit.jpg


I was thinking, something like this: https://www.digikey.com/product-detail/en/803-87-014-10-001101/1212-1239-ND/3757489 and 2 of these **broken link removed** to mount it to another board. I know, need to find them at RS. The original header uses square pins with 0.100" (2.54 mm spacing)

But the second one gets mounted UPSIDE down on the board. The first one, gets mounted to the carrier PCB.

The clear LED is the IR transmitter which has to be mounted remotely. We can use the same setup and mount another 2 pin connector where the IR LED is or try to drill a hole near the coin and put a tubular spacer with a screw there.

The RED is the done LED and "possibly" the xmit indicator too. The black piece on the right is the IR Receiver.
 
Got some of the answers:

"It may be possible to turn the shaft encoder and get
pulses into my chip that are faster than it can respond to. It won't look for a new pulse until
the previous cmd has finished sending, which might be 100-200 mSec depending on the
remote and how long a sequence you record. In that case, you would not get a consistent
mapping between volume position and volume setting. If you turn the volume slowly, you will
send on every pulse. If you turn it faster, you will miss pulses. Not sure if that will be a
problem or not."

A) We can't use the Keypad mode. Sequence is repeated as long as key is held.
B) You have to record as short of a learned command as possible. e.g. minimal keypress time on the remote.

Waiting for another answer.

So far, not ideal. Ideal would be something far more complicated. Ability to send just the command and a buffering of counts that would. e.g. If you turned it 5 clicks, you get 5 pulses. If you turned it 10 clocks and back 5, you would get 5 pulses. Pulses would commence immediately and then add or subtract on the fly. Not possible without a microprocessor solution and knowing the actual IR code.

So, we will see how your total number of volume presses figures into things. i.e. would 1 press per 1/4 turn be too many or two few. (16-20) presses per turn might be too many.

Need another piece of info from you. What's the diameter of the knob and how far can you turn it with one grip of the finger? I'd guess between 1/4 and 3/4 of a turn? Next step would be to estimate the time it takes to turn it. e.g. Turn it back and forth 5x and divide by 10. So, how far, and time would also help a bit. I can directly read 0.1s on my watch as a stop watch. Could go to 0.01s if someone else could push the button.

Thinking out loud:
Sparkfun has an illuminated encoder https://www.sparkfun.com/products/10596 with 24 pos per revolution. They also have a clear knob and a PCB to mount the thing.

Suppose, we used the Illumination to indicate the command is sending? Again, dunno if the LED lights on the IRMIMIC when the IR command is sent as well. Gotta read and then ask. If not, I can create one.
 
Last edited:
Tried teaching a remote to my DSP today,it said the programming was successful but it didn't work afterwards,so still working on that one.I'm using the existing volume control on an original radio which I want to look original from the outside,so although the illuminated encoder would be a nice touch,it just isn't go to work for me.

Got the encoder/decoder today and had a play with it.It looks like I misunderstood once more how these things work.It goes from 0 volts when turned anti clockwise to + 0.5 volts when turned clockwise,but stays there when you stop turning.It gives out a 1ms @ 0.5 volts pulse every time it passes a detent,and will give them out even if I turn it as fast as I can.Will this system still work for what I need to do here?
 
I think your off by a factor of 10. x10 probe on scope, possibly? So, you may own a scope?

A naked encoder basically looks like two switches out of phase. To be useful, it has to be decoded. The encoder you got is 24 pulses/revolution

pulse/direction or UP/DOWN

UP/DOWN
The UP/DOWN interface isn't recommended - it's like pushing one of two buttons on a remote (ROW/COL interface). It has a timing issue. Code is sent for as long as button is depressed.

The CLK/DIR
That's operating lke your seeing except for the levels (5V vs 0.5 your supposedly seeing). The DIRection stays in whatever state it is or was. so, when you stop turning, it stays in the direction it WAS moving. At every "detent" there will be a pulse no matter what direction.

The 1 mS may be too short of a pulse to use directly, but that can be extended.

Unknowns, to me, are:
1. Some idea of how much time it takes for "a finger's worth" of a turn for the encoder. The one your playing with is 24. I think they make 12,16 or 24 as well. It's easy to divide by 2,4.8,16 etc. We are assuming a 100-200mS for an IR command.

2. Learned IR code has to be as short as possible. It's difficult to learn "one code". Repeat is often difficult.
I'm not in an EASY position to do so, but I THINK I posess the technology to encode a "Pronto remote" code.
I was wondering if it would be worthwhile for you to somehow create the smallest code. An idea would be if you had a remote that had up/down which you don't, I think is to make an external circuit to hole down the key for 0-1000 mS. You would try to learn the shortest code, by adusting a potentiometer, say using a binary search technique.

3. Number of steps in your volume control.
256 steps would be way too much.

Gotta somehow make finger turns create pulses that don't skip a beat and are reasonable. 1 to 4 "finger turns" fot full volume control. A "finger turn" is grabbing the knob and turning some distance. Might be something like: one "finger-turn" = 1/2 turn of the shaft.
 
Yes I do own a scope,and no it's just a basic probe.The specs for the unit which I didn't fully understand before also say it's 1ms for every detent pass and it's delayed by 100us,which is exactly what I was getting,a perfect squarewave with just a touch of overshoot.

I'm still waiting for an answer about the problem with my DSP not responding to the remote,so for now it waits until someone on their forum knows the answer.

Capture_zps3ec6c165.png
 
So, the idea at this point is to have the DIR control CSEL directly. There is no LED indication on transmit. Do you want that? Do we need that even for debugging?

Then to STRETCH the output pulse from the CLK output from the decoder and make it the minimum length required or minimum code required. If you capture 1 sec or so, you can send 100 mS of the capture, for instance. Your scope can help here. 20 mS has to elapse before another pulse can be sent.

If necessary, we'll divide the CLK out of the decoded signal by 2/4/8/16.

A use of the switch might be to issue a MUTE command if you have one, It might complicate things, but I'll think about it. You will have to know if there is a MUTE ON/MUTE OFF or MUTE Toggle IR command though.
 
What is your planned circuit for the ON/OFF switch? An impulse relay might be a better choice. These are not well known devices. For this particular one, a 0.1 s minimum pulse is needed to change states. The encoder delivers a 30 mS pulse as it stands.

You can probably find the pin that's pulled up or down by the naked encoder and tap there with something like a ULN2003 or inverted signal to the ULN2003. Use two channels with a pull up and get the inversion.
 
I've already done that bit,I've used latching relays enough in previous car installations to know my way around them.Because it's not intended for in-car use,the 0.5 Amp standby current draw means I have to power it down completely every time I don't use the car for a few days.Proper car stereos are designed with very low standby current (less than 10mA) and have permanent live memory back up wires and switched lives to have them go on and off with the key.If I let this one go off with the key,I have to wait about 2 minutes for it to boot itself up again every time I get back in the car,which would soon drive me mad.
The latching relay will be switched on by the central locking unlock pulse when I first use the car,then manually turned off by me when I put the car to sleep for the night.I'll also have a timer set for about 6 hours that switches it off automatically if I forget to do it myself.

Right,back to this volume control.No one has got back to me on the relevant forum on how to get it working,so I'll have to do it another way for now.Instead of having it working as master volume control for the DSP unit as intended,it'll do the same job if I have it working with the media server used as the music source.The remote that came with it (the same one I used to teach the DSP) needs a single press of the up or down buttons to increment it one at a time,with going from 0 or muted up to 100 for full volume.So it needs a total of 100 button presses to go though the full range of the volume control.
 
If you have time this weekend, and if you have a DSO oscilloscope. can you look at the output of the remote for the volume UP or vol DOWN command? I've only looked at the decoded output. There would be bursts of probably a 38 KHz carrier and it won't be a nice pulse position waveform.
Just see if you can ascertain the length of the command.

You could get a better idea probing the IR sensor of the IRMIMIC which you don't have yet.

In any event, with 100 pulses, and 24 pulses per revolution, slowing it down probably isn't an option.

What's the knob size, about 1 cm?
 
I couldn't get it sync to anything coherent with such a basic 'scope,but I got bursts of about 0.5 ms each that were modulated with something.All the functions appeared to give this 0.5 ms burst,so it's probably how the other bursts grouped with it are arranged that controls which function etc.

I would guess it's using standard RC6 protocols though as that's what the DSP uses and it programs to that ok.
 
So, in reality, it probably doesn't tell us anything. I really didn't care about the bursts, but rather the total time of activity for one keypress. You can try the same exercise again, looking at the output pin of the IR detector in the IRMIMIC. That will have the carrier removed.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top