Pages: [1]   Go Down
Author Topic: Analog input: PWM  (Read 5363 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone,
I have just received my first Arduino, and am very impressed with it. Hardware that's simple enough for a software guy like me! ;D

However, I've also run into my first problem. I'm trying to read an analog control voltage that I measured to be in the 0-5 V range. Couldn't be simpler as it is already in the perfect range for an Arduino, right? Well, what I discovered after trying it out was that the voltage is microprocessor controlled, and looks like this when I read it from the Arduino:


So, I am assuming this is some kind of pulse-width modulation..?  :-?
For the record, reading the analog input as such works ok, with the connection in the AnalogInput tutorial. My connection is the same, except ground goes to ground and analog0 to the control voltage on the device.

So, my question is: how should I go about reading the voltage correctly (so that the value I get is unfluctuating, like the display on my voltmeter)?

Thanks in advance smiley
« Last Edit: December 21, 2009, 03:36:41 pm by dep » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17262
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To convert a PWM signal to a true analog voltage it has to pass through a low pass filter. That can be as simple as a resistor/cap filter to a op-amp active filter. Search around the site you should fine something on using a low pass filter.

Lefty
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33358
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This goes a little into filtering a PWM signal:-
http://www.thebox.myzen.co.uk/Tutorial/PWM.html
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Alright, thanks for the tips! I will post about my progress as I make some smiley-wink
Happy holidays!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Alright! I think I actually understood the PWM guide, to a degree, and managed to get the input working. Many thanks for the help! smiley
You can have a look at my project here.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33358
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Glad you got it working, thanks for the link to the PWM page.
Cheers.
Logged

UK
Offline Offline
Sr. Member
****
Karma: 1
Posts: 491
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is it really measuring brain activity, or is it something else like electrical signals from muscle contractions in your forehead when you frown in concentration?

Andrew
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33358
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

My guess is the latter.  smiley-wink
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is it really measuring brain activity, or is it something else like electrical signals from muscle contractions in your forehead when you frown in concentration?

From Wikipedia: "EEG is the recording of electrical activity along the scalp"
So, it is measuring brain activity, and it is measuring electrical signals on your forehead smiley
It's a science toy, so it is not to be taken too seriously, but the principle is the same as in medical EEG. The main differences are probably resolution, and the fact that a real EEG cap looks like this:

smiley-wink
« Last Edit: January 20, 2010, 07:07:30 am by dep » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33358
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So, it is measuring brain activity, and it is measuring electrical signals on your forehead

So you put an electrode on your head. How do you tell if the resulting signal is coming from the brain activity or from muscle activity?

Quoting a definition of what an EEG recording is does not mean that is what you have.
Logged

Pages: [1]   Go Up
Jump to: