Hao Jie Chan's Kingdom
SD Wing Zero Custom is done! Click here to check it out!

Ad 468 X 60

built of paper.

Sunday, January 17, 2016

A Buck Converter Power Supply

Power Supply

This project has been in my mind for a long time. I have always wanted an easy to use power supply, without resorting to Arduino for a 5V supply. With the addition of a cheap DIY oscilloscope which requires a 9V supply, this project became more and more important.
With the start of my sem break, this long overdue project finally got the chance to be completed.

Power Supply2
Another shot at the completed project exterior.

Power Supply Interior
The interior.

Power Supply Interior2
Okay, time for some explaination. This “power supply” is basically just a buck converter, I am using a cheap one from China, using MP1584EN as the switching IC.
My plan was to change the SMD potentiometer, to a bigger one which can be turned by hand. (I was frustrated by the need of a screwdriver just to change the voltage level.

The input is taken from a laptop adapter, which I have one laying around.  So, it is a 19-21V to maybe 0.8V-18V supply with a maximum of 3A load ( that’s what the datasheet and seller claims, I would not use it for more than 2A personally. )

Power Supply Interior3
The potentiometer solder pads were quite small and were ruined when I desoldered the pot. Heck I even spoil the pot! Then I put a 10K potentiometer initailly, found out that my input would not rise over 2V. I figured my resistance was too low for the feedback path. I then change the pot to a 100K pot. Better, but the voltage stopped at 10V. Can be used, but I wasn’t satisfied. I found that the resistor value is different for 2 batches of boards. Refer to the following photos.

MP1584EN board
This is from the old batch, green colour board. Now If we zoom in to the resistor,

MP1584EN board closeup
It’s 322, as in 3.2K ohm.

MP1584EN board new
The new one, (as in the one I used), blue board, has a 822 SMD resistor, 8.2K ohm. The potentiometer forms a potential divider with the resistor to produce a feedback to the IC. The IC requires 0.8V at the feedback. 100K is simply too small for me to generate up to 18V.

Thus, I hacked the board, again. I have some 10K SMD resistors around. I simply soldered them on top of each other, to reduce the resistance. SO in the end, it’s 8.2K//10K//10K = <5K ohm!
And that worked! Circuit theory rocks! Open-mouthed smile Sorry I just have to bask in my glory for a little while.
Now, I can move on the next project, which is still undecided.

 See you next time!
Read More »

Saturday, December 12, 2015

Arduino Uninterruptible Power Supply (UPS)

Recently a friend of mine asked me to design a simple Uninterruptible Power Supply for Arduino using some handphone battery ( Li-ion) and handphone charger.

I decided to use a TP4056 charger board to charge the battery, while using a P-MOSFET to control when will the battery provide power to a 5V Step Up Converter.

The schematic shows the 5V from a handphone USB charger feeding a 5V Boost Converter, which powers an Arduino Uno. The 5V will also charge the Li-Ion via TP4056 board. If the USB Supply is gone, the P-MOSFET will be switched on and the Li-Ion battery can power the Boost Converter.

( on second thought, now I am thinking about the usefulness of the P-MOS. I was thinking of switching the battery on and off but now I think it serves no purpose... LOL)

Anyway, the 2 diodes are 1N5158 , I forgot to change it on the schematic. I think the P-MOS can be eliminated because the 5V from the USB would have prevented the battery from supplying power anyway.

This is my end result on a perf board. My friend says that it is working fine, at least until now. (I have no confidence in my design).


p/s :for the improved design, go to http://chanskingdom.blogspot.my/2016/10/arduino-uninterruptible-power-supply.html

Read More »

Thursday, November 12, 2015

Fix a 8Gb Pen Drive

Never in my mind I thought that I would find a FAKE pendrive in my house. Here I am, holding one. My mom bought this like years ago and it broke just weeks after it was purchased. I knew something was wrong but never had the time to dig deeper. (Click on the picture for the actual size photo)

Our Main Guest today!

The gut of the flash drive. I even opened the casing to see the controller code. It was futile.

Today, I was searching for an answer for this. I thought it was just a simple corrupted sector or memory. Googled whole day, tried all sorts of formatting tools, from Windows built-in formatting tool to the HP format tool, but all were unable to complete the formatting. The Windows Formatting says that the disk drive is "Write-Protected", and changing the registry key of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies to 0 did not work at all.The Low Level Format Tool returned Device I/O Error  for Format Error Occurred at Offset 0 and so on for all 8Gb of memory location.

Then, I stumbled across the Chip Genius tool. It shows the chip and vendor information.

This is after I have fixed the drive. Before this it showed  something like "山寨黑盘" which means it might be a fake drive from China. Anyway, nothing can be worse, perhaps I can at least salvage what is left of it.

Google showed me AlcorMP, a software they used to program the controller of the USB disk before selling the disks. This is how they "fake" the memory size of the disk. ( do correct me if I am wrong, I'm not so sure about this myself)

Tried the first one, failed. Second one, failed as well. Turned out I need to find the one which will work with my Firmware. The info is listed as "F/W EF66" as shown in the picture.

Google pointed me to http://flashboot.ru/files/file/53/ , where the translation for the comments showed promising result for my firmware. But before that, I need to make sure AlcorMP recognise my disk.

Following the steps from Formating USB with Manufacturer Tool - USB Drive Format Utilities - reboot.pro , I added my VID and PID for IgnoreVIDPID and VIDPID , which in my particular disk is 00117788 into AlcorMP.ini file.

Run AlcorMP.exe as ADMIN ( this is very important as I could not load the driver without admin access) and this will pop up.

Click Start and it will start to scan for bad sectors and restore the disk to its default value.

Mine actually became 1.4GB only after the process.( verified using H2testw)
I hope this post will be useful for those who struggled to fix a broken or "possible Fake" flash drive. Until the next post, have a good day. :)

Read More »

Friday, October 16, 2015

Introduction to Papercraft

I am taking a English Language course in USM, LSP404. The course requires an Individual Oral Presentation as an assessment. So, I took the opportunity to introduce papercraft, a wonderful hobby rarely known to Malaysians to my friends and lecturer.

I made a Pikachu from Paperpokes ( partly because I wanted to build something. It has been like one year since I used my cutting mat and pen knife) and documented some of the building processes in the slides. The slides should give a good introduction to those who want to start on this hobby but are clueless about the process.

Feel free to leave a comment or email me in case you have any questions.

I hope you enjoy the slides and keep papercrafting!

Read More »