# programmable pic to read 2 voltages and output one voltage

C

#### cengerer

hi there,
Im new to electronics and would like to build a microcontroller to read 2 independant voltages and generate an output voltage from that, all voltages are between 0.5 and 5 volts.

eg. input voltages = 0 and 1 and output would be 5
input voltages = 4 and 1.3 and output would be .5

Would this be hard? maybe using a 16F84-04 microcontroller with picbasic?

any help would be greatly appreciated.

thanks.

T

#### Todd

What is the algorithm you are using to determine the output (i.e. if the inputs are 1.5V and 3.2V, how would you calculate the output)?. If it is
simple, you might be able to build a circuit with a few of op-amps.

If you use a microcontroller, you would need two analog-to-digital converters (ADC), and one digital-to-analog converter (DAC). Some PIC microcontrollers have ADC's built into them, such as the 16F88 (unfortunately, the 16F84 does not). I don't think Microchip has any µC's that have built-in DACs. So you would still require an external DAC, such as the Texas Instrument TLC7628. Look for one w/ 8-bit parallel input because it will be easiest to interface to the µC. Also, when looking at DAC's and ADC's, you have to know what kind of precision you need. An 8-bit converter would give you 17.6mV precision,
where as a 10-bit would be 4.4mV (using 0.5V to 5.0V signals).

If you check out Microchip's website, you can do a parametric search for what you need. Also, their forum is a great source of info. If you are not dedicated to the PIC, Analog Devices makes MicroConverters, which have built-in ADC's AND DAC's.

The last option would be to find something off-the-shelf. For example, B & B Electronics make devices w/ analog inputs and outputs. They have a serial interface to your PC, so you could do the algorithm w/ VB or something similar.

Good Luck!

-Todd