PDA

View Full Version : AD input and 7segment dysplay output



ruijc
- 16th November 2007, 13:27
Hi all,

Being my self at an early stage in self learning this wonderfull pic world, I'm always trying to find interesting circuits and code to build and learn.

This time I remembered to make a car voltage monitor.
This way I can learn how to use the Analog input of a pic, process the values and display them out.

In my mind draft I will use one Analog input to receive the voltage.
Since I will be working with voltages from 14v to 10v i will need a voltage divider to drop down to 5v ( one of the resistors I might use a pot to calibrate ).

Then the pic will keep reading the input voltage and show it in one 3 digit 7segment display (xx,x volts).

From left to right:
Digit one will only need 1 i/o (to display 0 and 1 )
Digit two will need 3 i/o ( to display 0 through 5 is enough )
Digit three will need 4 i/o ( 0-9 )

I'm guessing I will need some 4511 to drive the digits.

Will also add 3 leds ( red,yellow,green ) as limit warnings.

Besides the xtal, caps and resistors I guess that I will need no more components for this.

My questions are for the picbasic code for :

the analog readings ( what AD intructions ? )
working with the values ( take the value and compare…like…>12v green =12v yellow <12v red )
Output the value ( a simple way to take the value, split it and send each digit through it's I/O pins )

I tried to get picbasic examples for this but I find everything to output though serial and nothing like I want :S

Thanks in advance

mister_e
- 16th November 2007, 13:45
No you really don't need any extra drivers, use the multiplexing method.
http://melabs.com/resources/articles/ledart.htm
http://melabs.com/resources/samples/pbp/7segment.pbp
http://www.picbasic.co.uk/forum/showthread.php?t=1044

for the ADC, you may want to use ADCIN. Simple search within this forum will give you few hits ;) Also, have a look at the following
http://melabs.com/resources/samples/pbp/adcin10.bas
http://www.rentron.com/four-channel-ad.htm
http://www.rentron.com/PICX2.htm

HTH