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

AnalogInput values fail to change


  • Please log in to reply
7 replies to this topic

#1 trustme

trustme

    Member

  • Members
  • PipPip
  • 12 posts

Posted 31 August 2010 - 10:39 PM

I have another issue. I have a MaxSonar which I've connected to Analog port 1-5... tried them all. The Read function always returns 1023. I've hooked up a multimeter and I can see the value is changing as objects are placed in front of the sensor. I've reset the board. I've created and disposed an Interrupt port to disable the resistor mode.

            InterruptPort test = new InterruptPort(Pins.GPIO_PIN_A0, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);
            test.Dispose();

            //OutputPort p = new OutputPort(Pins.GPIO_PIN_A0, false);
            //p.Dispose();
            alarm2 = new AnalogInput(Pins.GPIO_PIN_A0);
            alarm2.SetRange(0, 100);

I'm on firmware 4.1.0.2 as I'm using Mac/Parallels to test.

It appears something is amiss. This seems like it should be a very trivial setup. 3 wires out of the MaxSonar, power, ground, and to one of the analog pins.

Is there something else I'm missing?

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 31 August 2010 - 11:10 PM

Is there something else I'm missing?


The Atmel ARM processors don't have a built-in AREF. Have you wired the 3.3V power header to the AREF pin (on the opposite side of the board)?

Chris

#3 greg

greg

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationChicago, IL

Posted 31 August 2010 - 11:58 PM

I have another issue. I have a MaxSonar which I've connected to Analog port 1-5... tried them all. The Read function always returns 1023. I've hooked up a multimeter and I can see the value is changing as objects are placed in front of the sensor. I've reset the board. I've created and disposed an Interrupt port to disable the resistor mode.

            InterruptPort test = new InterruptPort(Pins.GPIO_PIN_A0, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);
            test.Dispose();

            //OutputPort p = new OutputPort(Pins.GPIO_PIN_A0, false);
            //p.Dispose();
            alarm2 = new AnalogInput(Pins.GPIO_PIN_A0);
            alarm2.SetRange(0, 100);

I'm on firmware 4.1.0.2 as I'm using Mac/Parallels to test.

It appears something is amiss. This seems like it should be a very trivial setup. 3 wires out of the MaxSonar, power, ground, and to one of the analog pins.

Is there something else I'm missing?


Like Chris said, cross connect the header to AREF.

Chris - just so you know while the MaxSonar can be powered 3.3V it's better to power it 5V (more range). Is there a problem hooking AREF up to 5V?

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 01 September 2010 - 12:36 AM

Chris - just so you know while the MaxSonar can be powered 3.3V it's better to power it 5V (more range). Is there a problem hooking AREF up to 5V?


The AT91SAM7X (ARM) chip used on the Netduino is 3.3V--so it needs 0-3.3V analog inputs. You could always use an analog voltage conversion circuit which brings your 5V analog signals down to the 2.5V or 3.3V range--but it's probably best just to run it off of 3.3V in the first place (unless you need range, etc. for other reasons).

Chris

#5 greg

greg

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationChicago, IL

Posted 01 September 2010 - 12:39 AM

$$$ turn into High Speed Robot, which needs max range on sensors to protect said $$$ from running into walls. :)

#6 trustme

trustme

    Member

  • Members
  • PipPip
  • 12 posts

Posted 01 September 2010 - 02:59 AM

Ahhh... thanks so much. Wiring the 3.3V header to the AREF header works. I still have so much to learn about hardware. Thanks for the lesson!

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 01 September 2010 - 03:15 AM

$$$ turn into High Speed Robot, which needs max range on sensors to protect said $$$ from running into walls. :)


:)

#8 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 01 September 2010 - 04:03 AM

(Greg is my partner on the high speed robot project. Only difference is that he has a brushless version of my truck :rolleyes: )




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.