UUGear Witty Pi 4 L3V7 Manuel utilisateur

Copyright © 2022 Dun Cat B.V., All rights reserved.
UUGear is a trade name of Dun Cat B.V.
Witty Pi 4 L3V7:
Realtime Clock and Power Management for Raspberry Pi
User Manual (revision 1.01)

Copyright © 2022 Dun Cat B.V., All rights reserved.
UUGear is a trade name of Dun Cat B.V.
Table of Contents
1. Product Overview...................................................................................................................1
1.1 Built-in Uninterruptible Power Supply (UPS) Functionality .......................................2
1.2 Accurate Realtime Clock and ON/OFF Scheduling ..................................................2
1.3 Temperature Controlled Device .................................................................................3
1.4 e-Latching Power Switch ...........................................................................................4
1.5 Interface Introduction .................................................................................................4
2. Specification / Technical Details ............................................................................................5
3. Package Content ...................................................................................................................5
4. How Does Witty Pi Work?......................................................................................................6
5. Software Installation, Updating and Uninstallation................................................................7
5.1 Install Software ..........................................................................................................7
5.2 Update Software ........................................................................................................8
5.3 Uninstall Software ......................................................................................................8
6. Mounting Witty Pi 4 L3V7 on Raspberry Pi ...........................................................................9
6.1 Mounting Witty Pi 4 L3V7 on Raspberry Pi Zero.......................................................9
6.2 Mounting Witty Pi4 Mini on Other Raspberry Pi Models .........................................10
7. Software Usage ...................................................................................................................12
7.1 Write system time to RTC........................................................................................12
7.2 Write RTC time to system ........................................................................................13
7.3 Synchronize time .....................................................................................................13
7.4 Schedule next shutdown..........................................................................................13
7.5 Schedule next startup ..............................................................................................13
7.6Choose Schedule Script ..........................................................................................13
7.7 Set low voltage threshold.........................................................................................14
7.8 Auto-On when USB 5V is connected ......................................................................14

Copyright © 2022 Dun Cat B.V., All rights reserved.
UUGear is a trade name of Dun Cat B.V.
7.9 Set over temperature action ....................................................................................14
7.10 Set below temperature action..................................................................................14
7.11 View/change other settings......................................................................................14
7.12 Reset Data…............................................................................................................16
7.13 Exit ...........................................................................................................................16
8. Using UWI (UUGear Web Interface) ...................................................................................17
9. About Schedule Script .........................................................................................................18
9.1 How does Schedule Script Work? ...........................................................................18
9.2 Make Your Own Schedule Script .............................................................................20
9.3 Using Schedule Script Generator ............................................................................22
9.4 Advanced Usage of Schedule Script .......................................................................23
10. Know More about the Realtime Clock .............................................................................24
10.1 No Off-Power Time Keeping ....................................................................................24
10.2 Alarms and Alarm Output.........................................................................................24
10.3 Temperature Compensation ....................................................................................24
11. Additional Interfaces ........................................................................................................26
11.1 The 3 Pads for Power Connection (P2 on the back)...............................................26
11.2 The Unpopulated 7-Pin Header on the Top (P3).....................................................26
11.3 The Unpopulated 2 x 3 Pin Headers (P4) ...............................................................28
11.4 The Unpopulated 7-Pin Header in the Middle (P5) .................................................29
12. Integrate with Other Programs ........................................................................................30
13. Witty Pi Log Files .............................................................................................................32
14. Frequently Asked Questions (FAQ) .................................................................................33
14.1 What I2C address is used by Witty Pi 4 L3V7? Can I change it? ...........................33
14.2 What I2C Registers are provided by Witty Pi 4 L3V7? ............................................34
14.3 What GPIO Pins Are Used by Witty Pi4 L3V7?.......................................................41
14.4 Is Witty Pi 4 L3V7 Compatible with “Other Hardware”? ..........................................42

Copyright © 2022 Dun Cat B.V., All rights reserved.
UUGear is a trade name of Dun Cat B.V.
14.5 Witty Pi 4 L3V7 does not boot? ...............................................................................42
14.6 Why Raspberry Pi Immediately Turns On after Shutdown? ...................................45
15. Revision History ...............................................................................................................47

1
1. Product Overview
Witty Pi is an add-on board that adds realtime clock and power management to your Raspberry Pi. It
can define your Raspberry Pi’s ON/OFF sequence, and significantly reduce the energy usage.
Witty Pi 4 L3V7 is the new member of the fourth generation of Witty Pi, and it is designed to work with
3.7V Lithium (ion or polymer) battery (that’s what L3V7 stands for), and can be used as an UPS.
Witty Pi 4 L3V7 has these hardware resources onboard:
•Factory calibrated and temperature compensated realtime clock with ±2ppm accuracy.
•Dedicated temperature sensor with 0.125 °C resolution.
•AVR 8-bit microcontroller (MCU) with 8 KB programmable flash.
•DC/DC step-up (boost) converter that outputs up to 5V/3A.
•Charging manager that can charge battery with up to 1A current.
Witty Pi 4 L3V7 has very similar design with Witty Pi 4, however its DC/DC converter is a step-up
(boost) converter, while Witty Pi 4 comes with a step-down (bulk) converter. Witty Pi 4 L3V7 also
has charging circuit that can charge the battery.

2
1.1 Built-in Uninterruptible Power Supply (UPS) Functionality
Witty Pi 4 L3V7 has integrated the battery charging circuit and DC/DC boost converter on board, and
it can be used as an uninterruptable power supply (UPS). Witty Pi 4 L3V7 can work with all chargeable
Lithium Ion or Lithium Polymer battery that has nominal voltage of 3.7V (and full-charged voltage of
4.2V).
When 5V power supply is connected to the USB-C connector on Witty Pi 4 L3V7, it will take the priority
to power the board with Raspberry Pi together. In the meantime, the battery is disconnected from the
power rails and gets charged.
After 5V power supply is disconnected, the voltage of the battery will be monitored by Witty Pi 4 L3V7.
Once the battery voltage drops under a preset threshold, Witty Pi’s software will perform a graceful
shutdown and then cut the power of Raspberry Pi. By adjusting the low voltage threshold, you can
decide when should the device shutdown before the battery is fully discharged.
1.2 Accurate Realtime Clock and ON/OFF Scheduling
The realtime clock (RTC) on Witty Pi 4 L3V7 has been calibrated in the factory and Witty Pi 4 L3V7’s
firmware also makes temperature compensation for the crystal. This makes the RTC very accurate
and the actual annual error is limited within ±2ppm (about 1 minute per year). When your Raspberry
Pi boots up, the time stored in the RTC will overwrite the system time. As a result, your Raspberry Pi
knows the correct time even without accessing the Internet.
You can schedule the startup and/or shutdown of your Raspberry Pi, and make it a time-controlled
device. You can even define a schedule script to schedule complicated ON/OFF sequence for your
Raspberry Pi.

3
Scheduling the ON/OFF sequence for Raspberry Pi is the most popular feature of Witty Pi, and it is
extremely useful for systems that powered by battery. By only turning on Raspberry Pi when
necessary, the battery can work much longer with Witty Pi installed.
1.3 Temperature Controlled Device
The temperature sensor on Witty Pi 4 L3V7 has 0.125 °C resolution. The temperature data is used
for compensating the crystal and make the RTC more accurate.
You can also specific the action (startup or shutdown) when temperature goes above or below the
preset threshold. Which means you can also turn your Raspberry Pi into a temperature-controlled
device.

4
1.4 e-Latching Power Switch
Witty Pi 4 L3V7 implements an e-Latching power switch, which behaves very similar to the power
switch on your PC/laptop computer. You can gracefully turn on/off your Raspberry Pi with a single tap
on the button. The software running in background will execute the shutdown command before the
power gets cut, and it avoids the data corruption caused by “hard” shutdown.
1.5 Interface Introduction
Witty Pi 4 L3V7 supports all Raspberry Pi models that has the 40-pin GPIO header, including A+, B+,
2B, Zero, Zero W, Zero 2 W, 3B, 3B+, 3A+ and 4B. You will need to solder the 40-pin header to
Zero/Zero W/Zero 2 W model beforehand, so they can make reliable connection with Witty Pi.
The pictures below shows the available interfaces of Witty Pi 4 L3V7.
1. USB type C connector for 5V power input (5V)
2. Unpopulated 7-pin header for extension or integration
3. Red LED as power indicator
4. On/off switch
5. White LED as status indicator
6. 2x20 pin stacking header for connecting to Raspberry Pi
7. Blue LED as battery charging indicator
8. PH2.0 - 2 pin battery connector
9. Green LED as battery fully charged indicator
10. Unpopulated 7-pin header for internal I2C bus and extra signals
11. ICSP header for uploading firmware (on the back)
12. Big pads for BAT (battery V+), GND and 5V (on the back)

