Inc/dec binary sequence using a potentiometer

Thread Starter

mikerodi

Joined Jul 6, 2009
56
hi Mike,
A 8 Bit ADC requires supporting logic.
Do you want a parallel or serial 8 Bit.?
A serial type will need a Clock and Enable etc...

Post a sketch on how you see this being connected.
E
This is the last byte of a total of 3 bytes, so I think parallel. But the whole message (3 bytes is serial + stop and start bits), but I already have that part figured out.
 

Thread Starter

mikerodi

Joined Jul 6, 2009
56
This is the last byte of a total of 3 bytes, so I think parallel. But the whole message (3 bytes) is serial + stop and start bits, but I already have that part figured out.
I just couldn’t figure out how to convert a voltage into a binary value.
 
Last edited:

jpanhalt

Joined Jan 18, 2008
11,087
That's what an analog to digital converter (ADC) does, which has been mentioned frequently above. There is a bit of design work to using such chips. You might consider getting one designed for a voltmeter that gives a BCD output that can be used directly for your display.

I considered that issue in my previous reply, but apparently that solution was too simple and/or coarse. If you want 128 counts per 359° rotation, then a simple, single gang mechanical switch won't do that, but many encoders will have that resolution. I also used the term "absolute" because you apparently want a number on the dial to always be equivalent to the same displayed value.
 

MrChips

Joined Oct 2, 2009
34,814
Not sure what you mean by "but the pot must keep moving".

Now let's modify your requirements.
Let us assume that the pot can rotate from 7 o'clock to 5 o'clock.
You want a 7-bit value as follows:

Position = Value ± 1
o'clock
7 = 0
12 = 63
5 = 127
 

MrChips

Joined Oct 2, 2009
34,814
Now let's go back and examine what the client really wants.
TS wants a 3-digit BCD display that shows a value from 0 to 127.
A 7-bit binary number will be appended to a message of three characters to be transmitted serially via a MIDI interface.

Do I have all of this correct so far?
 

jpanhalt

Joined Jan 18, 2008
11,087
What's wrong with a free HF voltmeter* and a pot in a voltage divider configuration?

*If not free for walking through the door, you can get one for buying a screwdriver that is on sale for 20% off.
 

Thread Starter

mikerodi

Joined Jul 6, 2009
56
Now let's go back and examine what the client really wants.
TS wants a 3-digit BCD display that shows a value from 0 to 127.
A 7-bit binary number will be appended to a message of three characters to be transmitted serially via a MIDI interface.

Do I have all of this correct so far?
I fear my initial question was misleading. It’s much simpler than you think... all I was looking for, was how to convert a voltage into a binary value. Rotating a pot where according to its position you have a value 0 - 127.
I used the term counter because I couldn’t think of a way to convert a voltage to a binary value so I was asking if there was a way to generate clock signals to make a counter count that many times based on the position of the pot, but it was a ridiculous idea because I didn’t know there was a chip which converts a voltage into a binary value.
 

jpanhalt

Joined Jan 18, 2008
11,087
I fear my initial question was misleading. It’s much simpler than you think... all I was looking for, was how to convert a voltage into a binary value. Rotating a pot where according to its position you have a value 0 - 127.
So, what's wrong with a 3-digit voltmeter? Even a 2-1/2 digit would work, if they are made.
 

MrChips

Joined Oct 2, 2009
34,814
I fear my initial question was misleading. It’s much simpler than you think... all I was looking for, was how to convert a voltage into a binary value. Rotating a pot where according to its position you have a value 0 - 127.
I used the term counter because I couldn’t think of a way to convert a voltage to a binary value so I was asking if there was a way to generate clock signals to make a counter count that many times based on the position of the pot, but it was a ridiculous idea because I didn’t know there was a chip which converts a voltage into a binary value.
This is why I say, don't focus on the solution. We will get to the solution eventually. You need to focus on your requirements. Your requirement is not a counter. Your requirement is to get the position of a control knob to a MIDI device.

This is a common problem with persons looking for solutions. You need to step back and describe the big picture rather than looking for implementations of a solution.

To answer your immediate query, this is what an A/D converter does. But I am not convinced that this is the best solution.
 

Thread Starter

mikerodi

Joined Jul 6, 2009
56
This is why I say, don't focus on the solution. We will get to the solution eventually. You need to focus on your requirements. Your requirement is not a counter. Your requirement is to get the position of a control knob to a MIDI device.

This is a common problem with persons looking for solutions. You need to step back and describe the big picture rather than looking for implementations of a solution.

To answer your immediate query, this is what an A/D converter does. But I am not convinced that this is the best solution.
Could you elaborate on that?
 

Thread Starter

mikerodi

Joined Jul 6, 2009
56
Could you elaborate on that?
I completely agree with what you’ve said. I must add that I’ve just been introduced to chips as I’ve always experimented with transistors so my question, as confusing as it was, was just an attempt generated from a way of reasoning which I’m still not used to considering many chips perform a variety of functions you “cannot see”.
I would be very interested in an alternative solution....
 

MrChips

Joined Oct 2, 2009
34,814
I once new a guy who grew up using tubes. He refused to move on to transistors.
Then he learned how much easier it was to work with transistors and would refuse to use chips when they became available.Then he found out how much easier it was to work with ICs. Then he refused to look at microprocessors (MCU).
And story goes on...

As pointed out, you have to stop focusing on the trees and look at the whole forest.

An A/D converter will give you the binary value of the setting of a pot. But there are many other considerations if you want BCD readout. And you want to send this value to a MIDI device. All of this can be done with a single MCU chip.

A lot of people think of MCUs as too complicated and overly difficult to learn. You would not know until you try it.
 

Thread Starter

mikerodi

Joined Jul 6, 2009
56
I once new a guy who grew up using tubes. He refused to move on to transistors.
Then he learned how much easier it was to work with transistors and would refuse to use chips when they became available.Then he found out how much easier it was to work with ICs. Then he refused to look at microprocessors (MCU).
And story goes on...

As pointed out, you have to stop focusing on the trees and look at the whole forest.

An A/D converter will give you the binary value of the setting of a pot. But there are many other considerations if you want BCD readout. And you want to send this value to a MIDI device. All of this can be done with a single MCU chip.

A lot of people think of MCUs as too complicated and overly difficult to learn. You would not know until you try it.
I need binary output, it’s mentioned in the title of the thread, I just used decimal for sake of simplicity, else I will have had to decorate the entire thread with 1,s and 0,s...
I will eventually get to PICS as well.... but I’m still exploring things new world for me.... thank you
 

jpanhalt

Joined Jan 18, 2008
11,087
I agree, one needs to look at the whole project. So far, it has been to convert a voltage to a 3-digit display.

I previously mentioned an HF voltmeter as those are pretty generic. They also tend to use a COB (black epoxy blob) instead of identifiable chips one can manipulate. I have had good luck with voltmeters from MPJA (https://www.mpja.com/Digital-Panel-Meters/products/52/) . One I got had a socketed and identifiable chip. That made adapting it to my use easy.

After you get your voltage to read out, then what? Does it do something? That is, do you also need to control something besides the display?
 

Thread Starter

mikerodi

Joined Jul 6, 2009
56
I agree, one needs to look at the whole project. So far, it has been to convert a voltage to a 3-digit display.

I previously mentioned an HF voltmeter as those are pretty generic. They also tend to use a COB (black epoxy blob) instead of identifiable chips one can manipulate. I have had good luck with voltmeters from MPJA (https://www.mpja.com/Digital-Panel-Meters/products/52/) . One I got had a socketed and identifiable chip. That made adapting it to my use easy.

After you get your voltage to read out, then what? Does it do something? That is, do you also need to control something besides the display?
need binary output, it’s mentioned in the title of the thread, I just used decimal for sake of simplicity, else I will have had to decorate the entire thread with 1,s and 0,s...
 
Top