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

LM35 & a PhotoCell


  • Please log in to reply
8 replies to this topic

#1 CT1

CT1

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 31 January 2015 - 05:11 PM

I have a ND+v1 using 4.2 firmware.  I have a LM35 temperature sensor wired to analog pin 5 and a photocell wired to analog pin 0.  The temperature sensor works great until I connect the PhotoCell then the temp immediately jumps anywhere from 10 to 30 degrees. 

 

The temperature sensor logic is throwing away the first reading and then averaging the next 10 readings and it's consistent and  accurate.

 

The photocell logic is triggered maybe once a day so it's not doing a lot of readings, it just has to be connected to bother the LM35.

 

I've read many articles but haven't been able to figure this one out.  Can anyone advise?

Thanks   



#2 bulletprooffool

bulletprooffool

    Member

  • Members
  • PipPip
  • 12 posts

Posted 02 February 2015 - 08:21 AM

Are you sure you have no alternate paths between the 2 devices, which may be affecting your voltage reading on the temp sensor?

Perhaps a diagram / pic?



#3 CT1

CT1

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 02 February 2015 - 12:20 PM

Anything?  Anybody?



#4 CT1

CT1

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 02 February 2015 - 12:30 PM

Hey Bulletprooffool, thanks for the reply.  Not sure what you are asking regarding alternate paths?  I don't have anything configured or wired on the other analog pins.  Both devices work independently but not together.  I've tried several different LM35s getting same results.  Let me see about getting a picture.  Thanks



#5 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 03 February 2015 - 08:34 PM

Hi CT1,

 

Tell us more about the "PhotoCell".

Is this a Light Dependant Resistor LDR or a solar cell that generates a voltage?

Either way, a link to a datasheet would be good.

 

If it is a solar cell, do you know the output voltage?

Is it possible you are driving too high a voltage into the analogue pin 0 ? (this could affect the ADC circuit in the Netduino)

Is the temp sensor affected if the cell is kept in the dark?

 

If it is a resistive sensor, how are you connecting it to the Netduino?

Have you used another resistor to form a voltage divider? Is the divider connected to 3.3V or 5V? (5V may be too high).

 

It might help to tie the other unused analogue inputs to ground each via a separate resistor - say something in the range 1K to 5K.

 

Lots of questions - hopefully one of them will provoke a eureka moment.

 

Paul



#6 CT1

CT1

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 03 February 2015 - 11:06 PM

Hey Paul

Thanks for taking the time to ask me questions.  I'll answer as many as I can.

 

It's a simple LDR that I bought here www.jayconsystems.com/cds-photocell.light-sensor.html (no data sheet).

I have it connected to 3.3V with a 10K resistor across output & ground.  I followed instructions I found on adafruit.

 

The cell works in the dark & in the light but it does seem to have an affect on the LM35(? or is it the other way around?)

The photocell is only read when it gets a command from ThingSpeak (maybe once a day).  Most of the time it just sits there doing nothing.

 

The LM35 is attached to 5v and works fine when the Photocell is unplugged.

 

Just 10 minutes ago I added a second LM35 to my breadboard and attached it to analog pin4.  When I displayed the readings

A4 was 99F and A5 (the original LM35) was now 68F and holding steady. Aha! Then I plugged the A4 pin to ground and the original sensor is still holding steady and working like it should.  I think I was picking up your typing before you sent it.   ThankYou

 

I was thinking about moving the photocell to the 5v breadboard to see if that made a difference?

Thanks again

Cyn



#7 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 05 February 2015 - 05:02 PM

Hi Cyn,

 

This is just a guess, but A5 and A4 are dual purpose (they are also I2C on the Plus v1).

 

Try using A0,A1,A2 & A3 (e.g LM35 on A3 and LDR on A0).

See if the problem has gone away.

 

I am not saying that you are using A4 & A5 as I2C - I am just wondering if they are behaving differently to the other analogue pins.

 

Paul



#8 CT1

CT1

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 06 February 2015 - 01:09 PM

Hi Ya

Ok then ... I've tried all kinds of combinations but it always comes back to needing a 3rd analog pin defined and connected to ground.

 

Current configuration is:

static SecretLabs.NETMF.Hardware.AnalogInput AP0_temperature = new SecretLabs.NETMF.Hardware.AnalogInput(pins.GPIO_PINS_A0);

static SecretLabs.NETMF.Hardware.AnalogInput.AP1_dummy = new SecretLabs.NETMF.Hardware.AnalogInput(pins.GPIO.PINS_A1);

static SecretLabs.NETMF.Hardware.AnalogInput.AP2_photo = new SecretLabs.NETMF.Hardware.AnalogInput(pins.GPIO.PINS_A2);

 

I've checked all the readings on the multimeter that I know how and everything seems ok. 

The temp sensor is giving me .23v and the photocell is 1.65v

 

Thank you for offering suggestions

Cyn



#9 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 06 February 2015 - 08:13 PM

Sounds a bit spooky.

 

I don't remember having issues with my analogue sensors.

(I am using three Sharp Infra-Red range sensors.)

 

Anyway, glad to hear you have a working solution.

Remember to have fun - Paul






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.