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

    1. Hi Kevin, I know what you mean about forgetting to fill the tank. Also thanks for the question . I’m getting close but it is in the works. I’m working on a small revision to extend range with improve accuracy. My goal is to get done before Christmas. I’m building another machine for my Parents to use and will get this upgrade tested. Let me know if you have any key questions in the mean time. Sorry it is taking a little longer. I blame it on mission creep. :).

  10. Thank you Mark! I was wondering how this was going just this week. I shall enjoy reading it and maybe I’ll even get a chance to make it. Did you send it to Hackaday?

    1. Yes, we can accept units already unassembled. Please just make a note on the order notes. If there is any issues when we receive the parts we will let you know. Thanks Mark

  11. Hi there,

    1) first of all thanks for the article .. its pretty good

    2)I have an ipad and I have misplaced its charger .. now the thing is I am able to charge my ipad using a third party charger but its charging very slowly (i think its getting charged at 5v 1 amps @ 5 amps).. i want to charge it fast .. if i get it to charge at 10 watts my problem will be solved .. i am having a charger which is 5v 2 amps..

    3) I have a question regarding resistors .. you havent specified the resistor wattage .. i have all quarter watt resistors .. in the pic your resistors are looking big(most likely they are of high wattage) .. could you please help me with this info .. what all resistors do i need(please specify wattage) ..


  12. Interesting, the E36 is already equiped with a ‘relief relay’ that cuts out power after 15 minutes.

    1. Hi Don, I have seen the relief timer work for cabin lights , But this relief timer does not apply to the trunk light. As a result my battery was slowly draining over time.

  13. Hi Mark!

    I really love your work but got a simple question.

    Why is output voltage of your circuit is 160V-170V? Many other articles says the Minimum voltage to drive nixies is 170V so they recommend more then 180V for stable striking. Is it possible to drive nixies like IN-8 with only 160V-170V supply voltage?

  14. Hello,
    I am using LX3302A 90 degree Dual Rotary EVB kit and deploying LXM9518 programmer. In IPCE(Integrated programming and Calibration Environment) I am able to see SENT, RAW Cos and RAW Sin. My question is What is being SENT over the SENT protocol. Whcih value it is ?
    Thanks in advance

    1. HI,

      The details of how the LX3302A uses the SENT channel is located in the LX3302A datasheet which can be received by asking for it from Please see instructions on this page for getting the datasheet:

      In short, the LX3302A has many different SENT data formats. In the blog on the water sensor, (, I use the LX3302A SENT protocol (SENTFCM= 0100) where both the position and the oscillator amplitude are transmitted over the channel each SENT frame.

    1. Hi Nathan, The service includes ensuring all internal parts are in order, removal of rust, new batteries, a longer lifetime circuit and a new incandescent bulb. This Bulb can be easily replaced with the appropriate LED bulb, but it is not part of the service. Thanks Mark

  15. Hi!
    I was wondering whether I can safely pull N_ENABLE low using a 3v3-tolerant pin of an ESP? N_ENABLE seems to be connected to 5V.

    Thank you

    1. Hi Seb,

      Thank you for the question. The N_ENABLE pin is safe and can be pulled low by the ESP. The N_ENABLE pin is not connected to 5v, but is connected to the base of an NPN transistor (Q26) through a 1k resistor. The 100k resistor you see attached between the base of the Q26 and 5v will ensure that the nixie supply turns off when N_ENABLE is not connected. Due to the configuration, the highest voltage that will be seen at the N_ENABLE pin when unconnected is 0.7v (the Vbe of Q26). The best way to interface is to configure the ESP GPIO as an open drain output and then pull N_ENABLE low when you want to turn on the supply. You can configure the ESP GPIO as a push pull output, but then when the GPIO is high=3.3v (i.e. the nixie power supply is off), the current output from the ESP will be 3.3v-0.7v/1k = 2.6mA. The ESP will not have any issue driving this, but it won’t be the lowest current configuration. Let me know if you have any other questions.



A note to our visitors

This website has updated its privacy policy in compliance with changes to European Union data protection law, for all members globally. We’ve also updated our Privacy Policy to give you more information about your rights and responsibilities with respect to your privacy and personal information. Please read this to review the updates about which cookies we use and what information we collect on our site. By continuing to use this site, you are agreeing to our updated privacy policy.

%d bloggers like this: