Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Analog Outputs - Outputing varying voltages between 0v-3.3v

AnalogOutput

  • Please log in to reply
6 replies to this topic

#1 shiv.kumar

shiv.kumar

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 02 February 2016 - 12:46 PM

Does anyone know how to use the AnalogOutput ports? I'd like to be able to output voltages between 0v-3.3v using these ports.

 

I'm stuck at trying to initialize the ports. That is:

private AnalogOutput analogOutput = new AnalogOutput(Cpu.AnalogOutputChannel.ANALOG_OUTPUT_0);

Compiles ok, but I get an Exception at runtime. Exception message has no useful information. I've tried the other constructor overloads as well (with various values), but no luck.

 

I'm guessing the analog outputs have 8bit resolution? Also, if anyone knows, I'm guessing I could simply write values from 0-255 to get output voltages from 0-3.3v. Is this correct?



#2 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 02 February 2016 - 07:44 PM

As far as I am aware, the analog ports on the Netduino boards are input only.

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#3 shiv.kumar

shiv.kumar

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 02 February 2016 - 08:43 PM

Hi Nevyn, thanks for your reply.

 

Hmm, so we don't have analog output ports. I guess the other option is to use an external DAC? Has anyone tried a specific board?



#4 shiv.kumar

shiv.kumar

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 02 February 2016 - 08:48 PM

I'm trying to drive an LED bar graph (using the LM 3914 chip as the driver). So what I need is to provide it with voltages from 0v-3.3v (for my needs.).

 

I tried PWM, but it doesn't work as expected (not accurate). If anyone has done this using PWM I'd be interested is learning how.



#5 EddieGarmon

EddieGarmon

    Member

  • Members
  • PipPip
  • 24 posts

Posted 02 February 2016 - 11:25 PM

Add a simple RC circuit or ladder to the output of a PWM signal. The RC will level the voltage and will set the parameters for the quickness it responds to input change.



#6 shiv.kumar

shiv.kumar

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 03 February 2016 - 01:14 AM

EddieGarmon,

 

Thank you for the reply and suggestion.

 

I thought about doing that but didn't, thinking that would introduce delays in the response. However, I'll certainly try it as my needs for response times are not so drastic, however, accuracy is important. I'll get back to the forum once I've had an opportunity to try it.



#7 shiv.kumar

shiv.kumar

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 06 February 2016 - 03:21 PM

Alright, I took out some time to continue to play using an RC network to smooth out the PWM signal to simulate a "steady" DC voltage.

 

For my application of the Bar graph display I'm really only interested in being able to control the exact number of LEDs I want turned on or off. That is, I'm not so concerned about being able to read the actual analog voltage. Of course the LM 3914 is actually reading the analog voltage and turns on/off LEDs accordingly. But I'm only concerned with being able to send a PWM signal from the Netduino such that I can deterministically control the actual number of LEDs that need to be turned on. I say this because the RC network introduces lag and so the choice of the RC components could be different for your purposes. Further, I also need to be able to turn on all 10 LEDs at 3.3v.

 

I found that a 2.2K resistor connected to the PWM output pin on the Netduino and a 10uF capacitor connected between the other end of the resistor and ground works best. Of course the junction of the two is fed to the LM 3914 ICs pin 5. The LM 3914 and the LEDs are running off of 5v.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.