[Update 10/7] Added OneDrive Backup and RaspberryPi shutdown page
This project logs baby’s bodily functions and displays them on a webpage. Many pediatricians recommend tracking your baby’s feeding patterns, wet and dirty diapers to help know if he/she are eating enough – at least for the first few weeks. This is valuable information if there is a problem early on. The doctor can use this information to help with a diagnosis.
For the tech/geek parents, Baby Logger is Raspberry Pi based on Python and PHP using 3 switches.
Here is some photo of the result, 100% Reduce – Reuse – Recycle approach: 😊
Here is the video of testing version, with 5sec delay in the script between switch activation and LED turning on:
LED Switch configuration has 3 pin used as reported below:
Stable at GND
VCC (+) Float
Closed = LED ON = VCC Open = LED OFF = Float
Stable at VCC
pinout switch configuration
Base hardware and engine is based on Raspberry PI Zero W pre-assembled and Electronics Fun kit or anything else to simplify cables and connectors between switch, LED and Pi with correct 10kΩ pull down resistor.
Finally, RGB LED part of fun kit to report the status of the 3 switch back to user. Remember to add 220 Ohm resistor on the V+ wire:
Raspberry Pi Zero W – GPIO configuration
List of GPIO pins used for the project. There 2 main groups:
Group #1 to control RGB Led
Group #2 to read status of switches for pee, fed and poo
sudo apt install mariadb-server
#Answer Y to all questions for best security
Once MariaDB is installed, login, create user and configure DB and Table
#Login to MariaDB as root
sudo mysql -u root -p
CREATE DATABASE babylogger;
CREATE USER 'logger'@'localhost' IDENTIFIED BY 'YourPassword!';
GRANT ALL PRIVILEGES ON babylogger.* TO 'logger'@'localhost';
CREATE TABLE buttondata
id INT PRIMARY KEY auto_increment,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
After initial DB setup, you can login to DB using this:
mysql -u logger -p -D babylogger
#Show existing table
#Show existing records
SELECT * FROM buttondata;
Extract the token above UDR IP in the ‘Raw Text’ field
Adoption token looks like this: cpZaMhfzmBgAqLIHPR0psvoMp3mvCDtu
3. Confirm RTSP support for your cameras using VideoLan Client VLC -> Network Stream. For Amcrest cameras, the default local credential is admin / admin and RTSP standard URL has this format rtsp://[username]:password@CAM_IP:554/cam/realmonitor?channel=1&subtype=0
Make sure you have all pre requirements completed before you move fwd with the docker configuration file:
Adoption Token cpZaMhfzmBgAqLIHPR0psvoMp3mvCDtu
RTSP URL for your camera rtsp://[username]:password@CAM_IP:554/cam/realmonitor?channel=1&subtype=0
Docker is working properly and you have permission to run container
Create Docker Compose YAML file in /home/pi/Documents/docker-cameras.yaml using VI docker-cameras.yaml
To continue to have internet during power outages, which are become more frequent and longer, best way is to have ONT and home router under UPS.
Home Router – Backup plan
For standard home router using 12V power supply, the easier solution is to use an online, always-on UPS based on 12V Li-Ion battery pack which will continue to provide power to it for ~9h, considering 0.5A usage (9.62h =57.72 Wh / 12v / 0.5A).
The LG 32LM6370PLA TV is a model with LED technology, a screen diagonal of 81.3 cm, a screen resolution of 1920 x 1080 pixels, 3 HDMI ports to connect a Bluray player, DVD, a game console, etc., 2 USB ports to connect an external hard drive, a Chromecast, a Bluetooth receiver etc., Ethernet port to connect to the internet via cable, internet connection via Wi-Fi, and finally with the Web OS operating system .
LG 32LM6370PLA Tech Spec
Ultra slim TV
1920 x 1080
Video formats supported
No. of speakers
Total speaker output
Miracast screen mirroring support
Adaptive Sound Control (ASC):
Apple AirPlay 2 support:
Apple HomeKit support:
Audio (L/R) out:
Audio Return Channel (ARC):
Bluetooth Low Energy (BLE):
Tivùon! / Tivùsat, Lativù, HbbTV v 2.0.1, CAMREADY
Common interface Plus (CI+):
Compatible with universal remote control:
Component video (YPbPr/YCbCr) in:
Composite video in:
Depth (with stand):
Depth (without stand):
Digital audio optical out:
Digital Living Network Alliance (DLNA) certified:
Digital signal format system:
81.3 cm (32″)
Display diagonal (metric):
1920 x 1080 pixels
Ethernet LAN (RJ-45) ports:
HDMI ports quantity:
Height (with stand):
Height (without stand):
High Dynamic Range (HDR) supported:
High Dynamic Range (HDR) technology:
High Dynamic Range 10 (HDR10),Hybrid Log-Gamma (HLG)
Start from factory default: Admin > Factory Defaults > Yes > Save
Note: if La Fonera lose connectivity or IP, connect via 169.254.255.1
Main changes to perform:
Setup > Basic Settings
Internet Connection Type: Automatic Configuration – DHCP.
Local IP: 192.168.Z.Y, where Z is any number between 1 and 255 that IS NOT the same as X in the host router settings. I used 192.168.3.1 for my tests.
Subnet: 255.255.255.0, or whatever is identical to the same setting in the host router.
Gateway & Local DNS: Leave these blank or the same as your host router’s Local IP.
Wireless > Basic Settings
Before altering the following, change Wireless Channel to an identical setting to the host router’s Wireless Channel. In my tests I used 11 (2.426 GHz). Hit save settings and continue with the guide. This setting will be unavailable after changing to Client mode.
Wireless Mode: Client.
Wireless Network Mode: Mixed. A setting identical to the host router is all that has been tested. Either using mixed on the La Fonera, or a separate setting that is identical to the same Wireless Network Mode used on the host router, will probably work.
“G-Only” on host OR both host & fon will not work – freonchill
Wireless Network Name (SSID): Identical to the same SSID in the host router.
Wireless > Wireless Security
Change the Security Mode for the Physical Interface to the same settings used on the host router.
At this point, if all settings are correct and the Fonera has connected as a client to the host router, the Fonera should now have gained an IP address from the host router.