esalazar's blog

Laser Modem with an Arduino Microcontroller

Submitted by esalazar on Mon, 08/11/2008 - 7:03pm.
Serial data transition from a Arduino controller using a standard red laser, photo transistor and an instrumentation amplifier.

This started when I ordered an IR led and phototransistor pair from Spark Fun along with some spare ATMega168 microcontrollers. I first experimented using the IR led to transmit 2400 baud serial to the phototransistor. I programmed my Arduino Diecimila with the sample serial program altering the baud rate and allowing it to run in a continuous loop.

Fractal Mountain Generation with Qt and OpenGL

Submitted by esalazar on Mon, 02/04/2008 - 9:29pm.
The purpose of this project is to create 3d mountain terrain using a recursive midpoint displacement formula. For this project I decided a GUI would be useful, that way manipulations could be seen in real time. This would require a 3d rendering package. My choices were DirectX, OpenGL and Java3d. Since I prefer to do my development in Linux, DirectX was ruled out. I have not been very impressed with the performance of Java3d so that left me with OpenGL. After deciding on my rendering package I needed to choose a language and a GUI framework. GLUI is an excellent framework for leaning OpenGL, but lacks control over the layout of the interface. So I decided on QT by Trolltech which was just recently acquired by Nokia.

Midpoint Displacement Formula

Encoding an image to sound

Submitted by esalazar on Mon, 01/07/2008 - 8:36pm.
The purpose of this project is to encode an image to a sound that can be viewed with a spectrogram. For some time I have known that musical artists have encoded pictures into their music. Most notable of these is artists is Aphex Twin. Luckily I had a copy of Windolicker and a great visualization program Sonic Visualiser. After looking at the images I decided it would be cool to try and encode my own images. I saw a few programs available, but decided it would be a better challenge to write my own program from scratch using Perl.

Spectrograms

ImageEncode Source Code

Submitted by esalazar on Mon, 01/07/2008 - 8:34pm.
::
#!/usr/bin/perl
#Author: Evan Salazar
#------------------------------------------
#
#Convert bitmap image into audo file that
#can be seen in a spectrogram
#
#------------------------------------------
use SimpleWave;
use POSIX;
use Math::Trig;
use Image::BMP;
use Getopt::Std;
use strict;


################
#Constants used
################

Class Serialization in Perl

Submitted by esalazar on Thu, 12/27/2007 - 6:15pm.
Serialization in Perl is the process of saving a class with multiple data types to a scalar (string of bytes). This can be used to save objects to a file or to transmit objects across the Internet. For this article I am going to describe the basics of creating a class in Perl and serialize it using the following packages: Data::Dumper, FreezeThaw, PHP::Serialization, and XML::Dumper.

Data types in Perl
Before we serialize anything we first need to learn a bit about the data types in Perl. There are only three data types in Perl, these are scalars, arrays and hash tables. Below is an example of each.
$myScalar = 'This is a Scalar';

Data encryption in Linux using Truecrypt

Submitted by esalazar on Sat, 12/15/2007 - 7:58pm.

Personal data security is often overlooked by many computer users today. As people use their computers more, they never stop to think about how much personal data is accessible on their hard drive. I have been looking for a safe and convenient way to deploy cryptology in Linux. So far Truecrypt has been the best choice. It is very convenient and cross platform. This story will show how to use it on Ubuntu Linux along with some basic data safety principals.

A quick word about data in Linux
One of the first things that fascinated me about Linux is devices are treated as files. For example if you have an IDE hard drive, it is located at /dev/hda or a SCSI hard drive is located at /dev/sda. This is true about all devices in Linux including serial ports /dev/ttyS0 and sound cards /dev/dsp.

You could output the data from these devices as they where any other file, for example you could redirect the data from your hard drive to the standard output using

AC Motor / Generator Project

Submitted by esalazar on Sun, 12/02/2007 - 4:48pm.

This project started one night while I was lying in bed trying to visualize how an AC motor worked. I knew that it was different from a DC motor as in it did not require brushes and the speed was controlled by frequency instead of voltage. After some research I came up with this project to better my understanding of AC motors.

AC Theory: