TinyScreen+ RTC Time Display, External Interrupt & Sleep Mode
It is no secret that the OLED display screen on the TinyScreen+ can use a lot of power, and sometimes power preservation is very important for a project. This tutorial includes a program that uses the Arduino RTCZero library in order to wake the TinyScreen+ from sleep mode by pressing one of the four on-board buttons. As a bonus, the example will show how to display the date and time using the SAMD21 internal Real-Time Clock.
This tutorial has it all!
If this is your first time using the TinyScreen+, check out the TinyScreen+ getting started tutorial.
Materials
Hardware:
Software:
- Arduino IDE
- Arduino Libraries:
- TinyScreen Arduino Library (Download in the Arduino Library Manager)
- RTCZero Arduino Library (Download in the Arduino Library Manager)
- TinyScreen+ RTC & Interrupts Arduino Sketch
Power Consumption
Display On
The TinyScreen+ power consumption is determined by what is displayed on the screen. For a normal screen with a black background and white text (like for the program in this tutorial), the TinyScreen+ will consume 16-20mA on average - keep in mind that this is when there are no other TinyShields connected to the TinyScreen+. More boards will draw more power.
If you were using a TinyTV and playing videos from an SD Card, you would have a power consumption range between 40-90mA. This is an absurd range because of the variable pixel colors in different videos. If you were to play a mostly black background video you would be drawing around 40-60mA, whereas a colored background would draw anywhere from 55-75mA, and a white background would draw between 70-90mA. Darker colors draw less current, and lighter/whiter colors draw the most current.
Low Power / Sleep Mode
110µA is drawn when in sleep mode - so in the included program when the TinyScreen+ display is turned off it is only drawing around 0.1mA which will help prolong the life of the battery connected, and the length of time you can use your project wirelessly.
Software
For the TinyScreen+ Sketch, you will need to have downloaded the TinyScreen and RTCZero libraries. These can be found using the Arduino IDE Library Manager. Select Tools -> Library Manager and then type in "rtczero" and "tinyscreen". Then you can press "Install".
Plug the TinyScreen+ into your computer with a micro USB cable. Make sure the power switch is turned to on! Open the TinyScreen+ RTC & Interrupts Arduino Sketch in the Arduino IDE.
Make the correct Tools selections for your development board. If unsure, you can double-check the Help page that mentions the Tools selections needed for any TinyCircuits processor.
Upload the program.
Arduino Code
After uploading the program, the screen will appear blank - this is correct! Press a button to trigger the interrupt attached to the four buttons on the TinyScreen+ to "wake" the screen. The display will turn on for one second and show the date and time, then turn back off.
If you want to get your time on the TinyScreen+ to be very exact, set a time in the future, and then turn the TinyScreen+ on at that time. Uploading and programming the TinyScreen+ takes an undetermined amount of time - so this method will give you some better control.
Troubleshooting
This program may cause issues in uploading programs - luckily, this can easily be solved by putting the TinyScreen+ into bootloader mode. To put the board in bootloader mode, check out the troubleshooting section of the TinyScreen+ tutorial
Contact Us
As always, if you have any questions or feedback, feel free to email us at info@tinycircuits.com.
Show us what you make by tagging @TinyCircuits on Instagram, Twitter, or Facebook so we can feature it!
Thanks for making with us!