5
2. Specification / Technical Details
Dimension
65mm x 30mm x 7mm
Weight
10g (net weight without accessories)
Microcontroller
ATtiny841 (datasheet)
Realtime Clock
PCF85063A (datasheet), calibrated in factory.
Temperature Sensor
LM75B (datasheet)
DC/DC Converter
MP3423 (datasheet)
Charging Manager
TP4056 (datasheet)
Power In
DC 5V (via USB-C connector) or 3.7V Lithium ion/polymer battery
Output Current
Up to 3A for Raspberry Pi and its peripherals
Standby Current
~0.3mA on 3.7V battery, ~1mA on USB-C 5V
Operating
Environment
Temperature -30°C~80°C (-22°F~176°F)
Humidity 0~80%RH, no condensing, no corrosive gas
3. Package Content
Each package of Witty Pi 4 L3V7 contains:
⚫Witty Pi 4 L3V7 board x 1
⚫M2.5 x 10mm plastic screws x 4
⚫4mm plastic spacer x 4
⚫M2.5 plastic nut x 4
⚫8cm PH2.0 cable x 1

6
4. How Does Witty Pi Work?
The diagram below shows the basic workflow of how Witty Pi turns on/off your Raspberry Pi.
After you tap the button on Witty Pi, it powers your Raspberry Pi via the GPIO header, and your
Raspberry Pi will boot. Witty Pi’s software will run automatically after boot, which will send the
SYS_UP signal (via GPIO-17) to Witty Pi. Witty Pi’s firmware receives the SYS_UP signal and starts
to listen to Raspberry Pi’s TXD pin (GPIO-14). If you shut down your Raspberry Pi (running
shutdown command or choose “Shutdown” in GUI), the TXD pin will go LOW and Witty Pi will cut
the power after some delay. If you tap the button again, that equals to shorting GPIO-4 to GND, and
Witty Pi’s software will run shutdown command for you.
Witty Pi has realtime clock (RTC) onboard and it always knows the time. You can schedule the
shutdown and startup of your Raspberry Pi, which are implemented with two alarms. When the
alarm is triggered, Witty Pi’s firmware will emulate a “button clicking”, which will turn on/off your
Raspberry Pi accordingly. You can either configure single alarm for shutdown and/or startup, or you
can define a simple script to plan a rather complex on/off sequence for your Raspberry Pi.
Witty Pi has Analogue to Digital Converter (ADC) in its microcontroller (MCU), which can measure
the input voltage (VIN).
Witty Pi 4 L3V7’s design is a little different from Witty Pi 4 and Witty Pi 4 Mini, that the battery
voltage and 5V from USB-C merge into the input voltage (VIN). Please see the equivalent model
below:
Because VUSB-C is 5V and is always higher than VBattery (up to 4.2V), the power input from USB-C
connector has higher priority. As long as the power supply is connected to USB-C, the battery will
Ce manuel convient aux modèles suivants
1
Table des matières
Autres manuels UUGear Matériel informatique
Manuels Matériel informatique populaires d'autres marques

EMC2
EMC2 VNX Series Manuel du propriétaire

Panasonic
Panasonic DV0PM20105 Manuel utilisateur

Mitsubishi Electric
Mitsubishi Electric Q81BD-J61BT11 Manuel utilisateur

Gigabyte
Gigabyte B660M DS3H AX DDR4 Manuel utilisateur

Raidon
Raidon iT2300 Manuel utilisateur

National Instruments
National Instruments PXI-8186 Manuel utilisateur













