Saturday, October 16, 2010

LED Matrix 101

As a dummy in electronics I still find somewhat difficult to understand most electrical schematics and what parts to use on my projects.

My first attempt to do something more elaborate than to burn LEDs directly on a battery was to understand how does a LED matrix work.

I've read about 'multiplexing' and 'persistence of vision' but how does it work and how can i build it?



Looking at the schematics it would seem that all the wires are connected, but you should connect all the positive ends (anodes) to form lines and the negative ends (cathodes) to form columns separately.
As it is something hard to breadboard, it's best to really solder it all (if you want to breadboard it anyway take a look at this).

My doubts were what resistances to use and how to calculate them for such a complex schematic. Well, after some thought, I realized it's not complicated.

What we do to light up a LED matrix is to light each LED individually at a time. We only do it so fast that our eyes won't notice.

So, we only need to take that single LED into account when doing the math. There's no serial this or parallel that to complicate as it would appear initially to the untrained eye. At any given point in time we are dealing with such a simple circuit as this:



I know that my blue LEDs consume about 4.5V on a 30mA current (as stated in here), so, to a 9V battery i should use a 150 Ohm resistance [V=R.I ==> R=(9-4.5)/0.03=150].
The closest value resistances I have are 220 Ohm, so I'll use those.

I didn't have a perforated board on me and couldn't buy one in time so i turned to a Pringles pack lid for a 'solid' base.

With a matrix designed in a piece of paper where to perforate and fit the LEDs, we get an interesting place to solder our LEDs.


This is the end result:



So what now? The next step shall be to connect it to the Arduino and make some letters appear on my home made LED matrix.

Monday, September 20, 2010

Android Virtual Keyboard on the Emulator

It happened to me that the emulator's keyboard started as something like Japanese or Chinese.



To change the Android keyboard you'll have to long press the lower left key of the virtual keyboard until you see a menu.



Select 'Input Method' and then 'Android Keyboard'.



And now you're ready to go!

Tuesday, September 14, 2010

Why oh why does a LED need a Resistor?

For the people that don't know why should a resistor be connected in series with your LEDs, here is the best explanation i've seen so far (dummy proof, as I understood it :P ).

Driving An Led With Or Without A Resistor/

Wednesday, September 8, 2010

Cellphone Network problems

Today I got scared while going to work in seeing that i had no network on the phone.
My girlfriend's phone had no problems (she has the same network) and after reboot (engineer solution) it remained the same.

So when testing for solutions is that I got me worried. I tried Automatic network search, and after 2 minutes of processing, the phone began a restart loop...

So I tried to change SIM card with my girlfriend. In her phone, all fine.
In mine all the same...

But I found that without a SIM card, my phone had no problems...

I went home to back up my contacts and because i left there my USB cable. Upon arrival, I noticed that my phone already had network and everything worked fine. :0

Upon returning to work, I lost network again. So that was the problem, since my girlfriend's phone always worked?

Well, here's the secret:
I only needed to change the Network Mode of 'GSM / WCDMA Automatic' to 'GSM only'.

I assume that my carrier has a problem with the 3G in the area of my job from now on, as at home it works well on 3G and GSM works fine at my job.

I hope to help someone with this ...

Wednesday, August 25, 2010

Magento On The Move

I like to keep my personal development environments on a USB drive, because i spend a lot of time on computers other than my own (mostly because of business trips).

So I felt the need to try to create a Magento portable environment.

This is as simple as using EasyPHP. It contains Apache, PHP, MySQL and phpMyAdmin.
It is by itself portable, so all you need to do is copy the root folder to your USB drive. When run, it detects that it was launched in a different directory and updates all configuration.

If you want to develop as well as having a running copy, all you need to do is to download Eclipse for PHP. It can be run on the USB drive as well.

Tuesday, August 24, 2010

On The Move

I like to keep my personal development environments on a USB drive, because i spend a lot of time on computers other than my own (mostly because of business trips).

Also you never know when you'll need some tools on a computer with no internet connection, or where you can't install software.

So I use Portable Apps ().

To be even more portable, I download only the applications and extract the the USB drive, so no PortableApps executable necessary.

But I also carry installations to some of the applications I consider essential in case I need to share them (as with family asking to the IT guy to fix something).

Here are some of my toolkit apps:

[Install]
- ARDC Data Recovery Tools (Data Recovery Tools);
- AVG (Anti-virus);
- Combined Community Codec Pack (Codec Pack);
- daemon408-x86 (ISO reader, but can't install on Win7 :( );

[Portable]
- KeePass (Password Database) ;
- GIMP (Image Editor);
- Notepad++ (Text Editor);
- PeaZip (Archive Manager);
- SumatraPDF (PDF Viewer);
- VLC Video (Video Player);

[Runs without Installation]
- ExamDiff;
- Reflector (.NET);

Android On The Move

I like to keep my personal development environments on a USB drive, because i spend a lot of time on computers other than my own (mostly because of business trips).

So I felt the need to create an Android portable environment.
You can't build this environment on-the-fly, that is, without an initial installation. Most software will be 'stolen' from their original locations.

Sadly, i still only work on Windows (to lazy to spend more time on Linux), so i probably won't be able to help if you need to do the same on Linux (but probably it's not that different from what I did).

So here are the steps I managed so far:

1 - JDK
I'm using jdk1.6.0_20 (the latest at the time). I've downloaded and copied the jdk1.6.0_20 folder to my USB drive. A copy will be enough, after a little configuration.

2 - Eclipse
I'm using 3.5 (Galileo). Also just needed a simply copy of the root folder to the USB drive.

3 - Android SDK
I'm using revisions 6 (for Eclair) and 7 (for Froyo). You should download all the targets necessary before copying the folders. Then, you'll need to copy the root folder (android-sdk-windows) to your USB drive.

4 - AVD (Emulators)
To debug we need an emulator that will run our app. Unfortunately, it needs to be created beforehand on a fixed environment. So, all we have do is to copy the *.avd folder to our .android/avd folder.
AVD uses .ini files to configure target platform and installation path. As this has to be a full path and can't have shell variables, I chose to reconfigure that path in the batch file used to start-up eclipse.

5 - Batch file
To boot the environment we need to indicate to eclipse where to find the virtual machine and the sdk tools. So I start my environment with this script:


REM Updates AVD path config
type "%CD%\.android\avd\[sample].ini" | find /v "path=" > "%CD%\.android\avd\[sample].tmp"
copy /y "%CD%\.android\avd\[sample].tmp" "%CD%\.android\avd\[sample].ini"
echo path=%CD%\.android\avd\[sample].avd>>"%CD%\.android\avd\[sample].ini"
del "%CD%\.android\avd\[sample].tmp"

REM Defines Android home directory (defaults to the users' home directory)
SET ANDROID_SDK_HOME=%CD%

REM Defines path to swt.jar (not sure if necessary)
SET ANDROID_SWT=%CD%\android-sdk-windows\tools\lib\x86

REM -data "." defines the workspace path to load
REM -vm defines the path to the virtual machine
.\eclipseJava\eclipse.exe -data "." -vm".\jdk1.6.0_20\bin\javaw"


This should be enough to allow you to take your Android developments everywere.