Converting a Magnifying Desk Lamp’s Donut Fluorescent to LED Strip – Part II

Well, I completed the project last night. Here is what I did…

First, I measured the current draw of the LED strip from the PSU. It was 1.45A max. I found a 12V 2A wall wart laying around (trusting it would actually provide 2A), and it fit perfectly in the space at the bottom of the lamp (where the ballast transformer was). I removed the plastic case of the adapter, soldered the power input and output cables (also stabilized them with black hot glue), and used the bottom half of its case for insulation.

LED12

The surgery on the 12V 2A wall wart adapter went well.

LED13

I used the bottom half of the wall wart adapter for insulation.

After screwing the cover plate of the bottom part back into its place, it was time to make another LED driver card. I had made one of these for a sculptor friend, who is going to use it for one of his lamps. So the firmware and the PCB was ready, all I needed to do was to print the PCB on a piece of PNP paper, laminate it on a 50 mm x 100 mm copper clad, etch it, and solder the components on. The whole process of making this card took me about an hour and a half.

LED11

As I stated on a previous post, the laminator does a great job with these PNPs.

LED14

2 nice PCBs at once. 50 mm x 50 mm each.

LED15

Program the PIC 16F88, and all is set.

My friend, who wanted this LED driver built for him, needed to control the brightness of the LEDs with an optical quadrature encoder in his project (well, he actually said: “no turn limits, very little friction, high resolution”). So the PIC counts the pulses, checks the direction, and feeds it to the PWM DC registers. No look-up tables, no gray code, simple and functional. Works with both mechanical and optical encoders. The only difference is, the mechanical encoders’ A and B pins can’t be reversed, optical ones don’t care. They only need the extra power pin on the board. The mechanical encoder I use in this project is 24 P/R, the optical one I used for his project is 400 P/R. Here’s the schematic, and the PCB shot. Schematic and PCB files are in Proteus Isis & Ares format, but there’s also a PCB print in PSD format. The PIC was programmed in Hitech PIC C. The code is rather simple and efficient. All can be downloaded from here.

CircLED_SCH CircLED_PCB

The circuit is simple. 12V DC is fed to the LEDs through an N-MOSFET, which is PWM driven by the PIC. The plastic box is an efficient, 5V, switching DC/DC converter, which requires no external components. You could use a 7805 with the necessary capacitors if you chose. The N-MOSFET IRF530 can drive 100V at 14A, continuously. A bit of an overkill, but good for future uses. The firmware limits the DC (duty cycle) of the PWM to 98%, since the N-MOSFET heats up badly (there is a technical explanation for this, but I don’t know what it is) at 100%. The LED on the card is on whenever the min (0%) or the max (98%) value is reached. The PWM frequency is 980Hz, and the DC is adjusted by loading the number of encoder pulses from 0 to 250 (250 is 98% and 255 is 100%) to CCPR1L. Since it would take the mechanical encoder 250 / 24 = 10.42 turns to sweep the whole range, I multiplied the counter with 10, to be able to cover the whole range with 25 pulses (one pulse more than a whole turn). This was no problem with the 400 P/R optical encoder, since 62.5% of a turn (250 / 400) was covering the whole range. It took me a while to be able to fit the card in the space at the head of the lamp. I had to remove a terminal block which was actually unnecessary. I also added two 100 nF capacitors from the A and B pins, which are on the side of the mechanical encoder, to the center GND pin of the encoder for debouncing.

LED18

I had to push the card under the lamp to open up room for the rotary encoder.

LED31

The two 100 nF capacitors for debouncing.

As I was thinking about drilling a hole in the head of the lamp for the quadrature encoder, I realized could actually use the hole for the starter of the old fluorescent lamp. But there was a problem. The hole was too deep for the length of the knob on the encoder. So I turned a  25 mm long aluminum cylinder with 20 mm diameter (good for the 22 mm hole), and drilled a 6 mm hole 12 mm deep (encoder shaft length) at its center. I also cut a grove around the end, and sanded the edges for a better finish. Later on I drilled and tapped a hole on the side for a M4 setscrew. I was actually proud of this last part. It looks really good IMO.

LED16

Mechanical encoder with the new knob on. The smaller original knob is on the right.

LED17

The encoder was stabilized using black hot glue (gunk).

LED24

More detail on the knob.

LED22

Click click!

After stabilizing the card in its place, and making the necessary connections with the cables, I screwed the plastic cover back in its place, and finished this project / hack. Here are some extra shots of the lamp and other details.

LED19

The blue LED is on when min and max DC values are reached.

LED23

From another angle.

LED25

All covers closed, ready to go :)

I also made a rather affordable MIDI Thru box for my music setup in the meantime. I will be writing about it in my next post.

UPDATE:

I decided to put the status LED outside for better visibility. Since I didn’t turn off the lamp (what a noob!) as I was unscrewing the cables, I shorted the PSU, and fried it. I mounted the LED in a hole by the knob anyway. The fuse was blown, so I went and got another 0.5A glass fuse. But when I came back, I realized I had fried the IC as well. So I went and got another PSU, 12V 5A (3A was the same size) this time. The case looked bigger than what the space at the bottom of the lamp could handle. Yet, when I opened it, I realized I could saw off an ample part of the PCB, since the traces were straight, thick, and long towards the right. And I didn’t need the 220V socket. So I did that, soldered and gunked the cables back in their places and closed case cover.

LED35

The PSU, after about 20mm from the right part of the PCB was cut off.

LED34

A perfect fit 🙂 I put a piece of cardboard at the bottom for insulation.

LED33

Status LED on when DC = 0%

LED32

Status LED on when DC = 98%

Ok, now I can use my lamp…

Converting a Magnifying Desk Lamp’s Donut Fluorescent to LED Strip – Part I

I’ve had a magnifying desk lamp for years, of which starter plug, and donut fluorescent lamp had died last year. I wanted to replace the lamp with a LED block made for this purpose, but I could not find one anywhere here. So, I decided to make my own. I had a 3m 12V white LED strip (50 x 3 LED strips, merged together) in stock from another project, which I could use for this hack. The lamp had an ID of 150 mm and an OD of 207 mm. All I needed was a circular cardboard piece of the same size, so I could stick the LEDs on it.

Then I had an idea! Why not wrap the LED strip around the old fluorescent lamp? I made some calculations, and realized the LED strip was the perfect size. The diameter of the fluorescent lamp was about 180 mm at the center of the cylinder (28.5 mm thick) forming the donut. So the circumference was about 565 mm. Each 3 LED section of the strip (10 mm wide) perfectly covered one turn around the cylinder. So I needed roughly 565 / 10 = 56 of these 3 LED sections. I had 50 all together, which  was enough 🙂

I started with disassembling the desk lamp, removing the fluorescent lamp and the ballast transformer at the base. I decided to keep the already mounted cables and the switch.

LED03

After unscrewing a couple of screws, the bare-bones of the lamp was ready for the hack.

The plastic part of the fluorescent lamp and the piece holding the starter were crumbling to pieces, probably due to heavy UV exposure from the lamp over time. I replaced the plastic part of the fluorescent lamp with duct tape, and started winding the LED strip around the donut.

LED01

It took me a while to nicely wrap the adhesive backed LED strip around the donut lamp.

LED02

Quarter way through.

LED04

And here’s a nice donut LED lamp with spiraling LEDs all over.

I stabilized the final winding with duct tape as well 🙂 Next, I inserted the leads of the LED strip to the terminal block in the lamp’s head, and and placed the lamp in its grove. Finally I placed the huge magnifier in its place, and screwed the transparent lid back in its place.

LED05

Looking good :)

LED10

Here’s the final assembly. Still needs a LED driver, and a part to stabilize the PSU.

I used a 12V 5A switching power supply for this lamp. I still don’t know the current draw (should be about 1500 mA), and I’ll measure it tonight. Eventually, I may get a smaller PSU, so I can fit it better where the ballast transformer was. I also made a simple PWM driver with an N-MOSFET, for driving high powere LEDs. I’ll also use it with this lamp for adjustable lighting. All will be explained in the next part.

Here are some shots of the lamp while it’s on. Although it’s hard to tell from the pictures, I’m rather pleased with the amount of light the LED strip puts out.

LED09 LED08 LED07 LED06

See you in the next part 🙂

Press-n-Peel Blue Transfer Film and a Laminator

If you have been using a clothes iron for transferring your Press-n-Peel Blue (or any photo paper, etc.) like I have, throw it away (or give it back to your wife / mom), and get a laminator. All my life was a lie! I never managed to get such perfect transfers with a clothes iron, this is a miracle! I didn’t need to hack the laminator for more heat or more space for the board. The 1.6mm copper clad went through the rollers just fine. I fed it about 10 times (just to make sure) to the machine from different sides and edges,  while it was at its hottest setting.

Transfers

I got this laminator for about $30. Well worth it!

Close Up

No retouch necessary this time :)

I have neglected this blog for a long time. Been dealing with multiple projects, and a divorce. Now I feel reborn. More to come soon…

New Optimum S 122 G Bandsaw and a Hack

I recently got a bandsaw, to be able to cut stock for general use and big steel square tubings for the future DIY lathe stand quickly. So, I got an Optimum S 122 G (which was within my price / performance range). I’m not even going to start about the problems I had while buying it (welcome to Turkey, where no one gives a shit about customers post-sale).

Optimum S 122 G

This one looked suitable for my needs.

This video had all the help I needed to be able to align the saw blade. Ghostses even kindly responded my question in detail. Yet, something was wrong, and I couldn’t get decent cuts for the life of me.

At the end of each cut, I kept finding the one side of the blade making an angle from the stock, while the other side was square (and when on rest, the blade was dead square to the vise, I used parallel bars and an angle ruler). I kept getting cuts with a vertical angle, with more material at the bottom.

Crooked Blade

This was always what I had. One side of the blade at angle.

10mm Silver Steel

10mm silver steel after a bad cut.

I soon realized that, when I pushed the main saw part when it was all the way down, the hinge shaft was actually moving about 1mm up and right in one of its holes (also moving the blade away from stock). All was good when it was all the way up, due to weight on that part pushing the shaft down. Right after that, I still wanted to try and cut some 60 mm x 60 mm box tubing with 3mm wall thickness for the lathe stand, and I broke the blade, probably due to excess speed. I left the shop for a while not to stress anymore over it.

So, I came back after an hour or so and disassembled the saw to be able to reach the angle plate on the saw stand with no fear, since dealing with machines is easier than dealing with shifty sellers here.

Saw Hung

I hung up the main body where my punching bag used to be, since my back (thanks to lumbar disc herniation) can no longer handle such weights. Gone are the days when I could lift 50kg boxes.

Saw Wheels

A closer look at the main wheel assembly.

I drilled and tapped M6 screw holes in both base plates of the hinge right above the gap (piece of cake on this cheap cast iron), screwed in cone point setscrews (better angular pressure for what I needed) and stabilized them with non-permanent Loctite clone. The resulting motion was very smooth.

5mm Drill Hole

Drilling this porous cast iron was very easy with the good quality bits I recently got.

Tapping Second Hole

Using the milling machine as a guide for the tap wrench. The angle looks wrong, but it’s due to lens curve.

Tapping End Close

The cast iron was so soft, it was a piece of cake to tap it with this HSS tap. Looks crooked again. See how the hole looks warped? Also see how they failed to center the drill at first attempt…

Tap SS Hole

The resulting hole was rather nice and functional.

SS Clean Stick

I first cleaned the holes from grease with brake pad cleaner, then applied Loctite clone to stabilize the setscrews.

Setscrew In

Testing the first hole with a longer cone point setscrew.

Setscrews Shaft

I left it to cure overnight, after wiping off the excess.

Eventually, I ordered two 14 TPI blades and one 24 TPI blade yesterday. The saw will be sitting in the shop until I receive them. Projects on pause as well. I also removed, cleaned,  and re-mounted the lathe chuck. The runout is now down to 0.01 mm.

New Optimum D250x550 Lathe

I finally got a lathe! I have been wanting to get one for so many years, but I got a milling machine first, also useful as a drill press. They didn’t have a DC Vario in stock. I wanted it because it had a pot + pwm driven 1.1kW universal motor on it (I was doubting its power though), later on I realized ac induction motors have a higher power factor (and no brushes!), and this 750W motor is really powerful. I can always get an even more powerful AC motor for real cheap, too. Although I’ve got some amateur workshop experience, I’m a noob when it comes to the lathe. I’ve read a bunch on it in the past, and watched many videos, but practice is something else. Here’s a video of my first cuts on 6013 aluminium and silver steel (1.2210), using 10mm brazed carbide tools. The tail stock still needs to be aligned (sideways done perfectly… now the height… but it’s 0.125 mm high?), the chuck is also 0.06 mm off. The video has the necessary explanations in the comments section. No, I can neither find, nor afford a true German, American, Japanese, or British lathe.

