[Avrora] How to implement a temperature sensor?
zflai at ust.hk
Tue Aug 28 10:39:21 PDT 2007
To my understanding, "PE5" is related to data, while "PC2" is related to
power (see the mica2 schematic, page 4, "PC2" is connected to "PW2" of the
sensor board). Actually, I have change the "PC2" pins in:
lightSensor = new LightSensor(amcu, 1, "PC2", "PE5");
statement, ranging from "PC0" to "PC7", and Avrora works. But other pin
names will invalidate Avrora. So, I don't think you can simply omit the
By the way, how Avrora works when WSN applications contains sensors other
than light sensors. I could not locate the site where Avrora provides data
to these sensors.
From: Roy [mailto:roy at cs.hmc.edu]
Sent: Wednesday, August 29, 2007 1:13 AM
To: Zhifeng Lai
Cc: Avrora; 'Roy'; 'Benjamin Titzer'; 'Zhifeng Lai'
Subject: Re: [Avrora] How to implement a temperature sensor?
The plot thickens!
I agree with most of your description below. Looks like you have done a
fine job tracing the pins "INT1" and "ADC1" back to the ATMega128.
However, "INT1" aka "PE5" does in fact control power to the light sensor by
providing the voltage that is fed through the photo-resistor.
More mysterious is "PC2". My understanding is that "PC2" is used to turn
the sounder on or off. Perhaps this is a bug in Avrora's light sensor
object? I would expect a LightSensor where all occurrences of "on" and
"onPin" are removed. See attached patch file for the LightSensor for
details of what I have in mind.
Anyone up to take a third look at how "PC2" interacts with the light sensor
to provide another opinion on this? I can't help thinking that I have
On Tue, Aug 28, 2007 at 11:57:46PM +0800, Zhifeng Lai wrote:
> Dear Roy,
> I am sorry I could not quite follow your pin tracing statements.
> >From the sensor board datasheet, I see the light sensor uses "INT1"
> "ADC1" (5, 42), which corresponds to "PE5" and "PF1" (7, 60) on the
> mica2 schematic (page 4). I still confuse because in the Mica2 class,
> the light sensor is created using
> lightSensor = new LightSensor(amcu, 1, "PC2", "PE5");
> and I don't understand what corresponds to "PC2". In fact, the
> declaration of light sensor constructor is:
> public LightSensor(AtmelMicrocontroller m, int adcChannel, String
> onPin, String powPin)
> but I don't think "PE5" is a pin that controls power.
> Best regards,
> Yours sincerely,
> Zhifeng Lai
More information about the Avrora