View unanswered posts | View active topics It is currently Mon Jun 24, 2019 4:00 pm



Reply to topic  [ 13 posts ] 
 Bicycle lights 
Author Message

Joined: Wed Jan 02, 2019 4:10 pm
Posts: 14
Today, I received a brand-new tail-light for my bicycle - a Busch & Müller Toplight View Brake Plus. All-singing, all-dancing, and I would not be at all surprised to find a microcontroller in its electronics, considering the features it boasts. Alas, I must wait for the new headlamp and cables to arrive in the other shipment before I can really make use of it.

But this post is not about the new light. It's about the old one, which stopped working several years ago and had to be supplemented by a seat-post-mounted "blinkie", and was generally quite mediocre to begin with. According to the date-code stamped into the optics moulding, it was made in February 2007, probably fitted to my bike very shortly afterwards, and has followed me around in all weathers (literally - this is Finland after all) for roughly a decade. Pressing the button underneath used to cycle it through three modes: off, on, and daylight-sensitive. (Carrying a BS mark precluded it from having any flashing modes, as would StVZO approval if it had that.)

Last night there was a blizzard, so when I pulled the bike inside to work on it, it was covered liberally in snow despite being under some very large eaves. Upon unbolting the old light (left in place principally for its large and still perfectly functional reflector), I opened it to find a pair of batteries still in situ, but very distinctly *damp*. Something tells me that's at least partly why the thing failed in the first place; there is no really effective seal against the elements in the housing.

So why this post? Because for some unfathomable reason, its designers took the exceedingly simple functionality required, and decided it was the perfect fit for a microcontroller. Specifically, a PIC 12F629. The PCB carries that, exactly one dozen auxiliary components, and the terminal posts for a pair of AA batteries. And the experience level of those designers can easily be judged by the fact that, in PCB version 2.2, there is a capacitor across the power pins of the PIC - but soldered directly to the pins, as there's no place for it on the PCB itself.

I can see you facepalming already.

Alas, I presently lack even the simplest test equipment with which to track down the actual fault in this thing, and perhaps confirm (or otherwise) whether the PIC still works. Given the general state of the PCB, it's quite possible that there's an open circuit due to a corroded trace, or that a short-circuit has burnt something out. There was a faint whiff of "magic smoke" when I opened the casing…

The optics, at least, appear to be halfway competently designed, though not a patch of B&M's latest products. There are light-guides spreading the light in more generalised directions than straight aft, including to the sides for improved visibility at junctions. I'm sure that was a requirement for its BS certification. There are also a couple of shallow grooves milled into the cover to help secure the batteries in place, which would otherwise be shaken loose in short order.


Attachments:
P1010309.jpg
P1010309.jpg [ 410.39 KiB | Viewed 2727 times ]
P1010308.jpg
P1010308.jpg [ 425.19 KiB | Viewed 2727 times ]


Last edited by Chromatix on Sat Jan 05, 2019 8:14 pm, edited 1 time in total.

Wed Jan 02, 2019 4:38 pm
Profile

Joined: Wed Jan 02, 2019 4:10 pm
Posts: 14
Now that the new headlight also arrived, and I've fitted it to the bike, I took the old headlight apart as well. This is, outwardly, a bog-standard halogen reflector combination, made (or at least branded) by Spectra who are apparently based in Sweden. The optics are absolutely terrible, yielding a dim yellow rectangular patch of light in the distance, and basically no usable light in any other direction - but this is entirely typical of a 2.4W dynamo light from about a decade ago, probably with a 10-lux rating. The new B&M light promises to be infinitely better, with an 80-lux rating and a considerably wider and smoother light pattern.

The electronics inside the Spectra lamp seem to be surprisingly sophisticated, using mostly SMD parts - but with no microcontroller in sight, despite having very similar modes of functionality to the rear lamp. The mode is selected by a physical three-position switch, and I was able to identify a dual comparator, a power MOSFET, and a 6.8V bidirectional clamp diode (without which it would be easy to burn out the bulb when moving fast). I should mention that I didn't even have to replace the bulb in the past decade of use. I suspect the comparator and MOSFET are used to implement an active rectifier, so as to get more useful power out of the dynamo at low speeds.

