Wednesday, January 18, 2012

Electronics Stores

Here are my favorite electronics stores:

Portuguese:

Aquario (Porto) - Nice collection of generic electric components, ICs and tools, but not for hobbyist electronics, like sensors, motors or other robotics components;

InMotion (On-line) - Nice catalog with products from SparkFun and Pololu, etc. Usually they offer the shipping costs at Christmas. It is possible to order SparkFun items by mail that aren't on their catalog.

PTRobotics (On-line) - Like InMotion, they have a very good catalog of products.

Found a link on a forum with their own list: LusoRobotica

Worldwide:

Sparkfun (US) - Best generic store, but the shipping costs can be very high for a direct order. The most common items can be found in distributors around the world.

Adafruit (US) - Main competitor for SparkFun. Can't tell wich is best.

Pololu (US) - Best store for motors and related products, shipping costs have the same problem as SparkFun;

eBay stores (mostly China) - Sometimes we can find great deals with free shipping from high trust rated sellers.

Friday, January 13, 2012

Electronics Components

Here I'll be updating some links about electronics components, as a wiki with the best information I can find.

- Zener Diodes

Thursday, November 24, 2011

Taking a peek at Android source code (decompiling)

Are you curious about some Android apps behavior?
Do you want to learn how some things are done on Android?

Android apps are written in Java, so it's easy to assume that a .apk file is the same as a .jar file. And if you know a bit of the Java world, you know that a .jar file is nothing more than a renamed .zip file containing compile binaries (.java files).
In the case of .apk files you can find a single classes.dex file (if the app is optimized, you'll find an .odex file) for code and resources and manifest related files. These files are generally not directly accessible. For reading them you'll need some tools.

For some info about the difference between .dex and .odex files you can go here. I won't talk about odexing apps in this article.

Remember that when decompiling an app you won't get the exact original source code, but an approximate that may not even compile back.

Here are the tools for you to open an .apk file:
- dex2jar;
- JD-GUI (Java Decompiler);
- apktool;

You can obtain two different results depending on the tools you use. With dex2jar you can convert a classes.dex file to a regular .jar which can be decompiled by Java Decompiler.
With apktool you can obtain the AndroidManifest.xml, all resource files and the code in a kind of assembler language.

Both of the tools are easy to use:
dex2jar (windows) --> dex2jar.bat classes.dex
apktool (windows) --> apktool.bat d .apk

Now to the hard part. Go play!

Thursday, November 17, 2011

First Hack - The LED Strip

Finally finished my first hack.

I needed a light for my kitchen counter, so I ordered a LED Strip from eBay and hacked an AC adapter to include an ON / OFF button and to connect it to mains without using a power socket.

So here's the theoretical work:

To cover the surface of my counter I used 48 segments of the LED strip (about 2 meters). Each segment has 3 white SMD leds (type 3528) and a 150 Ohm resistor. For it to work it needs a 12V power source with sufficient current output.
After learning from [ladyada] about these strips I figured that the theoretical current each segment needs to function at it's maximum is 16 mA. That is:
12V total - (3 leds * 3.2V) / 150R = 0.016A

For the total 48 segments that's 768 mA, resulting in under 10W lighting!!!
For that I bought a SMPS AC adapter in order to guarantee the regulated 12V while using that much current. An average (unregulated) AC adapter wouldn't provide nor the 12V neither near the maximum 1A stated. [ladyada] also shed me some lights on that matter.

White LED StripSuitable AC AdapterThe best switch button I could find

For the practical work:

As you will see for yourself, the tools weren't exactly the best suited for the job: a kitchen knife to cut, a soldering iron to remove plastic, a hammer and a nail to open holes...

The innards of a power outletMains power derivationAdhesive cable duct

In order to cut the space for the switch button in the AC adapter, my kitchen knife wasn't enough, so I used my soldering iron to heat a metal needle and a kind of a thick clip used by stores to keep shirts folded in it's package. Even so it was a hard work.

Pierced top cover from the AC AdapterCreating the space for the switch buttonThe working conditions

Then I just needed to solder the switch button and the wire to the board and cover it all with electrical tape.

The final cutConnecting the switch buttonThat's a wrap

And there we have it!
Our working LED Strip!


Tuesday, September 6, 2011

Project: NiteLite

Problem: I would like to be able to go to my kitchen at night without having to turn on the fluorescent ceiling lamp for a short stay.

Solution:
I will try to build a night light with a motion sensor to light some leds and a luminosity sensor to turn the device on only in the dark.

For me to understand better about circuitry I will avoid using micro-controllers as well.

More details in a few days...

Thursday, August 18, 2011

Root for HTC Desire

It's been a while since I rooted my HTC Desire and I should have written about it at the time.

HTC smartphones have a security check so that the ROM can't be written called S-ON.
To have a full root, you need to S-OFF, but for most cases that won't be necessary.

It is possible to have regular root and to use custom ROMs when S-ON, using a custom recovery image. The recovery is a command line shell used to control the ROM.

For HTC Desire and some other HTC smartphones, you can use the simple method of unrevoked:
- unrevoked Home Page
- unrevoked Wiki

Just need to install the drivers for your smartphone, and run the unrevoked tool (don't forget to backup EVERYTHING, because you never know what can go wrong). It will restart your phone and install a ClockworkMod recovery image and root your phone.

After this process you can install any custom ROM and use apps that require root.

I recommend as a first install Titanium Backup for an easy tool to manage your backups of apps and data.

Titanium Backup QR Code:

Monday, July 25, 2011

PIR Motion Sensor

Finally got some time (and patience) to try out one of the first electronic components I bought. The SparkFun PIR Motion Sensor.

It's use on Arduino is quite simple. When a motion is detected the black (the GND wire is brown on this sensor!) wire carries a LOW state.

I tested it based on what I found on this site .

Providing 5V from the Arduino to the PIR might make it unstable, as the board has a 5V regulator in it. So it is better to connect it to a 12V power source. The signal will come out with a 5V limit, so you don't need to worry about ruining your Arduino.


Anyhow, you'll see it being used in a personal project very soon (I hope)!