The AnalogOut Interface can be used to set the voltage on the analog output pin somwhere in the range of 0.0v to 3.3v. The 0.0v to 3.3v range of the !AnalogOut can be represented in software as a normalised floating point number from 0.0 to 1.0, or directly as volts or millivolts.
Hi! My name is chiky. I have a question. I have a fan that works 12V. I get move it with mbed Vout (3.3 V). But I wanna control it giving differents voltage. For this, I though I could use the analogic out, however I set 3.3V in analogic out [out.write(1.0f)] but the ventilator doesn't move and I check with multimeter that the measure is 3.3V. I think that is because there is no enough amp. I wonder if I could solve this with an Electronic assembly to give more AMP. Or another solution. Thanks.
Sorry for the tirade!
Hi! My name is chiky. I have a question. I have a fan that works 12V. I get move it with mbed Vout (3.3 V). But I wanna control it giving differents voltage. For this, I though I could use the analogic out, however I set 3.3V in analogic out [out.write(1.0f)] but the ventilator doesn't move and I check with multimeter that the measure is 3.3V. I think that is because there is no enough amp. I wonder if I could solve this with an Electronic assembly to give more AMP. Or another solution. Thanks.
Sorry for the tirade!
For increasing the current capabilities you must use a buffer. Remember that the mbed itself output is about 40mA .. for a FAN you need about 100mA for 1w type 12v fan. At 3,3V I think you might get only 2 speeds ( "spinning from time to time" and "stop" ). You must consider using a voltage conerter like AO for extending the range from 0-3,3 to 0-12 ( something like 4x ) and a repater (transistor) to be able to drive the fan properly. And also it might be easier to control the speed of the fan on a PWM output.
For increasing the current capabilities you must use a buffer. Remember that the mbed itself output is about 40mA .. for a FAN you need about 100mA for 1w type 12v fan. At 3,3V I think you might get only 2 speeds ( "spinning from time to time" and "stop" ). You must consider using a voltage conerter like AO for extending the range from 0-3,3 to 0-12 ( something like 4x ) and a repater (transistor) to be able to drive the fan properly. And also it might be easier to control the speed of the fan on a PWM output.
thanks "not important" your help is important for me. Could you recomend me an AO to buy? As you say mbed would have only 2 speed and I need more precision to get differents speed.
thanks "not important" your help is important for me. Could you recomend me an AO to buy? As you say mbed would have only 2 speed and I need more precision to get differents speed.
I solve my problem with a control for motors, I say because sb could have the same problem. Bye
Hi, I have a similar problem as you had before. I got a 5V 0.16A DC motor, and I don't know how to drive it. Can you give me some advice? THX
<<quote chikymanzanares>>
I solve my problem with a control for motors, I say because sb could have the same problem. Bye
<</quote>>
Hi, I have a similar problem as you had before. I got a 5V 0.16A DC motor, and I don't know how to drive it. Can you give me some advice? THX
I solve my problem with a control for motors, I say because sb could have the same problem. Bye
Hi, I have a similar problem as you had before. I got a 5V 0.16A DC motor, and I don't know how to drive it. Can you give me some advice? THX
I think maybe you can use transistor
Here is my "prototype" for driving a small electric motor using one of the Mbed's digital out pins (actually a PWM pin, but that's not important).
The Mbed can only source about 40mA from a single pin, so in order to drive an electric motor, one needs to use a transistor... The only transistor I had lying around were some BC337's, which are pretty normal NPN transistors, but the maximum current they can drive is 800mA... so I used this tool to find out what value resistor I needed on the Base... as the 5v electric motor I use had a resistance of 2.2ohms, I decided to use 400ohm resistor... which, if I've understood everything, will mean the maximum current through the transistor will be 654.5mA... Hooray! That gives me a 145.5mA tolerance for variance in the components :)
See below for a screenshot :)
/media/uploads/bloodline/mycircuit.jpg
-Edit- I've modeled the electric motor as a 2.2ohm resistor with a flyback diode, which I included in my design to protect the transistor from any reverse current off the motor (which I know happens with solenoids... not sure about motors).
<<quote alaxbeta20>>
<<quote chikymanzanares>>
I solve my problem with a control for motors, I say because sb could have the same problem. Bye
<</quote>>
Hi, I have a similar problem as you had before. I got a 5V 0.16A DC motor, and I don't know how to drive it. Can you give me some advice? THX
<</quote>>
I think maybe you can use transistor
Here is my "prototype" for driving a small electric motor using one of the Mbed's digital out pins (actually a PWM pin, but that's not important).
The Mbed can only source about 40mA from a single pin, so in order to drive an electric motor, one needs to use a transistor... The only transistor I had lying around were some BC337's, which are pretty normal NPN transistors, but the maximum current they can drive is 800mA... so I used this tool to find out what value resistor I needed on the Base... as the 5v electric motor I use had a resistance of 2.2ohms, I decided to use 400ohm resistor... which, if I've understood everything, will mean the maximum current through the transistor will be 654.5mA... Hooray! That gives me a 145.5mA tolerance for variance in the components :)
See below for a screenshot :)
/media/uploads/bloodline/mycircuit.jpg
-Edit- I've modeled the electric motor as a 2.2ohm resistor with a flyback diode, which I included in my design to protect the transistor from any reverse current off the motor (which I know happens with solenoids... not sure about motors).
http://mbed.org/forum/electronics/topic/2392/
I have noticed that the AnalogOut isn't behaving as expected.
In the above example program, each step increase should increase the voltage by 0.33V.
Connecting it to a oscilloscope, we should be able to see this in action.
The 1st step from 0V to 0.33V is detected but the consecutive steps are in error. It seems that the steps are decreasing in value exponentially.
The last step causes the output value to be at 550mV instead of the expected 3.3V.
Is there an explanation for this?
I have noticed that the AnalogOut isn't behaving as expected.
In the above example program, each step increase should increase the voltage by 0.33V.
Connecting it to a oscilloscope, we should be able to see this in action.
The 1st step from 0V to 0.33V is detected but the consecutive steps are in error. It seems that the steps are decreasing in value exponentially.
The last step causes the output value to be at 550mV instead of the expected 3.3V.
Is there an explanation for this?
I havent used the analog out yet, so assuming the software library is OK.
How do you measure that value? Perhaps you are loading the output. Is there a protective diode in your circuit that starts conducting and limits the voltage to 550mV? Curve could be exponentially in that case.
I havent used the analog out yet, so assuming the software library is OK.
How do you measure that value? Perhaps you are loading the output. Is there a protective diode in your circuit that starts conducting and limits the voltage to 550mV? Curve could be exponentially in that case.
The only thing the AnalogOut is connected to is a resistor.
I will be testing the AnalogOut without connecting it to anything today.
Edited:
It has worked as expected.
I am measuring the value using the oscilloscope.
The only thing the AnalogOut is connected to is a resistor.
I will be testing the AnalogOut without connecting it to anything today.
Edited:
It has worked as expected.
Hi!
I was wondering if I can use this one AnalogOut pin for four dc motors, which i want to control separately. Does anybody know if this works?
Thanks.
Hi!
I was wondering if I can use this one AnalogOut pin for four dc motors, which i want to control separately. Does anybody know if this works?
Thanks.
I haven't tried this but you could use an analogue switch from the DAC output to a sample an hold type circuit, e.g. a capacitor with a fet input op amp for each motor input. This would have to be refreshed at a rate faster than any signal decay.
But why noy add on a low cost SPI DAC? Microchip do some good 12 bit ones and from my experience will be less noisy.
I haven't tried this but you could use an analogue switch from the DAC output to a sample an hold type circuit, e.g. a capacitor with a fet input op amp for each motor input. This would have to be refreshed at a rate faster than any signal decay.
But why noy add on a low cost SPI DAC? Microchip do some good 12 bit ones and from my experience will be less noisy.
Please login to post comments.