Kook Hacks when the Surf Sucks

Flashlight Replair

Showing the single result

0 thoughts on “Flashlight Replair

    1. Thanks Christian for notes. I have also had a flashlight where the copper pieces that attached to the battery broke apart due to corrosion. I replaced this with a solid copper wire that soldered between the battery and copper spring and it worked well.
      It may not be obvious, but most flashlights have the copper piece soldered to a battery sleeve, not the battery itself. This sleeve can be removed to help with separation with the weld. I have been successful this way when a simple screwdriver method doesn’t work. Let me know how it goes.

      1. Hello Mark, thanks for the info. I managed to clean it all, install new batteries and weld the wires. The problem is finding the replacement bulb. BMW tells me it’s discontinued and even BMW Classic does not sell it anymore. Apparently, it’s replaceable with a LED, but you have to reverse the batteries wiring. Now trying to find out what is the spec of the replacement LED.

      2. Hi Christian, I have found many Incandescent bulb replacements on Amazon. Look for CEC #222 0.56W E10 base models. I’m not surprised BMW doesn’t sell them anymore, But it seems there are many after market vendors . Let me know if you find them? Thanks

      3. Hi Mark, I found a couple of bulbs in the UK, same spec as the old one. Now struggling to get the whole thing rebuilt as the copper piece that is actuated by the ON/OFF switch is difficult to adjust with precision. Easy to have it ON all the time or OFF all the time. Just hard to get the proper angle.

  1. Thanks for the great info. The linear and rotary sensors seem to only be available in development kits and evaluation boards on, any part numbers or other sites you can share regarding sources for the bare bones sensor rather than one integrated into some sort of package?
    Thanks in advance

    1. Hi Steve, thanks for the comment. This link on will allow you to download a PCB based linear or rotary sensor design and use with the LX3302AQPW-EASY IC (i.e. just the PCB sensor with an IC). Is this what you mean by bare-bones? These inductive position sensors use PCB traces to detect the movement of a metal target. Let me know if you have any questions or how I can help. Full disclosure: I also work at Microchip (on my About Page) and manage these products, so if you need a LX3302A datasheet let me know.

  2. Mark
    Can I pay you to fix both my rechargeable Flashlights? If so I will give yoiu my email adrress for info.
    Thanks Mike

    1. Hi Mike,
      Thanks for the request about the flashlight repair. Yes we can repair your BMW flashlights for you and upgrade them so they won’t need to be repaired in 5 years! Please check out our rechargeable flashflight repair service in our Kiosk page. If you have any questions about the service with regards to your needs, you can email me at

      Happy Holidays,


  3. Thx 4 this. Unfortunately I get an “IndentationError” on line 16 of the py-Script (the first “try”) and can not get rid of it.
    Any clue?

    1. Python is picky about mixing tabs versus spaces as indentation in a file . Check to see that you are using the same type of indentation for each line. I try to use spaces only on my scripts. Let me know if that was the case?

      1. Well, I copied and pasted your script. And I am pretty sure that I already tried to delete all blanks and retyped spaces. Will give it another try anyway…btw.: I have no clue about Python…

      2. Hi Falk,

        I updated the code indentations in the blog to match what I’m using on one of my machines. See if you have better luck with this version. Sorry for the trouble. For some reason the indentations on the blog code were incorrect. WordPress changed its editor a year or so ago and this may have had an impact. Probably my mistake. Let me know if you have better luck. Thanks for letting me know. Mark

      3. Thank you. Unfortunately it seems as if the blog is presented totally different to me.
        On my side, there are no indentations at all, besides that the bb-code does not seem to work (the code is not displayed as code).
        Wish I could show it to you…
        Nevertheless I figured out how to run that script (even if I am still not sure if the cronjob is running…). There were some more issues than “just” the indentations. I also had to replace all ” and ‘ – and I was very confused that the interpreter also looks at the comment- lines (it does not like “doesn’t” i.e.)
        Last thing to sort out is the question if the cronjob is actually running…

      4. #!/usr/bin/python
        import datetime
        import time
        import subprocess
        import pickle

        filename = "wifi_monitorlog.txt"
        datafile = "wifi_monitordata.txt"
        x = 0
        CantFindWifi = False

        if __name__ == "__main__":

        # we need to load the datafile.
        # while True:
        with open(datafile,'r') as f:
        timequeue = pickle.load(f)
        except :
        print("the datafile was not found. initializing variables")
        timequeue =[datetime.datetime(1,1,1),datetime.datetime(1,1,1),datetime.datetime(1,1,1)]

        # check 20 times every 1s for the wifi in case it can't find it.
        CantFindWifi = True
        for x in range (1,20):
        print "try ",x
        if ('ping -c4',stdout=None,stderr=None, shell=True)) == 0:
        CantFindWifi = False

        if (CantFindWifi):
        timenow =
        if (timenow - timequeue[0]) > datetime.timedelta(minutes=60):
        sout = "wifi is not working -- Rebooting: " + timenow.strftime('%a, %d %b, %Y, %I:%M:%S %p') + "\n"
        with open(filename,'a') as f:
        # We need to save datafile here because we are rebooting
        with open(datafile,'w') as f:
        pickle.dump(timequeue,f)'sudo reboot',shell = True)
        sout = "wifi is not working -- Not Rebooting: " + timenow.strftime('%a, %d %b, %Y, %I:%M:%S %p') + "\n"
        with open(filename,'a') as f:
        print("wifi is working")

        # this datafile save occurs when we don't reboot.
        with open(datafile,'w') as f:

      5. Hi Falk,
        I reformatted the BLOG post so the code NOW shows the proper indentation. Thanks for bringing this to my attention. I have confirmed it looks OK in my browser.

  4. Awesome post – thank you so much. My E36 license plate lights were both out…first one then the other. Car failed the annual state inspection and shop would have charged a fortune for this repair. They wanted $40 just to replace the bulbs, which were not bad. So, I opened the wiring harness at the exact point you noted in the photo and found the ground and one hot wire broken. Simply spliced them back together and both plate lights are working. Again, thank you so much for this post. You saved me a ton of money!

  5. Hey Mark,
    looks great now. Thank you for all the work.
    I added a line to write another logfile to make sure that the script (and the cron job) is running. Until now it seems to work as it should.
    Without this blog I surely would have given up long before any result. So, thank you again for this blog!

  6. This little power supply is great. I have noticed the mosfet gets very hot when running from 5v and drawing 12mA on the output, anyone else have this issue?

    1. At this current the MOSFETS should not be hot. The largest loss is the main inductor. Many things may cause this, but try to compare your images with the images in the POST if you can. Otherwise, double check all your component placements with the layout. With the tight layout, the component placements are have been confused with a few readers. Kicad can zoom into each component. Good luck.

  7. I did a simple line in hack where i tapped in to the tape feed years ago, had to use a blank tape or input adapter, but it had to be one where the reels were connected or it would ‘tape error’. I guess it’s some kind of tangle protection, but could still play tapes. Now the rubber band in the tape player snapped and I get “tape error” no matter what :(. Tried removing the springs and leaving the switch open, but no cigar. Any ideas short of repairing the tape deck?

      1. Thanks for the reply. Might be one of the differences between the C33 and C43. I ended up using a simple large, thin, rubber band, which is working fine, and ordered a cassette tape deck drive belt assortment for when that gives out. I wasn’t able to find a diagram, but the belt path for these tape mechanisms happens to be shown in the below instructable, for anyone interested:

  8. It’s been a few years since I read about this project and I remembered it after an comment notification. Last year I built a flyback-based design to compare it against a boost, and the results were pretty favorable. 85-90% efficiency is possible over a wide load range at 5 V input, up to 30 mA output.

    I wrote a summary at and the original Hackday project is at

    1. Thanks James for the links and comments. I do agree. One of the key benefits of the boost converter in this analysis is the simplicity of finding the parts and not having to design the magnetics (i.e. the flyback transformer). I like magnetic design, but maybe not for everyone. 🙂 And with good design and parts, you can get good efficiency with the boost converter. Comparatively, in my analysis, I also believe that flyback converters can get you higher efficiency. The inductor magnetic and FET conduction losses are higher for boost converters, even with the optimization that is done in this post.

  9. Excellent! I am particularly interested in the water level feature as I have tried to add this to my machine in the past with limited success. I used a VL6180X time of flight sensor and an arduino which worked well on the bench but I never completed it. I’m interested in your approach which I need to read through more thoroughly. Do you think your sensor would work with an Arduino?

    1. Hi Kevin,
      Yes the sensor (LX3302A) can work with an Arduino. The outputs format of the LX3302A can be analog (0-5v), PWM, or a digital SENT protocol. SENT would need a bit bang GPIO coding the PWM should be straight forward. Let me if that makes sense or if you have any questions.

      1. HI Kevin Again,
        Also stay tuned as I’ll put a blog entry for a step by step approach to adding the water sensor to an espresso Maker. While I’ll focus on the Rancilio, I’m sure it could work for any water tank. If you are interested, I put a blog together of how to read the SENT protocol for the Raspberry Pi, however, the same principal can apply to the Arduino.

        Here is the link to the SENT blog:

    2. Did you use a floating target for the VL6180X? I tried ToF sensors for a sump pump controller project, and ended up with ultrasonics. Without a floating target, it was too unreliable.

      1. Ryan, I tried an ultrasonic one but there was a problem with it – not good with really close distances as in the reservoir the water would almost be up to the level of the sensor. The float was the thing that killed it for me. The ToF was super accurate for the range I needed but I struggled to find a suitable float and then it was consigned to the unfinished projects drawer! I still have a need for it – running out of water mid shot still happens sometimes.

      2. I also thought about an ultrasonic sensor that would attach to the top water cover, but then it would have to have power/comm wires which to me were not convenient. The water sensor I ended up with and in the blog slips on to the side of the tank with no modifications to the tank, all the wires are on the side of the tank and the top is free. In the blog, I included the TinkerCad Link to the sensor 3d design (with tank side wall) for easy visualization. I still am using some blue tape to keep the sensor snub against the wall of the tank, but I believe I can improve that shortly. I’ll focus on the details in the next blog. Any thoughts? thanks, Mark

%d bloggers like this: