[Tinyos-help] Regarding ADC MICAz
Michael Schippling
schip at santafe.edu
Mon Jul 2 09:51:13 PDT 2007
This should be quite do-able...if you don't have a map,
I have a list of the 51 pinouts at:
http://www.etantdonnes.com/Motes/ATMEGApins.txt
Assuming that the (-) wire on your sensor is actually
battery ground, or that it can be connected to such,
you need to connect the other (+) wire to one of the
unused ADC inputs. If you are not using an external
sensor board then ADC1-6 are all available, otherwise
you'll have to figure out what is already used by
your other sensors.
For programming, in T1 (I hope T2 is somewhat similar...)
you do something like this in your config file:
RobotM.BCurrent -> ADCC.ADC[3];
and in the code file (RobotM.nc in this case):
uses { interface ADC as BCurrent; }
then start a conversion somewhere, like in a Timer.fired() event:
BCurrent.getData();
and have a method to catch the result:
async event result_t BCurrent.dataReady( uint16_t data )
{
do_something_with = data;
return SUCCESS;
}
MS
Coalton Bennett wrote:
> Greetings All,
> I have a question regarding the 51 Connector MICAz Expansion
> Connector. I already have a sensor built which outputs an
> analog AC voltage measurement with a "maximum(peak)" amplitude
> of about 2 volts AC. The amplitudes are not strictly 2 volts
> in amplitude. The amplitudes can be anywhere between 0 and 2
> volts AC. I am looking to digitize this waveform with the A/D
> converter provided by the 51-pin expansion connector in the
> MICAz mote. The issue however is that the output of the sensor
> consists of just two wire leads (+) and (-)--"the ground". Is
> there anyway that I could possibly get my sensor to work with
> the expansion connector provided with the MICAz mote? My
> overall objective is to digitize the waveform and have this
> information sent to the PC and reconstruct the waveform. If
> you could provide me with some insight regarding this I would
> greatly appreciate it.
>
> -----------------------------------------------------------------------
> Below is the response that I received from Crossbow's Technical Support.
> It seems as though this might be correct, however I need to know if the
> non-inverting amplifier that I need to build should be AC or if it should
> be a regular DC non-inverting amplifier. The difference between the two
> different types "Non-Inverting DC Amplifier" and "Non-Inverting AC
> Amplifier" is provided here on pages 1 and 2 respectively:
> www.national.com/an/AN/AN-31.pdf. If someone can provide me with some
> feedback, I would greatly appreciate it. Thank you all once again.
> -----------------------------------------------------------------------
>
> The 51 pin connector has ADC channels to the Atmel processor ADC[0..7].
> They are 10 bit (probably 8.5 bit effective), and can be set to read in
> one-shot mode or continuously. They are supported in both Moteworks and
> Tinyos in many applications. The inputs are scaled for a range of 0V to
> Vbattery, which is usually between 3.2 and 2.7 volts. The only issue is
> if the AC waveform is centered on ground (does it swing negative?). If
> it has an average value centered around 0V, then it will be necessary to
> "lift" the waveform by giving it a dc offset of Vbattery/2. This will
> ensure the entire waveform is within the capture range. Any unity gain
> stable op-amp can do this with a simple voltage divider in the feedback
> circuit. Apply the output of the op-amp to the ADC input, and use one
> of the standard data sampling apps as a basis for readings.
> (Moteworks\apps\tutorials\lesson_2)
>
> -C.B.
>
>
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
More information about the Tinyos-help
mailing list