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

Audio->Analog input question


  • Please log in to reply
9 replies to this topic

#1 wabash9000

wabash9000

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationKansas

Posted 05 October 2010 - 07:05 AM

Hey guys. I just got my netduino today and started playing around with it. I'm having problems figuring out analog inputs. I copied the code from another thread to print the value of the input to the debug every 250 ms, but it isn't working as I expect it to. with nothing hooked up it's giving me a value of 1023 fairly stable, if I hook up a wire to it and wiggle the wire around it occasionally gives me a 511 reading. When I hook it up to ground I get a 255 and 511 readings(changing fairly randomly). Someone in the other thread said that hooking it up to ground should produce a zero reading. What am I doing wrong? could the wiggling of the wire indicate that I need to use a thicker wire? For the project I am working on I am making a deadmau5 head. I am wanting to make it take in input from my iphone and flash the eyes to the beat. I have a low pass filter that should filter at 125hz so that only the bass should be inputed into the netduino. Am I correct in thinking that I should be able to input from the low pass filter and then setup a threshold value and if the input value of the sensor is above the threshold value then flash the lights? I've read online that the output voltage of a headphone jack on an ipod/iphone maxes out at 1.1 volts. Any help you guys can give is greatly appreciated.

#2 MattW

MattW

    Member

  • Members
  • PipPip
  • 23 posts

Posted 05 October 2010 - 10:19 AM

Welcome mate! Check out this topic, it may help: http://forums.netdui...t-read-problems Cheers, Matt.

#3 hookedup

hookedup

    Member

  • Members
  • PipPip
  • 20 posts
  • LocationFlorida - USA

Posted 05 October 2010 - 11:56 AM

I realize in this case you may only want bass .. but in future projects .. a seven band EQ may be nice.

While it costs money (~30 bucks), I use the bliptronics.com spectrum analyzer shield. If you are a good solder, you could get an adapter and build your own using the raw chip. I have done both and would suggest just the shield for a one-off.

Shield:
http://www.bliptroni...aspx?ItemID=116

Chip only:
http://www.bliptroni...aspx?ItemID=111

It pulls seven bands and has a build in multiplexer .. so it only takes 2 digital and 1 analog pin. Been using this with the arduino for a while and it worked just fine with the netduino.

I am not affiliated with bliptronics but I can vouch for the quality and service as I have purchased at least four times from them and had delivery in about a week from AU each time.

I can provide working netduino code to read the bands if needed (my first code with the netduino - fair warning).

Hope this helps you or someone looking for graphical EQ in a box :)

EDIT:
FYI: I just tested the shield, created simple sample code and posted a link in the compatible shields section.

Here is a link to my post with working code:
http://forums.netdui...om-bliptronics/

#4 wabash9000

wabash9000

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationKansas

Posted 05 October 2010 - 02:52 PM

Welcome mate! Check out this topic, it may help:
http://forums.netdui...t-read-problems

Cheers,
Matt.

Thanks man, I have not had time to try this but seeing as how I was having the exact same problem as him, I'm sure this will work.

#5 wabash9000

wabash9000

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationKansas

Posted 05 October 2010 - 02:59 PM

I realize in this case you may only want bass .. but in future projects .. a seven band EQ may be nice.

While it costs money (~30 bucks), I use the bliptronics.com spectrum analyzer shield. If you are a good solder, you could get an adapter and build your own using the raw chip. I have done both and would suggest just the shield for a one-off.

Shield:
http://www.bliptroni...aspx?ItemID=116

Chip only:
http://www.bliptroni...aspx?ItemID=111

It pulls seven bands and has a build in multiplexer .. so it only takes 2 digital and 1 analog pin. Been using this with the arduino for a while and it worked just fine with the netduino.

I am not affiliated with bliptronics but I can vouch for the quality and service as I have purchased at least four times from them and had delivery in about a week from AU each time.

I can provide working netduino code to read the bands if needed (my first code with the netduino - fair warning).

Hope this helps you or someone looking for graphical EQ in a box :)

EDIT:
FYI: I just tested the shield, created simple sample code and posted a link in the compatible shields section.

Here is a link to my post with working code:
http://forums.netdui...om-bliptronics/

I think I might order one of those shields for this project. It looks to give me the options and control that I am wanting, and I built my "low pass" filter last night and found out that I built it wrong and it's actually a highpass filter, doh. Thank you very much for the code that helped me see how it works. If I was to never trigger the strobe would it stay in the low band?

#6 hookedup

hookedup

    Member

  • Members
  • PipPip
  • 20 posts
  • LocationFlorida - USA

Posted 05 October 2010 - 03:32 PM

Later today I can try it out and let you know. I think there is a decay per read (as I read in the specs) .. so you may want to read them as shown and just pull the first entry from Spectrum[] (or maybe combine 0 and 1 to get a better low .. some songs do not hit the super low). Experimenting with the values on screen always helps me determine the next action to take.

#7 wabash9000

wabash9000

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationKansas

Posted 05 October 2010 - 09:21 PM

Later today I can try it out and let you know. I think there is a decay per read (as I read in the specs) .. so you may want to read them as shown and just pull the first entry from Spectrum[] (or maybe combine 0 and 1 to get a better low .. some songs do not hit the super low).

Experimenting with the values on screen always helps me determine the next action to take.

I just got some time to play around with a audio input with the jumper as mentioned above and was able to get some values. One thing I found interesting was output voltage didn't change very much with volume level.

I had thought about using both the low channels because I was concerned about the lows being spread out. I think what I will do is have a loop running that does strobe(true)strobe(false) read input strobe(true) strobe(false) read input then reset(true) reset(false). I will read the documentation when I get the board to see if that will work the way I think it should.

Do you know how much work it would be to move the digital pins to ports 8 and 9? The website said it could be done. I ask because I have already built a board to hold 8 resistors and connectors to work with my led's and it plugs into ports 0-7.

#8 hookedup

hookedup

    Member

  • Members
  • PipPip
  • 20 posts
  • LocationFlorida - USA

Posted 05 October 2010 - 09:57 PM


I had thought about using both the low channels because I was concerned about the lows being spread out. I think what I will do is have a loop running that does strobe(true)strobe(false) read input strobe(true) strobe(false) read input then reset(true) reset(false). I will read the documentation when I get the board to see if that will work the way I think it should.


I would suggest just doing strobe(true) strobe(false) five more times and compare that with the results you get using the reset method.


Do you know how much work it would be to move the digital pins to ports 8 and 9? The website said it could be done. I ask because I have already built a board to hold 8 resistors and connectors to work with my led's and it plugs into ports 0-7.


Good question, I think there are jumpers on there you can use to change the pins (looking at the board, I see jp1 with 2 holes - may be it). Send your question to the e-mail at the "about us" URL and you will get an answer.
http://www.bliptroni...om/AboutUs.aspx

#9 bliptronics

bliptronics

    New Member

  • Members
  • Pip
  • 1 posts

Posted 06 October 2010 - 12:12 AM

Do you know how much work it would be to move the digital pins to ports 8 and 9? The website said it could be done. I ask because I have already built a board to hold 8 resistors and connectors to work with my led's and it plugs into ports 0-7.


Hi there - Ben here, I make the spectrum analyzer shield. I hope you like it.
You can change pins that are connected to the strobe and reset lines.
I've put two pads on the board, labelled as 'JP1'. You can connect wires to them and route them wherever you like.
If you want to use the pins 4& 5 for something else, just use a sharp blade to scratch through the traces near pins 4&5.

The eyes on a deadmau5 hat should pulse nicely - cool idea. (I love deadmau5 too).

Ben

#10 wabash9000

wabash9000

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationKansas

Posted 06 October 2010 - 04:19 AM

Hi there - Ben here, I make the spectrum analyzer shield. I hope you like it.
You can change pins that are connected to the strobe and reset lines.
I've put two pads on the board, labelled as 'JP1'. You can connect wires to them and route them wherever you like.
If you want to use the pins 4& 5 for something else, just use a sharp blade to scratch through the traces near pins 4&5.

The eyes on a deadmau5 hat should pulse nicely - cool idea. (I love deadmau5 too).

Ben

awesome. I ordered one earlier today. Can't wait to get it. When I'm all done with the mask I'll make a thread on here about it with my code and have a video of it running. It's going to be way overkill for the 1-5 time I'll wear it but it's been a blast building and playing with the netduino so far, so I think it's been money well spent.




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.