# ADC to 3 digit 7 segment highest value needed is 360

#### Kringjat

Joined Jan 15, 2008
4
hey guys i am new here so if I am doing something wrong tell me

i have and ADC 8 bit and i need to display it on a three 7 segment but my problem is that the highest value must me 360 How can i do it? a pic is needed? if if yes how i can do it THKS

#### beenthere

Joined Apr 20, 2004
15,819
We do not have enough details to give an intelligent answer.

An 8 bit A to D converter has only 256 states - 0 to 255 - so a value of 360 cannot be output by the device. If, however, you are using the conversion as what amounts to a voltmeter, then an inexpensive digital panel meter will work.

#### Kringjat

Joined Jan 15, 2008
4
so if a bigger ADC is used how can for example 9 bit having 512 how it can be done to display values of 0 to 360

#### Ron H

Joined Apr 14, 2005
7,014
so if a bigger ADC is used how can for example 9 bit having 512 how it can be done to display values of 0 to 360
You could use a microcontroller, and have the software convert all numbers greater than 360 to 360, or you could use an EEPROM which you can program to do the same thing.

#### Ron H

Joined Apr 14, 2005
7,014
We do not have enough details to give an intelligent answer.

An 8 bit A to D converter has only 256 states - 0 to 255 - so a value of 360 cannot be output by the device. If, however, you are using the conversion as what amounts to a voltmeter, then an inexpensive digital panel meter will work.
You could scale 0-255 to read 0-360, but some numbers would be missing.

#### SgtWookie

Joined Jul 17, 2007
22,210
Here's an article that explains connecting 7-segment displays to a PIC microcontroller:
http://www.picbasic.com/resources/articles/ledart.htm

A number of PICs have built-in ADC's. You'll need to do some research to figure the rest of it out.

A microcontroller such as a PIC will very likely be your lowest-cost solution with a minimal parts count.

#### scubasteve_911

Joined Dec 27, 2007
1,203
The standard methods to display the data would be either scale the analog voltage appropriately, or to scrap the resolution from the ADC.

So, if you're ADC accepts 0-5V, then make sure the signal doesn't go past ~3.5V. Otherwise, create a lookup table. Use excel to make a 0-360 range over 0-511 rows. Copy and paste it into your PIC compiler, then reference the table.

Steve

#### beenthere

Joined Apr 20, 2004
15,819
Not to be too persistent, but I would be curious to know what is being measured? I am not sure any answer is correct without knowing what is going on.

#### lightingman

Joined Apr 19, 2007
374
Hi.... A PIC is the best solution... It will do the A/D conversion and multiplexing of the LED displays... What sort of sample rate are you looking for, and what input voltage range...I may be able to help you...Daniel.

#### SgtWookie

Joined Jul 17, 2007
22,210
Just a guess - but there are 360 degrees in a circle, or points in a compass...

#### lightingman

Joined Apr 19, 2007
374
Yes, but what voltage range into the A/D is required to read 0 to 360....Daniel.

#### beenthere

Joined Apr 20, 2004
15,819
That sounds like a good guess. Then the question is the resolution required. If he needs to indicated all 360 deg., then the A to D resolution will have to be at least 10 bits.

#### lightingman

Joined Apr 19, 2007
374
Yep !...The PIC will do that as they have 10 bit A to D's on board...Daniel.

#### Ron H

Joined Apr 14, 2005
7,014
That sounds like a good guess. Then the question is the resolution required. If he needs to indicated all 360 deg., then the A to D resolution will have to be at least 10 bits.
Wouldn't that be 9 bits minimum? I don't think you can but a 9 bit A/D, so this is an academic question.

#### lightingman

Joined Apr 19, 2007
374
Yeh....8 bit's = 255 + 0, 9 bits = 511 + 0 and 10 bit's = 1023 + 0....The A to D converter in th ePIC is software selectable for 8 or 10 bit's resolution...Daniel.

#### Kringjat

Joined Jan 15, 2008
4
Hey guys thks for the feedback till now and sorry for missing some infor ans for your infor yes its is for a compass my problem is to having a voltage and needs it to be converted to 360 degrees but is it possible to not use a pic because that what i wish to do having an adc to 3 7 segment display displaying 360 degrees as the highest value any ideas thks

#### Ron H

Joined Apr 14, 2005
7,014
Hey guys thks for the feedback till now and sorry for missing some infor ans for your infor yes its is for a compass my problem is to having a voltage and needs it to be converted to 360 degrees but is it possible to not use a pic because that what i wish to do having an adc to 3 7 segment display displaying 360 degrees as the highest value any ideas thks
A couple of questions:
1) How do you plan to convert from binary to BCD?
2) Don't you actually want to limit the highest number to 359?

#### beenthere

Joined Apr 20, 2004
15,819
How are you planning to generate the analog voltage? Will you use a servo potentiometer?

If you have some way to make a voltage that follows the compass rotation, you can scale it and use a panel meter. The meter uses A to D conversion to get the numbers to display.

#### lightingman

Joined Apr 19, 2007
374
Hi again....I did this last night.... 0 to +5v, reading 0 to 360 with a PIC and a 4511 multiplexed onto 3 LED displays.... The voltage can be scaled to any value between 0 and whatever....Daniel.