Category Archives: Electronics Log

Download Audio Transcriptions from YouTube

Here’s a quick guide on how to transcribe audio or video files to text with the help of YouTube.

  1. Go to and upload your video file. If you have an MP3 audio file, you may use a tool like Windows Movie Maker, iMovie on Mac or FFMpeg to convert the audio into a video file before uploading to YouTube.
  2. Wait for YouTube to completely process the video. The machine transcriptions may not immediately become available after uploading the video.
  3. Open the YouTube video page in Chrome and look for the CC button in the player. If it exists, the transcribed audio can be downloaded as text.
  4. Press F12 on Windows, or Option+Cmd+J on Mac, to open the JavaScript console inside Chrome Developer tools and paste this code:

if(yt.config_.TTS_URL.length) window.location.href=yt.config_.TTS_URL+"&kind=asr&fmt=srv1&lang=en"

Apache Virtual host config

change directory to available sites

cd /etc/apache2/sites-available/

copy template config file



DocumentRoot /var/www/

sudo a2ensite

sudo service apache2 restart

show MySQL databases

MySQL login

$ mysql --user=<username> --password=<password>

Show Existing Databases:

mysql> show databases;


mysql> show databases;
| Database           |
| information_schema |
| mysql              |
| performance_schema |
| wordpress          |
4 rows in set (0.00 sec)


Power management circuit: MCP73871 and MCP1703

In power management circuit, we use MCP73871 as battery controller and MCP1703 for voltage regulator, both from Microchip.

The MCP73871 device is a fully integrated linear solution for system load sharing and charging Li-Ion / Li-Polymer battery charge management with external power sources. Power sources can be USB port or AC/DC power adaptor.

Along with its small physical size, the low number of required external components makes the device ideally suited for portable device applications. This is the reason why we choose MCP73871.

The MCP73871 device specifically follows the current drawn limits of 500mA governed by the USB specification. With an AC/DC wall adapter providing power to the system, an external resistor sets the magnitude of 1A maximum charge current while supports up to 1.8A total current for system load and battery charge current.

MCP73871 also features thermal protection circuit using NTC or PTC 10k Ohm thermistor to shutdown charging operation when the temperature is out of safe range. This is to ensure a safe charging environment and prevent the battery from burning or explosion

Photoplethysmography (PPG)

Photoplethysmography or PPG is optical measurement of change in volume of blood in blood vessel which varies according blood pressure. The periodical change of the volume also can be used to determine the heart rate of a person. PPG signal normally has 2 peaks. First true peak is caused by the surge of blood in the vessels when the heart pumped (at p in the picture below). The second peak (at M) follows, caused by the reflected blood pressure pulse when it reached the capillaries.

PPG structure
PPG structure

Obtaining PPG signal use phenomenon where blood absorb, reflect and transmit under different condition. By illuminating the skin with infrared light or red light and then measuring the amount of light reflected, we can obtain PPG Signal. Frequency contents of PPG signal ranges from 0.48Hz to 4.8Hz. In practice, this signal is very small and contains noise. Thus, we need to use filter and amplifiers.


ADXL345 Accelerometer

The ADXL345 is a small, thin, ultra-low power, 3-axis accelerometer with 13-bit resolution measurement at up to ±16 g. Digital output data is formatted as 16-bit twos complement and is accessible through either a SPI (3- or 4-wire) or I2C digital interface. In this project we choose I2C protocol to be an interface for ADXL345 because of simplicity in 2-wire bus design.

In my project, BLE112 will read raw data from ADXL345 continuously. In contrast, in Alert mode, there will be no reading of data but only handling interrupts from ADXL345.

ADXL345 I2C connection
ADXL345 I2C connection


ADXL345 has LGA-14 footprint that has all its pad under the casing, which make it very difficult to hand solder.

LGA-14 footprint
LGA-14 footprint



BLE112 Module

BLE112, Bluetooth low energy single mode module is a single mode device targeted for low power sensors and accessories.

BLE112 offers all Bluetooth low energy features: radio, stack, profiles and application space for customer applications, so no external processor is needed. The module also provides flexible hardware interfaces to connect sensors, simple user interfaces or even displays directly to the module. In lowest power sleep mode it consumes only 400nA and will wake up in few hundred microseconds.

Peripheral connection:

  • GPIO
  • Serial communication protocols: UART/I2C/SPI
  • Timer
  • Analogue comparators/ Op-amp
  • 12-bits Analogue-to-Digital Converter (ADC)

BLE112 can be operated independently with script (BGScript) or working with host with serial port protocol (BGAPI).


BLE112 module
BLE112 module


Comparison between  wireless technologies

technology Operation duration Data rate range No. of device supported
Wi-Fi hours 54 Mbps 100m Prevalent
Zigbee months 150 kbps 10- 100m Very limited
Bluetooth 4.0 days 1 Mbps 50m Becoming more popular