Posts

Showing posts from November, 2018

Replacing the camera on the MJX Bugs B2W

Image
The MJX Bugs B2W drone is great to fly. It stays relatively stable even in moderate wind, has great range, and the return-to-home function coupled with GPS means you are unlikely to lose your drone even when it goes out of range.

The onboard WIFI camera, however, is another story. I could never get it to go beyond 100m (that's paired with an iPad Air 2, which gives better range than all the smartphones I have tried). Even when it's within range, the video is both laggy and jerky.

So there's no other choice but to replace the camera with a proper 5.8GHz FPV. These were the parts I bought:

Foxeer Arrow Micro Pro 2.1mm cameraEachine TX526 5.8G VTXEachine ROTG02 FPV OTG receiver
Many people have tried different ways of modding the B2W. Some chose to preserve the onboard camera while adding the new one (I decided to rip the whole thing out to reduce the weight). Some chose to power the camera + VTX with its own battery (I chose to power the assembly with the onboard camera batte…

Google Camera with NightSight on Redmi Note 4x

Image
I have been running Google Camera 5.x on a rooted Redmi Note 4x / MIUI9 for the longest time. The default HDR+ shots are fantastic, and the portrait mode is fun and surprisingly reliable.

I generally dislike flashing new ROMs due to the hassle of configuring the environment and having to setup the odd apps that do not properly restore their settings from the cloud. So I have stuck with MIUI and have generally grown quite used to it.

A number of factors have finally nudged me out of my comfort zone. First, the MIUI10 update was a total disaster. Google Camera stopped working with no known workaround. Once one has tasted the power of Google Camera, it's hard to go back to anything else! Secondly, MIUI10 is an aesthetic mess. It abandoned color notification icons for the black-and-white aesthetic of vanilla Android, but left its own apps (eg. Mi Fit) alone. This led to something so horrible that even a typically function-over-form guy like myself couldn't stand it. Thirdly, this …

Current draw of ATtiny85 ticking clock using watchdog timer

I modified the previous watchdog timer code to test the current draw of ATtiny85 ticking a clock using POWER_DOWN deep sleep.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76#include <avr/io.h>#include <avr/wdt.h>#include <avr/sleep.h>#include <avr/interrupt.h>#include <avr/power.h>#define TIMER0_PRESCALER 1024#define OCR0A_DEFVAL ((byte)(F_CPU / (float)TIMER0_PRESCALER * 200/1000.0) - 1)#define adc_disable() (ADCSRA &= ~(1<<ADEN)) // disable ADC (before power-off)volatile byte timer0_tickpin = PB3; volatilebool wdtimer =false; voidstartTimer0() { // Set prescaler to 1024, thereby starting Timer0 TCCR0B = bit(CS02) | bit(CS00); } voidstopTimer0() { // Set prescaler to 0, thereby stopping Timer0 TCCR0B =0; } // Interrupt service routine for Timer0// The effect…

ESPCLOCK2, Part 4 - Implementation

Image
Parts required:WeMos D1 MiniATtiny850.47F capacitorBAT46 Schottky diodePushbutton 2 x 100 ohm resistors2 x 4.7K ohm resistors Breadboard layout:
Source codeGitHub Operation When the circuit is first powered up, the onboard LED on the D1 Mini will light up, indicating that it is in configuration mode. 
Selecting the captive wifi portal "ESPCLOCK2" will bring up the web browser. The configuration page looks like this: Assuming that the timezone has been prefilled correctly, one only has to select the local wifi AP and supply the password, then key in the time on the physical clock in HHMMSS format. Hit the [Save] button, the onboard LED should turn off, and the clock will start to run. Hardware When the pushbutton is held down while the circuit is powered up, the D1 mini clears out the wifi AP and password, allowing you to start over again from a clean slate.
The Schottky diode cuts off the link to the 3.3V pin when the battery is depleted or removed. The ATtiny85 will then b…