User Tools

Site Tools


oak:tutorials:breadboard_power

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
oak:tutorials:breadboard_power [2016/08/14 08:55]
brohan
oak:tutorials:breadboard_power [2016/08/14 13:59]
brohan
Line 1: Line 1:
 ===== Oak: 9V Powered Breadboard ===== ===== Oak: 9V Powered Breadboard =====
  
-======= Work in Progress ======= 
  
 {{http://​digistump.com/​wiki/​_media/​oak/​tutorials/​module_board_sleep.png?​300| {{http://​digistump.com/​wiki/​_media/​oak/​tutorials/​module_board_sleep.png?​300|
Line 16: Line 15:
 | 9V to Barrel Jack Cable |1| | | 9V to Barrel Jack Cable |1| |
 | 9V Battery |1| | | 9V Battery |1| |
-| Jumper Wires |2| |+| PushButton |1| | 
 +| Jumper Wires |4| |
  
 This tutorial will cover using a breadboard power module (DC), as well as Oak power conservation via a sleep function. There are more ways to conserve Oak power including cutting out the onboard LED power, but those are beyond the scope of this example. This tutorial will cover using a breadboard power module (DC), as well as Oak power conservation via a sleep function. There are more ways to conserve Oak power including cutting out the onboard LED power, but those are beyond the scope of this example.
Line 27: Line 27:
 === Sleep === === Sleep ===
  
-The ESP8266 chip that is the heart of the Oak has the ability to put your device into a sleep mode to conserve power by way of 4 different Deep Sleep modes: WAKE_RF_DEFAULT,​ WAKE_RFCAL, WAKE_NO_RFCAL,​ and WAKE_RF_DISABLED. This tutorial will explore the basics of WAKE_RF_DEFAULT,​ which relies on the internal Oak timer (which remains active while in Deep Sleep) to wake the device automatically+The ESP8266 chip that is the heart of the Oak has the ability to put your device into a sleep mode to conserve power by way of 4 different Deep Sleep modes: WAKE_RF_DEFAULT,​ WAKE_RFCAL, WAKE_NO_RFCAL,​ and WAKE_RF_DISABLED. This tutorial will explore the basics of WAKE_RF_DEFAULT,​ which relies on the internal Oak timer (which remains active while in Deep Sleep) to wake the device automatically.
  
 In order to recover from ANY Deep Sleep mode you MUST jumper the Reset pin and the Wake pin, otherwise the Oak can't trigger itself to wake up. If you fail to connect these two pins, the only option you have to wake the device is to manually enter Config Mode. In this tutorial, the Reset and Wake pins are connected via a yellow jumper wire In order to recover from ANY Deep Sleep mode you MUST jumper the Reset pin and the Wake pin, otherwise the Oak can't trigger itself to wake up. If you fail to connect these two pins, the only option you have to wake the device is to manually enter Config Mode. In this tutorial, the Reset and Wake pins are connected via a yellow jumper wire
 +
 +When the Oak wakes up from a deep sleep, it will ALWAYS start at the top of the loop function. ALWAYS. Plan accordingly.
 +
 +In our example below the First Blink Sketch incorporates a Particle.publish to track our Oak's state, a switch the Oak between sleep and non-sleep mode via in if statement, and a button attached to a trigger pin.
 +
  
 The Oak pin diagram can be found here: [[http://​digistump.com/​wiki/​oak/​tutorials/​pinout]] ​ The Oak pin diagram can be found here: [[http://​digistump.com/​wiki/​oak/​tutorials/​pinout]] ​
  
  
 +===== Circuit =====
  
 +{{http://​digistump.com/​wiki/​_media/​oak/​tutorials/​module_board_sleep.png?​300|
 +{{http://​digistump.com/​wiki/​_media/​oak/​tutorials/​module_board_sleep.png?​600|}}
  
 +Note: There is a yellow jumper between the Reset and Wake pins to enable to Oak to wake itself out of Deep Sleep, otherwise you will be stuck in Deep Sleep mode until you manually put the Oak into Config Mode via a jumper wire from Pin 1 to GND at start-up for a few seconds.
 ===== Code ===== ===== Code =====
  
Line 47: Line 56:
  
 #define SLEEP_PIN 5 #define SLEEP_PIN 5
-int sleepTimeS = 10;+int sleepTimeS = 10; // Use this to easily change the sleep time
  
 void setup() void setup()
Line 76: Line 85:
 </​code>​ </​code>​
  
-{{http://​digistump.com/​wiki/​_media/​oak/​tutorials/​power_supply_basic.png?300| + 
-http://​digistump.com/​wiki/​_media/​oak/​tutorials/​power_supply_basic.png?600|}}+{{http://​digistump.com/​wiki/​_media/​oak/​tutorials/​power_sleep_image.jpg?300| 
 +http://​digistump.com/​wiki/​_media/​oak/​tutorials/​power_sleep_image.jpg?600|}} 
 + 
 +When you run the above code, with your button in an open state, your onboard LED will blink once, then it puts the Oak in a timed Deep Sleep mode, meaning your onboard LED will cease to blink, until the Oak wakes itself up. blinks the LED once, and immediately goes back to sleep. Not enough time for your Oak to reconnect to the internet and send any information. Closing the button circuit however keeps your Oak from sleeping.
  
  
Line 130: Line 142:
  
 Creating IoT is good, creating IoT that are portable, without the need to run pesky wires, for your internet connection, or power is even better. In cases like this, energy is at a premium, and needs to be conserved at all costs, and luckily the Oak allows us to do just that with its sleep modes. Creating IoT is good, creating IoT that are portable, without the need to run pesky wires, for your internet connection, or power is even better. In cases like this, energy is at a premium, and needs to be conserved at all costs, and luckily the Oak allows us to do just that with its sleep modes.
 +
 +What sensors will you replace the button with to keep you Oak awake long enough to send data, and then go back to sleep?
  
  
oak/tutorials/breadboard_power.txt · Last modified: 2016/08/14 13:59 by brohan