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

NetduinoPlus2 Power Question

n+2 power lcd

  • Please log in to reply
6 replies to this topic

#1 zorlack

zorlack

    New Member

  • Members
  • Pip
  • 9 posts

Posted 03 January 2013 - 04:03 AM

I'm trying to read the temperature off a TMP36 temperature sensor, but I've found that I when I have an LCD connected to the Netduino I get incorrect results.

 

Attached File  light-temp.jpg   117.92KB   36 downloads

When I have the LCD connected I get temperatures which seem to fluctuate and are off significantly. When I remove the LCD things tend to be fairly steady. The LCD I'm using is is SparkFun's 3.3V 16x2 Serial Enabled LCD. The documentation says that this LCD draws about 60ma when the back-light is on. 

 

Is this too much for the 3.3v bus on the Netduino? Right now I'm powering via USB, would this be different if I was using wall power?

 

Whats the best way to handle this situation?

 

Many thanks!



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 January 2013 - 06:36 AM

Hi zorlack,

 

Netduino Plus 2 can deliver several 100 milliamps of power to the 3V3 header, so you shouldn't have any troubles there.

 

ADCs on microcontrollers can be a bit tricky.  We've included bulk smoothing caps to help even out the analog readings...but fluctuations in power draw can still affect things a bit.  Typically you'll get best results by using a dedicated ADC chip...but you can do a lot with an onboard ADC.

 

How far are your analog values fluctuating?

 

Also, what communication protocol are you using to drive your LCD?

 

Chris



#3 zorlack

zorlack

    New Member

  • Members
  • Pip
  • 9 posts

Posted 03 January 2013 - 01:20 PM

The analog values were off significantly. (The temperature here is about 20C I was getting readings as high as 40C, and my average readings were about 6C high)

 

Eventually I started using the TMP36 object in the NETMF toolbox, but originally I was trying to do it myself. What I saw was that when I did an AnalogInput.ReadRaw() sometimes I was getting values significantly higher than 1023. I presumed that this was related to the bitwise precision of the AnalogInput object so I tried instantiating it with: 

 

AnalogInput input = new AnalogInput(AnalogChannels.ANALOG_PIN_A1, 10);

But this caused it to throw an Invalid Argument Exception. I'm not sure if that's necessary or not. (The documentation for the AnalogInput constructor is a bit borked)

 

I checked bus voltage, and with and with-out the LCD I was reading exactly 3.30v.

 

  • Can I connect things to the 3.3V header while the microcontroller is running?
  • Would I be better off powering the LCD using the 5V header and voltage dividing resistors?

 

As for the LCD, it's being driven by the NETMF SerialPort object. Which I presume is just a 9600bps serial port transmitting out GPIO1.

 

Thanks so much for your help!

 

-Z



#4 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 03 January 2013 - 01:51 PM

i power all my stuff external.

 

i had pretty unstable reading on my temp sensor when i used a wall adapter.

with a rechargable akku and some switching regulators is aoutstanding smooth.

you should also place a 100nf cap right before the sensor

 

//edit: iam not using the precision bit setting in the constructor)



#5 zorlack

zorlack

    New Member

  • Members
  • Pip
  • 9 posts

Posted 03 January 2013 - 02:01 PM

i power all my stuff external.

 

NooM, forgive my ignorance, but does that mean you have one PS which powers the Netduino, and another which powers your sensors? Does that mean you have two connections to Mains, or are are you using two sets of batteries?

 

Regarding the capacitor: Is it simply a matter of putting the capacitor between +3.3 and the Power Input of the TMP36? Is that simply to smooth out the voltage, in-case of minor dips?

 

Thanks so much!

 

-Z



#6 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 04 January 2013 - 11:36 AM

more or less yes. i use one battery/wall adapter/whatever. (its 3.3 volt)

- the wall adapter didnt work very well - temp sensor had +/- 5 C

 

i than step this up to 5v, with the 5v i power my netduino. (nothing else, cos i only have 3.3v parts)

 

and than i step the 5v down again to power all 3.3v devices.

that may sound a bit weirdo, but it more efficient than using the onboard converter (mine are switching)

and i have way more power at the 3.3v rails (2 amps without cooling)



#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 04 January 2013 - 11:42 AM

Hi zorlack  
What I saw was that when I did an AnalogInput.ReadRaw() sometimes I was getting values significantly higher than 1023. I presumed that this was related to the bitwise precision...
Ah yes, Netduino Plus 2 will give you values of 0-4095, instead of the 0-1023 that you'd get on Netduino Plus 1. This is because of the higher precision. I'd recommend using AnalogInput.Read() which will return a floating point between 0.0f and 1.0f. That will give you a consistent experience across all boards and ADCs. Chris




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.