Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waspmote with smart water ions board high power consumption in deep sleep mode #33

Open
StasOmel opened this issue Nov 6, 2018 · 2 comments

Comments

@StasOmel
Copy link

StasOmel commented Nov 6, 2018

It's about ~270 uA instead of ~30 uA.
Fix: pins to low state at the end of WaspSensorSWIons::OFF()
digitalWrite(DIGITAL2, LOW);
digitalWrite(DIGITAL5, LOW);
digitalWrite(DIGITAL4, LOW);
digitalWrite(DIGITAL3, LOW);
digitalWrite(DIGITAL1, LOW);

@Libelium
Copy link
Owner

Libelium commented Nov 6, 2018

Thanks for your contribution!

@StasOmel
Copy link
Author

StasOmel commented Nov 6, 2018

After some tests, I've found out that this change fix power consumption issue, but it break measures (first two measures Ok, but for next voltage for all sensors is 0.0). I've made some additional changes and now it works OK (correct consumption and correct measure).
Here are my current ON and OFF functions:

void WaspSensorSWIons::ON(void)
{
	// Turn on the power switches in Waspmote
	PWR.setSensorPower(SENS_5V, SENS_ON);
	PWR.setSensorPower(SENS_3V3, SENS_ON);
	delay(1000);
	
	// These pins manage the analog multiplexor
	// Digital pin 2 is for selecting
	pinMode(DIGITAL2, OUTPUT);
	pinMode(DIGITAL5, OUTPUT);
	pinMode(DIGITAL4, OUTPUT);
	pinMode(DIGITAL3, OUTPUT);

	digitalWrite(DIGITAL2, HIGH);
	digitalWrite(DIGITAL5, HIGH);
	digitalWrite(DIGITAL4, HIGH);
	digitalWrite(DIGITAL3, HIGH);

	pinMode(DRDY, INPUT);
	delay(100);
	
	// Configure the ADC
	myADC.begin();
}
void WaspSensorSWIons::OFF(void)
{
	// Turn on the power switches in Waspmote
	PWR.setSensorPower(SENS_5V, SENS_OFF);
	PWR.setSensorPower(SENS_3V3, SENS_OFF);
	delay(100);
	// pinMode(DIGITAL2, INPUT);
	// pinMode(DIGITAL5, INPUT);
	// pinMode(DIGITAL4, INPUT);
	// pinMode(DIGITAL3, INPUT);
	// pinMode(DIGITAL1, INPUT); 
	
	// Disable SPI flag
	SPI.isSmartWaterIons = false;
	SPI.end();

	digitalWrite(DIGITAL2, LOW);
	digitalWrite(DIGITAL5, LOW);
	digitalWrite(DIGITAL4, LOW);
	digitalWrite(DIGITAL3, LOW);
	// digitalWrite(DIGITAL1, LOW);
}

Anyway, please check this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants