Posts

Showing posts from 2020

Wakey Wakey - Network Alarm Clock

Image
I repurpose old Android mobile phones (from the KitKat/Lollipop era) to use as alarm clocks in my 3 young kids' rooms. After a while, it gets pretty tiresome syncing up the alarm clocks (eg. when the next day is a public holiday and you want to disable the alarm just for that day so that everyone can get a bit more sleep).
I thought it would be pretty cool if I could update all the alarm clocks remotely from a webapp. I couldn't find any alarm clock app that can be remotely controlled on the app store, so I decided to implement my own.
For the webapp, I repurposed another project of mine called Shopping Buddy. This turned out to be relatively easy, because it basically involved stripping away features like bookmarks and history, and trying not to break things along the way. It was done pretty quickly, and I called it Wakey Wakey
The production site can be found at: https://wakey.randseq.org
The Github repository can be found at: https://github.com/victor-chew/wakey-wakey
Screenshot…

Hacking a USB-C to slim tip adapter cable to charge the Thinkpad T450s

Image
This hack is inspired by this post.
A year ago, I bought an adapter cable for my wife's Thinkpad X1 Carbon (2nd Gen) that allows her to power her laptop with a 60W-capable portable battery (20V x 3A). A USB-C cable goes from the battery into the adapter, which converts it to the slim tip output required by the laptop. Everything works out of the box, so I didn't give much thought about it. Recently, I decided to buy a similar cable for my Thinkpad T450s. I know technically it should work because the T450s can go as low as 45W (20V x 2.25A) in terms of charging (though I have the 65W charger - 20V x 3.25A).  I went with another adapter cable because it was cheaper and also I prefer the single cable design.
So imagine my surprise when the cable came and I plugged it into my laptop and it didn't work! The power manager just cycle in and out of charging mode before giving up with an error message saying there is not enough power.
After much research and reading the Thinkwiki Power…

Important calibration when loading new 3D printer filament

Note to self: The most important calibration to do when loading new 3D printer filament (even if it's the same brand and type, because the formulation may have changed) is to calibrate the extruder steps/mm (also called E-steps/mm).
Details of this calibration is given here.
The (simplified) steps I take are:
Power up the 3D printer and hook it up to the laptop via a USB cable.

Install and run a program that is able to talk to the 3D printer via the virtual serial port (eg. Prointerface).

Mark 10cm of filament, starting from the hole where the filament enters the extruder stepper mechanism and work backwards. An extra piece of filament that is measured to exactly 10cm helps here.

Use the following G-Code to find out your current E-step value. M503The current E-step value is the last value (96.5) on this line: Steps per unit:
    M92 X80.00 Y80.00 Z400.00 E96.5 Issue the following G-Code: // Set nozzle temp to 190c. Set to temperature you'd be printing the filament at. M104 S190 // Relat…

Downmux to 2-channel AAC without recoding video stream

Get Win64 build of ffmpeg here.

ffmpeg.exe -i input.mp4 -c:v copy -ac 2 -c:a aac -vbr 3 output.mp4

ESPCLOCK3 - The Final Version

Image
Overview This is the latest, and probably final iteration of my ESPCLOCK project. You can find ESPCLOCK1 here, and ESPCLOCK2 here.

The main differences between ESPCLOCK3 and ESPCLOCK2 are:
Use barebones ESP-07 instead of WeMOS D1 Mini to reduce deep sleep power draw.Use PCF8563 RTC to clock the ATtiny85. PCF8563 is chosen over the more popular DS3231 RTC due its vastly lower power consumption. Using a RTC to clock the ATtiny85 allow us to use the POWER_DOWN instead of IDLE sleep mode, which minimizes power draw. As a result, the ATtiny85 code is also vastly simplified because we don't have to play with Timer1 to get an accurate 1Hz signal.Use diode clamp to limit the voltage pulsing the analog clock. Connecting to the analog clock directly using the ATtiny85 pins running at ~3V requires the clock pulse to be longer (~200ms) and increases power draw (due to reduced MCU sleep time). In addition, the higher voltage causes ticks to miss occasionally. The diode clamp limits the pulses …

Newly formatted SD card not working in Ender 3

I quick-formatted an old 2GB SD card using Windows and popped it into the Ender 3, but it was not recognized.

I also tried a full format based on what others have mentioned on Reddit, but that didn't work as well.

Finally, what worked was quick-formatting the SD card using the SD Memory Card Formatter by the SD Association.

Free method to migrate HDD to a smaller SSD

I have run into this enough times, I thought I should make a mental note for myself.

Make sure the actual content on the HDD is able to fit onto the smaller SSD. If the HDD contains 900GB worth of data, it is not going to fit onto a 512GB SSD.

Check to see if the SSD manufacturer have some free software that can be downloaded for the task. Frequently they might have a restricted version of some commercial software that will only work with their SSD. That should be the easiest way forward.

If this option is not available, most supposed free version of disk imaging or cloning software will have a few restrictions in place so that you will upgraded to their paid software. For example, they might only clone to a drive of the same capacity.

Here is one way of migrating the HDD to a smaller SSD for free.

1. Use MiniTool Partition Wizard to resize your HDD to a size that is smaller than your SSD. The partition move/resize functions of this software is free, but the cloning function is only a…

Mass removal of NTFS ADS

How to mass remove all NTFS ADS (Alternate Data Stream) from files in a folder and all its subfolders:

stream -d -s *.*


Filament Joiner Part 2 (With Display and Knob)

Image
Thanks to the current corona-virus crisis, the parts I ordered for the filament joiner project were taking forever to arrive. But now that they have finally arrived, I can put them to good use.

These were the parts ordered:
0.96" OLED display SSD1306Rotary switch encoder KY-040 Here is the final circuit diagram:
The OLED display is connected to the SCK and SDA pins of the Nano (A2 and A3 respectively), and powered by 5V and GND.

The rotary switch encoder is connected as follows:
VCC => 5VGND = > GNDCLK => D9DT => D8SW => D2 My prototype board now looks like this:


The updated code for driving the knob and display is available in heater-with-display.ino in the Github repository.

We now have a fairly compact (about 7cm x 5cm) and independent filament joiner (no need to connect to PC) that is driven solely by a 12V power supply.

Here's how to use it to join printer filaments.


More usage details in my previous post.

3D Printer Filament Joiner

Image
I have been looking at various ways of joining 3D printing filaments.

One method involves running one end of a filament through a short PTFE tubing, melting it with a lighter or candle, retracting it back into the tubing and immediately plunging the filament to be fused into the tubing:


One problem with this method is that you can't really control the temperature at which you melt the filament, so you frequently end up with a brittle joint that breaks upon the slightest bend.

Aliexpress even sells a contraption that works along the same line. As it uses a lighter or candle as well, it suffers from the same weakness. I am not even sure why you need a special contraption when a short PTFE tubing will work just as well.

Another method involves using shrink tubing/aluminium foil, and a heat gun:


But a heat gun is rather expensive, so I wanted to explore other alternatives.

The candle + PTFE tubing method actually works quite well when you happen to melt it at the right temperature. It…