Most notably, despite having gone through exactly the same environmental hazards as the rear lamp, the circuit board was essentially clean and dry; just a bit of grunge near the tail-light terminals. So props to Spectra for making a lamp that was at least reliable and competently designed, even if it wasn't very bright.


Attachments:
P1010312.jpg
P1010312.jpg [ 673.34 KiB | Viewed 2727 times ]


Last edited by Chromatix on Sat Jan 05, 2019 8:15 pm, edited 1 time in total.

Thu Jan 03, 2019 10:45 am
Profile

Joined: Wed Jan 02, 2019 4:10 pm
Posts: 14
Going back to the tail light, which *does* have a microcontroller, here's what I've been able to determine of the circuitry:

Attachment:
P1010316.jpg
P1010316.jpg [ 451.16 KiB | Viewed 2727 times ]


It's not a very clever or power-efficient design. One pin of the PIC drives the main LEDs through a bog-standard PNP transistor. Three of the others are involved in reading the pushbutton and comparing the photosensor bridge against a voltage reference constructed from a green LED (which doubles as an "on" indicator). One more pin simply turns off the green LED as a power-saving measure, but the photosensor bridge and a rather pointless-looking voltage divider on the Vpp pin are connected to the battery full-time, slowly draining it.

Given that there's no brand name anywhere on the thing, and I'm pretty sure it just came with the luggage rack, I'm going to assume it was designed and made in China.


Last edited by Chromatix on Sat Jan 05, 2019 8:16 pm, edited 1 time in total.



Thu Jan 03, 2019 3:19 pm
Profile

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1192
(Possibly the largest attachments we've seen on here - I'm not at all sure this forum does any handy resizing so please feel free to swap out for photos of more modest size!)


Thu Jan 03, 2019 6:14 pm
Profile

Joined: Wed Jan 02, 2019 4:10 pm
Posts: 14
At least in my browser, the pictures are displayed to fit in width. Whatever happened to the thumbnail functionality on 6502.org?


Fri Jan 04, 2019 6:38 am
Profile

Joined: Wed Jan 02, 2019 4:10 pm
Posts: 14
Well, the new headlight is great (after some careful adjustment, very much like what a car headlight needs), but the new tail light has proved to be very unreliable. So, after obtaining a refund - and given that the vendor didn't require me to send it back to Germany! - I decided to crack it open to see if I could troubleshoot.

Yes, it has a microcontroller in it. Specifically, one of the smaller entries in the MSP430 series.

The standard of design and construction is clearly much higher than in the old light at the top of this thread. On the back side of the board are the two bright SMD LEDs and two capacitors, one ordinary one presumably to help power the microcontroller, and one massive 1-Farad supercapacitor for the standlight. The two large exposed contacts on this side are where the power feeds in from the terminal block. (Surprisingly, this doesn't seem to be the source of the problem.)


Attachments:
P1010318.jpg
P1010318.jpg [ 1.14 MiB | Viewed 2727 times ]
Sat Jan 05, 2019 8:26 pm
Profile

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1192
I think we may have one or two fans of the MSP430 here. From what I understand, it's quite a regular machine. As perhaps are the later PICs, but not the earlier ones.


Sat Jan 05, 2019 8:39 pm
Profile

Joined: Wed Jan 02, 2019 4:10 pm
Posts: 14
Well, one replacement tail lamp ordered - and also, at long last, a multimeter and a soldering set, which I've been without for *far* too long.


Sun Jan 06, 2019 12:20 pm
Profile

Joined: Wed Jan 02, 2019 4:10 pm
Posts: 14
DHL has apparently managed to bungle the tracking data on my new tools, so it reads as "out for delivery today" since yesterday, while it's still in Germany and I'm in Finland. Great job handling your core competency, DHL. The replacement light is in a different shipment and is due for delivery tomorrow, though I never know whether it'll turn up in my postbox or require me to go all the way the post office to collect it. The post office, by the way, is 8 miles away and this bicycle is my primary means of transport; I'll definitely need to go there to collect the tools, whenever *they* are delivered, but it'll be easier to make only one trip.

Meanwhile, I've managed to determine a few more things about the (newer) faulty tail lamp. Mostly, it seems to start up and work fine from "cold", when it's been left without power for several days, and it doesn't seem to matter which polarity of power it's given. Since there are two substantial capacitors inside, it's not immediately clear whether one or both of these needs to be sufficiently discharged to reset the device. There doesn't seem to be any real difficulty with getting power into the assembled device, as far as the pads on the PCB, so long as I use the spade connectors instead of bare wires - and so long as I balance some weighty objects on top in lieu of applying replacement glue. Presently I'm using a shot glass and an IKEA adjustable spanner.

However, once the thing turns off via its standlight timer - whether that's due to power being removed entirely, or interpreting a DC input as zero speed - it seems to be a matter of luck as to whether it'll start up again. I presently assume there's an intermediate internal voltage at which the microcontroller doesn't work correctly, but the brownout protection (which this MCU supposedly has) doesn't trigger a proper reset either. It'll be easier to figure this out when I can measure and manipulate the capacitor voltages.

As for the older light, I just assume it's got corroded traces or a bad solder joint somewhere. I should be able to locate the problem(s) with my new multimeter. Not yet sure whether I'll bother fixing it.


Thu Jan 10, 2019 6:37 pm
Profile

Joined: Wed Jan 02, 2019 4:10 pm
Posts: 14
New replacement tail light, subjected to as close a replication of the conditions that make the first one fail as I can easily devise, seems to be reliable. So that gives me a basis to troubleshoot on. I still need to tidy up my wiring, for which my soldering iron will be useful - when it eventually arrives.

Surprisingly, this package was actually delivered to my door. That practically never happens around here! It particularly surprised me as I was still in bed, having emptied and cleared the snow off the postbox ahead of time. But DHL again demonstrated their questionable grasp of their core competency by transcribing each Ä and Ö in my address as AE and OE on the transfer-to-local-deliverer label - they're a German firm, who should be handling diacritics better than that. BTW, that transcription is acceptable in German, but not in Finnish.

My new tools, however, still appear to be lost on their way across the Baltic Sea. I'm not even confident that they'll reach the "local" post office on Monday.


Sat Jan 12, 2019 6:45 pm
Profile

Joined: Wed Jan 02, 2019 4:10 pm
Posts: 14
Now that my tools have finally arrived, I've been able to identify at least two faults in the old tail lamp. One is that the push-button switch to turn it on simply doesn't make circuit - probably corroded internal contacts. The other is that one of the resistors, with a corroded metal plate inexplicably inserted under it, appears to have one of its legs worn or rusted right through. This forms part of the seemingly redundant divider across the programming-voltage pin of the PIC.

The whole thing is covered with a layer of corrosion, which made testing continuity a little tricky. On the upside, the PCB traces all appear to be intact, so there is some hope of eventually resurrecting the thing. Or I could just extract the PIC and try to use it for something else.


Tue Jan 15, 2019 10:23 pm
Profile
User avatar

Joined: Tue Jan 15, 2013 5:43 am
Posts: 180
BigEd wrote:
I think we may have one or two fans of the MSP430 here.
[raises hand excitedly]
Yes, thoroughly charming -- a pleasure to code for (in assembly). Color me smitten. :P

And an interesting thread. Reminds me of some solar-powered garden lights I repaired for my neighbor. They were junk, really, not worth fixing, except they were special to him for some reason. And again it was environmental factors -- and cheap manufacture -- that caused the trouble.

-- Jeff

_________________
http://LaughtonElectronics.com


Tue Jan 22, 2019 3:41 am
Profile WWW

Joined: Mon Aug 14, 2017 8:23 am
Posts: 55
Yes,

I am also a fan of MSP430 - especially assembly. I coded a Tiny Forth-like interpreter into about 900 bytes of assembler. 16 bit architecture and 12 general purpose registers make it a good fit for a Forth virtual machine.

The architecture is very orthogonal with almost all instructions applicable to all addressing modes.

A good guide to the architecture is here http://www.ti.com/sc/data/msp/databook/chp8.pdf

The new parts with ferroelectric RAM are fun to play with.

However the world seems to have been taken over with very low cost, and high spec ARM devices, - leaving the humble 16-bit MSP430 something of an anachronism.

It didn't help that TI failed to have any unified plan to market the device, and apart for a plethora of different devices, and at one time they were first in class for low power, they have rather fallen into obscurity.

There is a soft core MSP430 available for FPGA enthusiasts, which I'm sure could be pushed to well in excess of the original 16MHz clock.



Ken


Tue Jan 22, 2019 1:49 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 13 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software