Tuesday, December 15, 2015

Quickie #5: Inside of the Fenix LD12 tail switch

The Fenix LD12 is quite powerful (125Lm) and small size (powered a single AA cell); the flashlight is quite tough with it aluminum body but it has two weaknesses : the rubber capped buttons.
Although i found a way to protect the side switch, i still didn't found any good way to protect the tail one.

But... Before trying to protect it, what's inside?

Let's open it
From Left to right :
  • A Circlip, that holds firmly the switch into place AND make contact to close the circuit between the switch and the flashlight body.
  • The switch (with click and momentary ON features.
  • A washer that press on the rubber cap to keep everything sealed and waterproof
  • The rubber cap
  • The tail body
  • The whole Tail switch

The switch
A closer look

Here we have a simple two sided and circular PCB, with a mechanical switch on one side, and a spring on the other one.
To pass through the PCB, a simple tin droplet in a hole makes contact between both sides :

The spring is held by three tin droplets that pass trough the PCB to connect the switch races.
The switch features both ON/OFF by full click and momentary ON by pressing gently on it.

Fenix went far in making the rubber cap: they even added their brand logo:

Note that this rubber cap is dead already:
I would have liked a lot if Fenix had supplied spare rubber caps with the flashlight...

What's next?
Planning to make a remote switch
As i have two tail bodies, (and everything twice, only the rubber cap has no working twin here), i am planning to make a remote pressure switch based on what Fenix made for their bigger products :

Wednesday, October 14, 2015

Quickie#4 CM12.1 vs Exodus ROM: CPU/GPU

After Pure SQLite databases transactions performances, it is time to have a look at CPU/GPU pure performances (meaning benchmarking, not real-life ...)


both ROMs were tested on RgbenchMM (4 threads):

On this Benchmark, CM12.1 is slightly ahead in performances (this has no real-life impact though)


For 2D graphics, i use fps2D, and old app that is quite great for the purpose (an keeping it helps looking back in the ages and see progression.

No, there is absolutely NO single difference regarding 2D performances. a 0.1 fps difference with a standard deviation of 10fps is not significant at all!


Looking at average fps performance on this benchmark shows less than 1 fps difference between the two ROMs. lowest and highest are much more variable (look at stdev!) and thus cannot be compared.

What about the score?

Looks like CM12.1 gets some higher scores here? Right, but mainly because the Benchmark didn't recognized the same screen resolution (although both are set to 320dpi [default]) ==> normalized scores are similar. This might need further investigations.

regarding CPU/GPU

  • Contrary to the huge performance increase in SQLite (up to 900%!!) CPU/GPU performances are not better (even a little behind? not sure we can say that) on Exodus compared to CM12.1
  • So after hours of benchmarking, i couldn't show Exodus superiority here. So for people wanting a pure CM experience there is no point switching to Exodus of Falcons (XT1032 at least.) to burst CPU/GPU Benchmarks.
  • Nevertheless, those ROMs are pretty similar but Exodus features lots of things CM12.1 doesn't which is not something to throw out!
  • Later we will try to see if various other points of comparison can (or not?) differenciate Exodus from CM12.1.
    But are we really searching overkill performances in Exodus on Falcon? I personally don't. CM12.1 is a great stable base that gave me all i wanted for a while (Features and performance wise).
    What i searched for in Exodus is not extra performances, but extra features (Pie, navigation bar customs, bottom right clear-recent, ...)

Tuesday, October 13, 2015

Quickie#3 CM12.1 vs Exodus ROM : SQLite performance

Having two devices with similar hardware helps a lot for "real-time" comparisons of different ROM at a given time. Here we are comparing CM12.1 (20151012 nightly) with Exodus ROM (based on 12.1 ... 20151012) regarding SQLite databases performances, this is not like a full ROM versus, simply a comparison on a very specific point.

The devices
Similar Hardware ? yes, and no...

The two devices are both XT1032, with pretty similar hardware, but with some differences regarding memory :
*Device 1Device 2
eMMC8GB Sandisk16GB Toshiba
/data file systemF2FSF2FS
DRAM1024MB Samsung S41024MB Hynix S4

(does this adds a significant bias? hmmm maybe, but it won't explain the gigantic differences seen later)

AndroBench 4.1

Here i am testing pure SQLite performances with AndroBench 4.1 on both devices using BFQ scheduler (default CM and Exodus I/O scheduler since quite a while)-results in Transactions Per Seconds (TPS)-

Exodus-BFQ CM12-BFQ

average stdev average stdev
SQLite Insert 1241,40 21,19 116,22 4,48
SQLite Update 632,82 12,41 107,78 2,82
SQLite Delete 952,57 16,57 118,21 5,81

Looks like there's quite a big difference... isn't it?
In day to day usage i don't feel much gap between those two ROMs, but this specific benchmark shows that Exodus had more in-depth optimizations regarding SQLite database operations

Discussing bias:
  • Memory brand is different, your results are messed up: No, in fact other devices (aka Moto E 1st gen [XT1022, eMMC: Hynix, DRAM 1024MB Hynix S4, Snapdragon200] or MotoG 2d gen) show similar results on CM12.1 (or even lower for the MotoE). So even if the brand may have a little impact on performance, it won't explain the 10^1 between results.
  • As Processing unit has a fairly big impact on I/O performances, both devices are featuring a Snapdragon 400 @1.2GHz, Interactive governor, MP decision enabled.
  • Is choosing BFQ as scheduler impacts results? and why choosing it? BFQ is the default scheduler for both CM12.1 and Exodus, for this simple reason there is no point testing another in first-line. Plus it could be interesting to see if the optimizations have been directly applied to this specific scheduler or if they are more system-wide. On previous tests i couldn't show any difference in performance between BFQ and Fiops regarding SQLite Update or Delete operations.
  • SQLite databases are not reflecting real-life performance though, so this only shows a very little part of everything -but should make benchmarks addicts happy ;-) -

Thursday, October 8, 2015

DIY USB camera for an optical microscope

I recently got a "new" microscope : a Lemardeley from the 60s featuring both mono and binocular eyepieces (x5, x8, x10) and x10, x25, x60 and x120 objectives Taking pictures using a standard camera/smartphone is possible but gives some vignetted pictures, what about making a dedicated camera?

The Lemardeley microscope
Old good guy
On this picture the microscope is mounted with the binocular eyepiece, note the monocular one securely placed on the left wall of the wood box. also the objectives and oculars have a place in a sliding rack.
Luckily objectives of my previous microscope (from 2003) are using the same screw thread so i could adapt its x4 objective! (and potentially the x10 and x40 but that is quite useless here)
So here is the magnifying range :

X Ocular Lens
5 8 10
objectives 4 20 32 40
10 50 80 100
25 125 200 250
60 300 480 600
120 600 960 1200

adding a camera
After reading a lot on the web, i found that best results were given with a lensless camera module and without any ocular.
What is needed :
  • USB webcamera (here it was taken from an old ASUS laptop)
  • Old roll of film box
  • USB cable to connect the camera (either the webcam's one or a dedicated DIY one for embedded webcams
  • Hot glue, pasting tape, anything to cut or drill holes

How to
  1. Getting webcam and disassembling it to only keep the PCB, -not removing the lens yet-
  2. Checking if the roll fits on the eyepiece tube and drilling a hole on the back of it
  3. removing the camera lens and adapting roll box to fit the camera, hot gluing it (note the dust on the sensor, this will be an issue later...)
  4. make/adapting the cable (will depend on the camera used...)
  5. Testing

looking at a random chip
Here is a sensor on an HP scanner board : click for full size, -red circle shows the region zoomed on the right -one after the other-
Pictures are taken with guvcview.

Note the black dot (circled in red) : this is the result of the dust on the camera CCD

Saturday, September 19, 2015

Bringing a LG G2 back from the dead

A friend of mine had shattered his LG G2 screen, and replaced it succesfully -once-; after a while and a new fall he got another replacement screen and messed up the re-assembly. Some connectors were over bent, some pieces weren't at their own place... The following is not a step by step tear down as there are pretty good ones all over the Internet. Here are a few tricks not to definitely kill your device...
Toshiba LG G2 chip
Right things at the right place
On one ifixit tutorial (here) at the 6th step you can see there's nothing where i marked 'nothing' with a red circle (below pic is from the ifixt teardown):
iFixit picture
Actually, there SHOULD be something, a very little board coming from the LCD screen+digitizer:
capacitors board of LG G2 screen
This board full of capacitors is meant to be above the blue PCB, pasted on the cold plate.
On the Ifixit teardown, the board has simply fallen below it while prying -not an issue, but to re-assemble that picture can't help you-; it is MANDATORY to remember that it should be above or you cannot close the case... That's what my friend did: the capacitors board was below the blue PCB, thus preventing to further reassemble the device.
How it should look -how i reassembled it -but not pasted, yet-:
Capacitor board of LG G2 screen above µUSB+screen+audio+antenna board
When tearing down a device, take your time and take pictures of the process to successfully re-assemble. It is extremely difficult for someone else to re-assemble a messed up assembly without knowing exactly where should be what!

Fragile connectors
The connectors that help closing the electrical circuit aren't tough: they easily bend -and overbend- if touched without care.
i broke one while unbending (it is the same process as unbending LGA1155 connectors), luckily it was one connecting the loud speaker. So no more Rings and sounds, but that's not like if it was a vital organ.
LG G2 loudspeaker broken connector

The Unbreakable trick
Not booting after the process? here is a fix
After putting everything at its own place and try to save some other bent connectors -succesfully this time-, i tried to boot the device: epic fail, nothing happened. I had heard of a thread by george7565 at XDA of a hardware process helping un-hardbricking the G2: here
I simply followed the process step by step (george7565 documented it really well!)
Here is my own picture:
Unbrickable capacitor shorting trick

I did not needed to flash any files though, shorting the capacitors was enough to get a full boot (i had no other choice, since the ROM installed on the device was unknown to me ...)

Some issues left
The G2 was saved, but has some sequelae
  • Non-working LoudSpeaker (the loudspeaker is ok, but its connector (on the motherboard!) is broken, i still have no idea about how to fix it without replacing the motherboard...
  • Partially unresponsive screen : the touchscreen has a partially non-working zone at the bottom. This zone is about the size of the navigation bar -only the center part is still ok- marked in red:
    Unresponsive touchscreen : bottom part

Random pics of the inside
Electronic Pr0n
SKhynix chip
Toshiba chip
LG G2 Flash LED
LG G2 PM8841

Tuesday, August 25, 2015

Quickie #2: protecting Fenix LD12 side switch

The Fenix LD12 is quite powerful (125Lm) and small size (powered a single AA cell); the flashlight is quite tough with it aluminum body but it has two weaknesses : the rubber capped buttons.

To keep the flashlight waterproof, these rubber capped buttons needs not to be altered. I already needed to change the back On/Off button due to untimely leak but its construction doesn't allow to protect it; though we can protect the side button (replaced by a steel capped button on cutting edge Fenix flashlights!)
Which material could be used for that purpose?
A few possibilities were allowed to protect the side buttons. We needed the material to respect some characteristics :
  • Being firmly wrapped around the LD12 body
  • Strong enough not to get worn to quickly
  • Springy enough to allow the button under it to be pressed

What about using heat shrink tubing usually aimed toward electrical isolation?
When heated these tubes shrinks and wrap firmly around the underneath material (whatever it is...).
It is available in a large range of diameters : at home it had it in 1,3, 4.5 and 6mm... but it exist in 12.5, 25 and even 35 or 75mm...
Once shrunk, it resists quite well to tearing, scratching and break through (i used a dentist toothpick):

It looks like the perfect candidate for the job!

Let's wrap!

  1. Cut the tube at the right length, with heat it will shrink (in diameter) but length won't be altered
  2. hold the tube carefully: mainly if it was stored flattened.
  3. heat gently a little area with a soldering iron until you get one shrunk ring (3-6mm wide), starting from the collar
    (NB: try to heat homogeneously or you'll get thicker areas where the tube gets heated too long)
  4. repeat, moving little by little until all the tube has shrunk firmly around the body and press with your fingers after each step -before it cools down-(take care not to overheat the side button!! if your fingers are burnt while pressing... it was too hot!)
  5. finish with the Flashlight head
  6. re-heat area that aren't shrunk enough
  7. Press button area after heating a second time to get the button layout appearing (heating too much will make the tube thicker and you won't see the layout after pressing)

The Flashlight is now more wear/break-through/scratch proof (the side button at least). The result is far from perfect, but that was a first try!

Saturday, August 22, 2015

Quick review: 32GB PNY Micro Metal Attaché USB Flash drive

Today, i was thinking to get a new small USB flash drive to keep in my pocket, my choice went for the PNY 32GB USB-2.0 Micro Metal Attaché: P-FDI32G/APPMT2-GE
Why choosing a 2.0 flash drive?
... When 3.0/3.1gen1 are available and 3.1gen2 will come soon...
  • Price : 19€ for 32GB
  • My laptop is from 2011, it doesn't feature any 3.0 host...
  • I already have an EMTEC 16GB USB 3.0 flashdrive when i need high speed on compatible computers
  • Will USB type-C flash drives come soon??
Form factor and characteristics
  • Size: 18 x 12 x 7mm, 5g, this is quite small and light, perfect for my needs here; it is quite smaller than my little 16GB EMTEC of the above picture
  • Reliability :
    • 2 years warranty, Data retention: 10 years.
    • Write/erase cycles: 10,000 minimum.
    • It doesn't look rock solid (the metal part is really thin), really looks cheaper than the LaCie 16GB Key.
    But something interesting is written on the back of the box:
  • Speed (theoretical):
    • Write Speed: up to 8MB/s
    • Read Speed: up to 25MB/s
  • Speed (real-life): With 10MB files (the benchmark default value), we get 18.2MB for Read speed, and 4.5MB/s for Write speed, far below the theoretical values... !

    With 100MB files, we get some better results R:21.9MB/s, W:9.7MB/s:

    With 1GB files (only 10 tests, not to spend the whole day waiting...)R:22.4MB/s, W:11.4MB/s:

    Let's see how it behaves with small files :
    With 1MB files R:17.8MB/s, W:566.3kB/s:

    With 4MB files (approximate size of a song or a 12MPx picture):

    So, we can see that small size file are pushing the flash drive to its limits, resulting in very low speed (566kB/s!!!); Storing larger files shows better results (as good as the theoretical speed announced by the brand)
Pros ... and Cons
  • + Nice size and weight
  • + doesn't protude much from the computer USB host
  • + Average speed is OK for medium and large files
  • - Extremely low speed for small files, cannot be really used as a liveUSB medium (my USB3.0 EMTEC 16GB gets R:35MB/s W:10MB/s with 10MB files on a 2.0 host!)
  • - Not very tough construction, might not survive for years?