Lathe Bench

I need a lathe stand!

Here’s how I measured the chuck and the tailstock alignment, individually and in sync. They were at (negative) max at the same spot (I can’t guarantee that the regular indicator was right above the center, but the chuck’s runout last a bit longer, probably due to indicator sensitivity difference?), which tells me the chuck’s runout adds to the tailstock’s. When the chuck is lowest, the tailstock’s dead center is highest. So the chuck is 0.06 mm off, and the tailstock is actually 0.065 mm off. I need to go down to 0.01 mm!

before_the_test_both

Both indicators are reset when the DTI’s  (we call it a run out indicator in Turkish, the other one is just an indicator) body is pointing up.

Both indicators are at max.

Both indicators are at (negative) max. Zoom in for the mirror.

Induction Hardened

Even though this a German lathe made in China, this makes me feel better about it. Smaller models don’t have this.

I’ve been working on (and off) a mini table saw and an arcade console in the past couple of months, but mostly being lazy. I’ve also been lazy with the blog, but the projects are coming soon. I need to cleanup the workshop first. I also started stocking up some metal for future projects. Here are some 6013 aluminium, silver steel, and regular steel (the 2mm bunch. I thought ordered 1m and got 1kg. It was my mistake, the price was so good) rods and a package of brass,  7075 aluminium, and polyamide rods and bars from my friend Murat in İzmir.

Metal Stock

More on the way 😉 Find the cup holder…

Some parts I turned later on for a test. The 5.98 mm stainless steel rod slides smoothly, without much play in the aluminium part, drilled and reamed to 6.00 mm (not sure,  can’t measure correctly). The 6.00 mm shaft I made from silver steel is a tight fit for this hole.

Parts 2

A sliding fit.

parts 1

A tight fit.

I also got a sine vise last month. It’s my little treasure 🙂

Sine Vise

Finally I can cut angles. 0.005 mm tolerance in 100mm.

ind_cal_sin_vis

Sine vise, new digital caliper with ABS function, and a cheap DTI from China.

Update: As these two sources indicate, it’s ok for the tailstock to be 2-3 thousandths (damn imperial) high above the headstock’s center, which is 0.0508 – 0.0762 mm. They make them that way,  so it levels itself when its bottom wears off over time, or the weight of the workpiece pulls it down a bit. There’s also some discussion about indicator sagging due to weight.

http://www.chaski.org/homemachinist/viewtopic.php?f=42&t=92343

http://benchrest.com/showthread.php?73131-Tail-Stock-Too-High

Here are some pictures from the recent projects…

Full Plate Belts

A 90 mm x 6 mm breakthrough slot for the circular blade, and a 6 mm deep full t-slot (neck is 10 mm, t is 14 mm wide) for the protractor guide.

Wood Nut

Wood nuts used on 10 mm plywood for mounting the metal brackets to the arcade console.

And here’s the stand I designed for the lathe. Lathe model is taken from the 3D Warehouse and stretched to fit.

Lathe Stand

I don’t have enough sheet metal to cover the whole thing. So the list covers only what I got.

Pulseview

Last week, I returned from a 12 day survey, which was at Black Sea. And I’ve also been working on a board for work recently.  Since we have a 50Mhz 2-channel oscilloscope with 16-channel logic analyzer on the boat, it was pretty fun to work on the board there.

rovconstest4

On the boat. Running Python test code on PyCharm, as the scope shows me the zeros and ones.

But eventually I came back home, and all I have is a 25Mhz 2-channel oscilloscope and a USBee AX Pro clone logic analyzer from China. The LA works good with the original software, but it’s Windoze only, and it’s not very stable. So I found Pulseview.

I’m not going to show you how to install it on your box, since you can find the instructions for every OS here. All I needed was libsigrok, libsigrokdecode, and pulseview, so I installed them from the git repos. It’s an awesome program, but I wish it would let me save screenshots of the visuals (scrot is good enough for now), and also let me save the setup for later use (there’s a save session option and it works without loading the decoders, yet I can’t reaccess the device after opening the saved session). It sucks to setup and rename every channel, and decoder every time. Anyway, here are two screenshots.

UART

57600 bps UART

I2C

1.7MHz I2C