Infrared protocol analysis with PC soundcard

 Posted by:   Posted on:    No comments
Infrared communication is widespread among electronic devices that use remote controls. Because of this, there are more protocols in use and the data (bytes) sent to the device depend on manufacturer. This post will show you how to view the waveform of an infrared signal emitted by a remote control, how to analyze and decode it. Then it will be possible to reproduce it. In this way you can program your universal remote control or your mobile device (smartphone with IR transmitter) with the right code for the best results.

Instead of using an oscilloscope for signal analysis, due to the low frequency of the IR bit stream, an ordinary sound card will be used to view the signal. The signal is amplified, filtered and demodulated by the IR receiver, so only the bit stream is sent to the sound card input. This is sampled at the usual audio rate and displayed in various software tools.

High quality scanning vs. small file size

 Posted by:   Posted on:    No comments
This post will not talk about scanning only, but about the whole process of turning a sheet of paper, a magazine or a book into a high quality digital document of the smallest possible size. Nothing will be lost during the conversion as lossless compression will be used and OCR will be run on documents. A low quality scan is hard to read (impossible to run OCR). A high quality scan must preserve as much detail as possible, must have the correct page size (when printed at 100%, the resulting copy should be exactly the same size as the original), must load as quick as possible on low-end devices and shouldn't eat the whole drive space. Software processing of the raw image from scanner plays a very important role. Yet, if the image from scanner has a low resolution, further processing is useless and may have negative results. All software used in this tutorial is free (some apps are open-source). But let's start with the basics.

High quality scanning vs. small file size

Draw electronic schematics using LibreOffice

 Posted by:   Posted on:    7 comments
Draw is a powerful vector graphics drawing software. It is part of the free office suites LibreOffice and Apache OpenOffice.

There are a lot of free EDA software solutions but none of them allows users to 'customize' the schematics as they want (for example part colors - outline, background, including high resolution images in the schematic etc.). This tutorial will cover some aspects of drawing schematics in Draw. Similarly, schematics can be drawn in any other graphics software (for example Inkscape, even GIMP and Scribus).

Make a bootable Windows USB from Linux

 Posted by:   Posted on:    77 comments

Ubuntu has already an application called Startup Disk Creator, but this can only be used to make Linux bootable USB drives. To make a Windows bootable USB there was an application called WinUSB but it is no longer under active development. The following guide has been updated and works on any Linux distribution as long as it has GRUB and GParted installed and can make bootable USB for any Windows version newer than Vista: Windows Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10. UEFI boot is only supported for Windows 7 x64 and newer.

Before starting, let's mention that there are two types of boot methods. There is the MBR code type where the bootable executable is stored in a reserved section at the beginning of the storage device. And there is the EFI type, where the boot loader executable file is stored at a standard path in an FAT32 filesystem. You must decide in advance what you will use. There are some variables for each boot type. If you have no idea what to use, the most common setup that works with unmodified Windows sources, is msdos partition table with fat32 filesystem and flag the partition with boot. In this way you will get both an MBR and UEFI bootable drive.

The latest Windows release can be downloaded from Microsoft as an ISO image. The ISO download page is available to non-Windows users. Otherwise, you are directed to download Media Creation Tool, which is Windows only software.

Make a bootable Windows USB from Linux (Ubuntu)

Change DPI in Ubuntu

 Posted by:   Posted on:    No comments
By default Ubuntu assumes you use a 96 DPI monitor. But nowadays pixel density keeps increasing as monitors with high resolution became accessible. There is no straightforward option in Ubuntu with Unity to change the default DPI which is considered to be 96 DPI (run in  a terminal xrdb -query). But there are two parameters which control the user interface DPI (this affects font rendering too) and font rendering only.

The parameter that controls user interface and fonts DPI is scaling-factor and the font rendering parameter is text-scaling factor. These parameters can be modified by the Displays application, by GNOME Tweak Tool and by Unity Tweak Tool, but none of these allows you to set a value with 3-4 decimals.

Computer PSU start circuit with bicolor LED

 Posted by:   Posted on:    No comments
There are a lot of tutorials on the internet on how to turn a computer PSU into a bench top power supply. Most of them involve adding a load on the 5V line and turning the PSU on by grounding the PS_ON wire via a switch. Here is a nice indicator and turn on/off switch for computer PSUs.

ATX PSUs work well under rather constant loads. So if you power up the PSU with a small load of a few tens miliamps and then connect a greater load, for example a car light bulb which may require 3-4 A, the PSU may shut down. The same happens in case of an accidental shortcircuit. You may believe that the PSU got broken or its fuse got blown. That's not true. The PSU automatically shut itself off.
Computer PSU start circuit with bicolor LED

Regular backups using Grive2 on Ubuntu

 Posted by:   Posted on:    No comments
Grive is a Google Drive client for Linux that can do two-side synchronization between Google Drive and a local folder. The synchronization is done whenever the user launches the application, either from a launcher or from command line (it is a CLI application).

By adding grive to crontab, periodic backups of important folders can be made. And no user interaction is required because the process is automated. Here is how to do it in Ubuntu. There is no system load when the process is not running, but this comes with a disadvantage: no filesystem monitoring. Any updates are made during the automatic execution of Grive.
Regular backups using Grive2 on Ubuntu

MxL5007T tuner radio

 Posted by:   Posted on:    3 comments

MxL5007T is a tuner IC designed mostly for digital signals (DVB-T, ATSC), but it can be used for analog reception too. I will show you how I took it out from a receiver so I can use it in my projects. It has a programmable IF output and it can receive anything from 44 to 885 MHz. There is no datasheet for it, but there are Linux drivers.

Looking at the PCB of a SCART DVB-T MPEG2 receiver I found no components I could use. But, a closer look at the tuner which was basically an area of the PCB enclosed in metallic box revealed only a few tracks coming out of the tuner area. Since it's rather easy to interface a tuner to a simple demodulator and build a high quality receiver, I decided to try to cut the original receiver PCB around the tuner and see if I could control and use it in my projects.

Design of a TV Tuner based radio scanner

 Posted by:   Posted on:    2 comments
Building radio frequency devices becomes difficult starting from VHF band. Moreover, tuning various stages is difficult without expensive electronics equipment. But a ready made unit can be used as the frontend of any radio receiver operating in the VHF – UHF band. That unit is the tuner coming from a TV, from a STB or from a PC card. It has the advantage of covering a wide spectrum of frequencies at a reasonable reception quality well above homemade radio receivers.
In order to build a TV tuner radio scanner you need, of course, a tuner. Also you must be able to build some detectors (demodulators) for the common analog modulation schemes. Some frequency mixers need to be built too. Although designed for analog modulation, the scanner is able to demodulate digital signals using the PC sound card as input. The whole constructional project is not difficult because it is modular and you don’t have to build all modules to get it working with a specific RF signal. Let’s take a simple example: if you are interested in receiving broadcast FM radio stations, you only need a simple FM detector that can take as input the tuner’s intermediary frequency. Of course, if you want to improve it you can add a stereo and RDS decoder. On the other hand, if you are interested in digital aviation signals, you’ll need a detector with a tunable local oscillator to overcome tuner large frequency step and a tunable IF filter. To maintain the modular design of the project, you could make this from two modules: a frequency downconverter with the tunable oscillator and filter followed by a fixed frequency detector. In the end, the main point of building this is obtaining the same results as with Realtek SDR devices and SDR#. The functional schematic of the scanner is shown in the figure below.

Radio scanner functional blocks
Functional schematic of the scanner. Don't worry, you don't have to build everything from scratch.

Render 3D realistic images of EAGLE circuit boards

 Posted by:   Posted on:    1 comment

Have you ever wanted to see how some of your electronic projects would look before you actually get to build them? This post will show you how to create really good-looking 3D renderings of your PCB designs that you can use in presentations, websites or only to get an idea of how it will look. The process is the following: your PCB design created with Cadsoft (now Autodesk) EAGLE is converted to a POV-Ray source file with a script. POV-Ray uses ray tracing, a rendering technique for generating an image by tracing the path of light as pixels in an image plane and simulating the effects of its encounters with virtual objects.

This is an old post that I decided to update in 2020. Unfortunately, this method was never too popular and required software is now out of date and hard to find. Most of the links are dead by now. Meanwhile, the most important software, Cadsoft EAGLE was bought by Autodesk and included in Fusion 360. Fortunately, I was able to find an official download link for EAGLE 7.4.0, released in 2015. Everything will be done in a Windows 7 virtual machine.

Arduino Mega rendered with POV-Ray

Arduino Mega rendered with POV-Ray

Compile and setup PonyProg on Ubuntu

 Posted by:   Posted on:    No comments

PonyProg is a device programming software for the SI Prog serial interface programmer designed by Claudio Lanconelli. The latest version of the PonyProg software can be found on SourceForge, but there are no Ubuntu packages.

Here is how to compile it on Ubuntu. This post was updated for Ubuntu 16.10. First you'll have to install some development libraries:

sudo apt install build-essential libxt-dev libxmu-dev libxaw7-dev

Then download the archive from SourceForge and extract it to some folder you want (at the time of writing this, the latest version is 2.08d).