Shining Some Light - Lamp Repair

Sometimes you have lightbulb moments, but this was the opposite of that.

My old older son brought this two week old, $25 battery powered USB rechargable desk lamp to me, and complained that it kept turning off.

The Obvious

When I went to confirm that the lamp was plugged in, the Micro-USB port was visibly loose. Not a good sign! These ports often weaken and have poor connector retention, but in this case the entire shroud of the port was wiggling around.

My first instinct was to blame my son for being too forceful, or maybe inserting the connector in upside-down. As it happens though, he wasn’t entirely to blame.

Repairability

4/5 Stars

The hardest part about repairing cheap electronics is generally that they aren’t made to come apart. Thankfully, this unit is held in place with 3 plastic clips around the top of the base. Grabbing the “stem” and pulling widened this crack enough to insert a small plastic cell phone repair pry-bar into the gap and work my way around the top, revealing the following:

Inside, the unit is pretty simple:

  • An 18650 LiPo battery (or similar), possibly with an integrated protection circuit
  • A bit of copper tape inside the touch-button, forming a capacitive panel
  • Two wires running up the lamp to power the LEDs
  • A length of iron bar as a counterweight
  • A plastic clip holding the weight and battery in place
  • The control circuit managing on/off/dimming from the capacitive sensor, a connector for the battery, a charging indicator LED, and the errant micro-usb connector

Pros:

  • Components are screwed together
  • Case came apart without breaking entirely
  • Battery has a connector!

Cons:

  • It broke!
  • The copper foil for the touch sensor wasn’t very sticky and fell off after opening. I could see this falling off inside if the unit was dropped. Worse, since it’s copper, it could short the top of the PCB if it was feeling particularly malicious.

The Problem

Once inside, the problem was very clear:

The USB connector had detached from the PCB entirely!

This USB connector is a fairly common design, and while not the most robust in the world, does have 5 flat pins, and two mounting tabs on the sides, which should secure it decently.

Unfortunately, in this case the board designers decided against using the mounting tabs, instead soldering two small globs in the back corners of the connector (not really intended for mounting). On top of that, they only soldered the power and ground pads, despite having pads for all 5, further reducing the physical mounting durability.

These two factors alone shouldn’t have been enough to cause issue, but a third problem pushed this over the edge:

There are two plastic mounting posts at the back of the board, but what’s supporting the front (USB) side? Why, the poorly soldered USB connector of course!

As a result, when the connector is inserted at an ill-advised angle, the pressure is born entirely by 4 solder connections: two cold-solder blobs touching the back of the connector, and two surface mount traces. The blob connections cracked, the traces sheared off, and the USB port was free!

Repair

The repair was simple enough:

  1. Scrape the 5V and Gnd trace solder mask off withing 0.5mm of where the pads sheared off
  2. Use a fine tip iron to tin the newly created pads
  3. Place the USB connector back on the board
  4. Solder the power/ground back in place
  5. Solder the mounting tabs!

Once complete, the unit was quickly re-assembled and fully functional.

Why?

I have absolutely no idea why there isn’t a small ridge under the USB port side of the board to support it. It would easily fit the injection molded part’s mold profile, and this probably wouldn’t happen.

The mounting tabs being ignored is less puzzling. The rest of the PCB only has solder on the top, so they likely didn’t want to add a step to solder the mounting tabs on the bottom after reflow.

That said, the LED and sensor wires are probably hand-soldered, as well as the weird solder blob port mounting bodge, so maybe this was just unclear assembly instructions or the worker taking a shortcut?

BDB v4: 4th Time's the Charm

I received BDB v4 (SMD connectors- Expensive!) and v4.1 (Through hole connectors) this week, soldered one up and began testing.

The General Idea

For First Contact?, First Strike v1, and Z Offset v1 I used the same $10 2 channel, 3S brushed motor controller. Looking at the parts, it probably would have surved at 4S but I really wanted to move on to something more interesting, and finally gave in to my desire to put a custom mainboard in my robots.

The dual ESC worked great, cost very little, and sound advise is to keep using things that work great!

Unfortunately, as with many before me, I wanted more, even knowing that this would inevitably lead to my downfall.

I’ve enjoyed working with the ESP8266 a fair bit, and particularly like the Wemos/Lolin D1 board since its low price and integrated usb->serial interface make it much easier to work with than the cheaper ESP-01 and ESP12 form factors.

Goals:

  • IMU to help compensate for my poor driving skills by automatically inverting the controls when I’m upside down
  • Proxy for drive commands so I can write my own channel mixing in C++ rather than try to finangle it on my FS-i6X radio transmitter
  • Some degree of telemetry from the robot (via iBUS or WiFi) conveying IMU, Battery, and maybe weapon power information
  • Cool LEDs, possibly using the IMU and/or the drive commands
  • Low price per unit. Maybe these can be used on lots of bots?
  • Connectors on board that can survive combat to help swap damaged components quickly

Feature breakdown

Devices/features:
2x DRV8871 brushed motor drivers (should handle 3-6S no problem) - $2.75 on Digikey/Mouser
1x LSM6DS3 IMU (for easy inversion and cool effects) - $2 for carrier board+imu on Aliexpress
1x Wemos D1 Mini (ESP8266 carrier board) - $4 on Aliexpress
1x 100kΩ : 10kΩ voltage divider between VCC and 5V tied to A0 for battery level readings

Power connection (in):
1x 5V logic
1x VCC (4-45V depending on use)
1x GND

Ports (in/out):
1x 3p Molex Picoblade for Radio: Power, GND, and RX (tied to RX0 using iBUS or PPM radio input)
1x 3p Molex Picoblade for LEDs (5v, Gnd, and WS2812 LED string serial)
1x 3p Molex Picoblade for Weapon PWM (VCC, GND, and PWM pin)
2x 2p Molex Picoblade for L/R brushed DC drive motors

Headaches

I started with BDB v4 after deciding to give up on the Arduino Nano IoT33 due to its very high cost ($33CAD/unit). The ESP8266 is 1/8th the cost and can do nearly as much with some help.


After sending the boards off to the fab, I went on Digikey to order the missing components.

That’s when I noticed a small problem:

$27.19 for passives and wires? What’s going on?

This is when I noticed that SMD Picoblade connectors were much more expensive than through hole versions.
The pre-crimped wires were also not helping.

Unfortunately, v4 was already sent in, so it was time to spin up v4.1:


Testing and validation

So far, I’ve tested each individual component and process:

  1. Assembly:
    • The large capacitors add a lot to the vertical height (1-2mm) and their footprints overlap the 2p picoblade connectors slightly. I was able to trim the plastic foot a bit to make it work, but they should probably move to the bottom and be thinner
    • The VCC through hole pad touches the micro-usb port grounding shield. I soldered the Wemos D1 mini slightly crooked to leave a gap, and placed some kapton tape over the area to be safe.
    • It took 45 minutes to hand-place the SMD components using a solder paste syringe. Next time I should consider a solder stencil!
  2. ESP8266: Works!
  3. IMU: Works!
  4. 2x Motor driver: Works!
  5. Radio:
    • Required some messing around with uTimerLib, and commenting out the iBusBM library’s TX capability (which my radios don’t support anyway)
    • Works!
  6. FastLED + WS2812 test strip: Works!
  7. Weapon PWM: Works fine to blink an LED. No major risk.
  8. Voltage divider+analog input: Works great!

Lessons learned:

  • Thinner capacitors, possibly on the bottom (through hole)
  • Move power input away from USB port
  • move away from RX/TX to make debugging easier (D8/RX1 for weapon/radio ports would free that up)
  • Add input for a hall effect sensor possibly
  • Move all ports to one side, since the dual sided ports make it hard to fit anywhere but the middle of the bot
  • Break out i2c bus for rangefinders?
  • Watch out if moving to a non-carrier board since the true A0 voltage range is 0-1V not 0-3.3V like the D1 mini

Improving Signal to Noise

I’ve been puttering away at a few things over the past week:

  • A WS2812B 2020 form factor carrier board with 8 LEDs to make pretty side/top/front decals for both of up upcoming bots
  • Trying to get a prototype radio transmitter together
  • Hitting F5 watching my BDB PCBs move from production to shipped!

Custom Controller Attempt 1: Retrofit a PS2 controller

My first idea was that rather than starting from scratch, I should retrofit a PS1 controller with a Flysky Tanaris module, and an arduino.

I created a PS1 controller using a PIC16F84 back in highschool, so I figgured that with a modern arduino it should be pretty easy to go the other way.

Parts:

  • 1x Arduino Nano 33 IoT - Tested, works well
  • 1x 16340 3.3+5V battery/charger/regulator module - Tested, works well
  • 1x I2C LCD 128x64px monochrome display - Tested, works well
  • 1x PS2 controller - Arduino can read it, but the data looks fishy
  • 1x Flysky Tanaris module - Untested, but google says it takes 5V, GND, and PPM, and that seems easy to generate

As luck would have it, it was fairly straight forward to get most of the controller pieces together, however victory was hollow. The knockoff PS2 controller I cut apart had absolutely terrible analog range, and the triggers were digital, which the d-pad was analog. Little brother mode indeed. I decided to take the somewhat longer path of designing and printing my own controller instead.

Custom Controller Attempt 2: Build a controller from scratch

With one setback on this project, it seemed prudent to proceed with the longer, but maybe more straightforward plan of building my own controller.

I’ve built a custom controller before (arduino nano, 2x analog sticks, LiPO battery, NRF24l01) for the pair of quadcopters I build in 2013/2014.

My plan was to print something like a PS2 controller, but with a screen and less buttons.

On the plane heading to a work trip I sketched out a state machine for the menus on the screen, but there was one thing that was nagging me.

Rememeber last week when I listed “Test early in isolation” and “Expect failure”. While on the work trip, the fact that I hadn’t actually tested tranmitting using the Flysky tanaris module was nagging at me.

As you can probably guess, problems abound!

Challenges:

  • The Arduino Nano IoT 33 is very new and uses a relatively unsupported and sparsely documented SAMD21 arduino integration
    • As a result a lot of Arduino libraries don’t work out of the box, especially ones using timers or specific hardware port access
  • Even after getting PPM input and output working well together, the flysky tanaris module didn’t seem to want to work
  • There was no documentation at all on the Tanaris module, which I had hoped meant that it was straight forward, but instead left me without much to dig into

I tried a few things:

  • Binding my FS-i6X transmitter to:
    • FS-RX2A receiver via iBUS: Worked
    • FS82 receiver via iBUS: Worked
    • FS-i10B via iBUS: Worked
    • FS-i10B via PPM: Worked
    • FS-i10B via PWM: Worked
  • Binding the Arduino->Flysky Tanaris transmitter to:
    • FS-RX2A receiver via iBUS: Nothing
    • FS82 receiver via iBUS: A bit of noise on channel 1
    • FS-i10B via iBUS: Nothing
    • FS-i10B via PPM: Nothing
    • FS-i10B via PWM: Nothing
  • Logic level converting from 3.3V to 5V for the PPM input on the tanaris module: Nothing

This highlights how important testing each component in isolation is before getting too deep into a project.

Next Steps

I’m looking at one of three options for the controller now:

  • Get a nice OpenTX transmitter that I can hack to my heart’s content (I’m looking at the Flysky Nirvana at ~$180, which is pretty pricy but good value versus most others)
  • Order a different Flysky compatible TX module and carry on with the custom controller (I’ve ordered one, but it’s not siginificantly more likely to work than the one I tried already)
  • Keep using my FS-i6X and possibly just have a telemetry module as a bolt-on attachment

Gantt Update #2

gantt
dateFormat  YYY-MM-DD
title The Gantt to Motorama

section First Strike v2
Chassis v3            :active,  crit,  fs1, 2019-11-24, 10d
Weapon  A           :   crit, fs2, after fs1, 10d
Chassis v4              :  crit, fs3, after bdb404, 14d
Weapon B? : fs4, after fs3, 10d
LEDs : done, fs4, after fs3, 7d
Drive Test+Refine : crit, fs4, after fs3, 14d
Chassis v5? : 10d
Armor Fab. : crit, 10d
Stand : 3d
Spares? : 10d
Motorama!               :         motorama, 2020-02-14, 3d

section Z Offset +2.0000
Chassis v2            :active,  crit,  zo1, 2019-11-24, 14d
Lifter v2           :   crit, zo2, after zo1, 10d
Chassis v3              :  crit, zo3, after bdb404, 14d
LEDs : done, fs4, after fs3, 7d
Drive Test+Refine : crit, fs4, after fs3, 14d
Armor Fab. : crit, 21d
Stand : 3d
Spares? : 10d
Motorama!               :         motorama, 2020-02-14, 3d


section Controller
Integrate : 2019-12-25, 2w
Refine : 2w

section BotDriverBoard
v4 Design            :done,    bdb401, 2019-11-08,2019-11-11
v4 Manufacture               :done,  bdb402, after bdb401, 12d
v4 PCB Ships               :active, crit,  bdb403, after bdb402, 10d
v4 Test               :        crit,  bdb404, after bdb403, 5d
v4.1 Design            :done,    bdb411, 2019-11-11,2019-11-12
v4.1 Manufacture               :active,  bdb412, after bdb411, 21d
v4.1 PCB Ships               :         bdb413, after bdb412, 10d
Test 4.1               :         bdb414, after bdb413, 14d
v5 Design? : 7d
v5 Manufacture? : 21d
v5 Ship? : 10d
v5 Test? : 7d

The Road to Motorama 2020

Today my Motorama Robot Conflict 2020 registration was approved! Builder’s DB signup in, paperwork signed and submitted, and payment received.

Here’s what I’m working on!

The High Level Plan

  • First Strike v2: Improved weapon engagement, smaller, better driving
  • Z Offset +2.0000: New skeleton (Not PETG!), reinforced lifter joint+arm,
  • Pwny Botstation v1
    • A “simple” custom controller closer to a console gamepad built specifically for combat robotics
    • Uses a Flysky Tanaris module (to make safety compliance simpler) for downstream control
    • An ESP8266 based telemetry flight recorder
    • A display
    • RGB LEDs?
  • BotDriverBoard: A custom PCB designed to replace the existing dual brushed ESC carrier that I’ve been using so far. Highlights:
    • WIFI Telemetry
    • Custom channel mixing
    • Enough current to handle Ant+Beetles
    • Room for future growth
    • Low low BOM (< $15 CAD)
    • RGB LEDs?

Strategy

  • Rapid prototyping
  • Expect failutre:
    • Pad timelines (especially shipping!)
    • Test early in isolation
  • BDB can be cut, using the existing generic controllers (In fact, BDB v3 was cut just 10 days before BotBrawl #10!)
  • Pwny Botstation can be cut entirely, using the FlySky i6x that I’m currently using (Idea was on hold until after BotBrawl #10)

A Gantt for the Ant (and Beetle)

gantt
dateFormat  YYY-MM-DD
title The Gantt to Motorama

section First Strike v2
Chassis v3            :active,  crit,  fs1, 2019-11-16, 10d
Weapon  A           :   crit, fs2, after fs1, 10d
Chassis v4              :  crit, fs3, after bdb404, 14d
Weapon B? : fs4, after fs3, 10d
LEDs : fs4, after fs3, 7d
Drive Test+Refine : crit, fs4, after fs3, 14d
Chassis v5? : 10d
Armor Fab. : crit, 10d
Stand : 3d
Spares? : 10d
Motorama!               :         motorama, 2020-02-14, 3d

section Z Offset +2.0000
Chassis v2            :active,  crit,  zo1, 2019-11-16, 14d
Lifter v2           :   crit, zo2, after zo1, 10d
Chassis v3              :  crit, zo3, after bdb404, 14d
LEDs : fs4, after fs3, 7d
Drive Test+Refine : crit, fs4, after fs3, 14d
Armor Fab. : crit, 21d
Stand : 3d
Spares? : 10d
Motorama!               :         motorama, 2020-02-14, 3d


section Pwny Botstation
Concept           :done,    nc1, 2019-11-12, 2019-11-15
HW Prototype : active, nc2, after nc1, 14d
SW Prototype : active,        nc3, after nc1, 14d
Refine : 21d
Pretty Version : 21d
Order Spare Parts? : 35d

section BotDriverBoard
v4 Design            :done,    bdb401, 2019-11-08,2019-11-11
v4 Manufacture               :active,  crit, bdb402, after bdb401, 12d
v4 PCB Ships               :       crit,  bdb403, after bdb402, 10d
v4 Test               :        crit,  bdb404, after bdb403, 5d
v4.1 Design            :done,    bdb411, 2019-11-11,2019-11-12
v4.1 Manufacture               :active,  bdb412, after bdb411, 21d
v4.1 PCB Ships               :         bdb413, after bdb412, 10d
Test 4.1               :         bdb414, after bdb413, 14d
v5 Design? : 7d
v5 Manufacture? : 21d
v5 Ship? : 10d
v5 Test? : 7d

Service has been restored

My migrated server is finally back up and running!

1
2
while True:
print("Yay!") # yes, 3

Now to migrate over my old blog posts…