Digital Outuput

03 Dec 2009

Hello  every one

Please how can i change the voltage of a digital out to set  up it at 1.3 and not at 3.3?

Also can I set  up An AnalogIn at 500mV when i ve on it 1.5V??

Tk for the helping

Regards

 

Antonio

04 Dec 2009

You would need to use a PWM output to set a value of 1.3 (note you may need to put a capacitor on the output to stabilise the voltage depending on the load).

Not quite sure I understand your second question, do you want to offset your input i.e. subtract 1v or are you wanting to change the output of the 1.5v source?

05 Dec 2009

I m building a Thermometer sensor  with an output of 500mV at 50C, so now, I  go to set up A digital out put and and analog in, more i went to build a circuit  like that. Pin Digital out to Pin Analog In, thermistor, and Pin Analog In to  Pin Gnd a resistor = resistor value of thermistor at 25C... , to linearize now i  went to declere an Analog out to  reach 500mW when my theristor measure 50C  so i did:

Suppose my Analog In is = 2.2V I did:

AnalogOut=AnalogIng*0.0625, but the max value i can reach is 150mV, if i go to change 0.06 in 0.01 my voltage go up and not down,  so  i was thinking to change DigitalOut  to put less,  hovewer for Ohm  my AnalogOut  should  be up my, hope is clear now :)

And u can help me :)

Thak you so much

Regards

Antonio

05 Dec 2009

Hi Antonio,

Antonio Arnone wrote:
Please how can i change the voltage of a digital out to set up it at 1.3 and not at 3.3? Also can I set up An AnalogIn at 500mV when i ve on it 1.5V??
It sounds like you want a Potential Divider. This is just a couple of resistors to provide an output voltage that is a fraction of the input voltage.

So, for example:

Vinput(0v, 3.3v) --+
                   |
                  +-+
                  | | R1
                  | |
                  +-+
                   |
                   +----> Voutput(0v, 1.3v)
                   |
                  +-+
                  | | R2
                  | |
                  +-+
                   |
            GND ---+---

Then you need to calculate some values for R1 and R2, which is based on the ratio/fraction you need. The calculation is therefore:

Voutput = Vinput * R2 / (R1 + R2)
So something like R1 of 15k and R2 of 10k, would give you:

Voutput = 3.3 * 10 / (10 + 15) = 1.32v
For the AnalogIn case, the range is normalised between 0.0 (0v) and 1.0 (3.3v). Therefore, to scale it to another linear scale you would just multiply by the maximum value you wanted to see. So if you wanted your AnalogIn to range between 0.0-3.3 as the input voltage changed between 0v and 3.3v (i.e. represent the actual voltage), you'd simply do:

AnalogIn x(p19);

float voltage = x * 3.3;
If you wanted it to range between 0.0 and 0.3, you'd multiply by 0.3.

Hope that helps you get it working.

Simon

07 Dec 2009 . Edited: 07 Dec 2009

Hello Simon

Tk so much

Regard

Antonio

26 Mar 2013

hi all ; can you give me an electronic circuit in order to convert analog signal from thermistor for introduce it in the analog pin of mbed card