So I was thinking of making a POV display gadget to decorate my home. As a decorative item, I really didn't like the fact that all POV display designs I found in the internet used batteries.
What about after they run out of juice? Will I actually have to remove my fat ass out of my couch and stop it, take the batteries out or connect a connector to charge it? Most likely it will turn itself off and I'll never bother to turn it on again. Useless!
Well, you get the point. It's a hassle and that's why most of these gadgets eventually end up lying around turned off in a garage/deposit. It's fun for the maker, but I just didn't want my creation to have such a sad end.
So how can we change this? Brushes would work. Hmm... Too noisy, and might fail as well! I wanna go fancier. I wanna defy myself. Let's transfer the power wirelessly!
I made a video (above) showing it working, because I know you want to see it working! Sorry for the camera flicker, this does not appear in reality. That's a feature of the "slow rotation speed" (24.3 Hz). Unfortunately I couldn't make it any faster!
WARNING: I'm a hardcore hobbyist. All electronics are built from raw parts, no Arduino and no import pre-assembled packs. I also like to engineer as much as possible of the thing I'm making, so I'm sorry if this Instructable is not that easy to follow. I'll try my best, though!
Step 1: Understanding How the Wireless Power Transfer Works
So the first thing I wanna make sure works properly is the wireless power transfer system. If I can't make that work, then I'd better forget about it, right? But that won't be necessary, as you'll see. If you're not that much into the engineering nitty-gritty bits, you might as well skip this step.
So this system is basically a transformer. Different from regular transformers, though, this system is ill-coupled. The magnetic flux lines are not well guided through the air and will leak away everywhere. Transformers will have ferromagnetic materials in their cores and all around them to make sure they're not leaky - and moreover, the wires of the primary and secondary are wound over each other. This configuration isn't very effective when you want to spin one of the coils around the other... (But surely, you could design for it if you really wanted!)
So clever people invented the resonant coupled circuits. They allow ill-coupled transformers to transfer power more effectively without radiating away most of it. This happens by the use of a capacitor in either side (primary and secondary). I still wasn't sure when I began this project how that worked, so I kinda wrote a Matlab code to simulate the effect of resonant coupling depending on the coupling coefficient. The first chart shows that the peak power transfer efficiency spikes higher and higher as the coupling coefficient [k] goes higher, but it doesn't need to be remarkably large to achieve efficiencies of ~60%. I still don't understand fully why that works, but for our peasant hobby application that's way more than enough. So let's build our coils and see if that's true.
Step 2: Making the Inductors
The power transfer is better when the inductors' inductances are matched. The easiest way to perform that is to make the same inductor twice. As we need them to resonate, it is always useful to measure their inductances. As I don't possess an LCR meter, I used the method proposed by Mr. Ronald Dekker, described very well over here. It turned out the inductances were not quite very well matched (5.5uH and 6.0uH), but they were enough for my application.
The inductors in the picture are 7 turns of 2.5mm² wire wound over a 75mm PVC pipe. It's important the high frequency resistance of the wire is small, and I know about the skin depth effect - But I simply didn't bother to buy special wire for this, just made it very fat!
I also measured the coupling coefficient between the coils, the results are in the little table besides the picture. The method I used is well described by Mr. Bryce Hesterman at slide 22 of this presentation.
Step 3: Making the Power Transmitter
When analyzing this circuit in the figure (also attached as a non-functional Multisim 14 file), just bear in mind... I don't do electronics professionally. So the solution is probably not optimized neither for cost nor for functionality! But it's what worked for me! So let's take a look at how it works:
An LM566 VCO (Voltage Controlled Oscillator) generates a square wave for me at pin 3. The center frequency defined at my Trimmer Pot (R8) is 187.2 kHz because that's where I found it should resonate. I used a 25-turn 100 ohm trimmer to adjust the frequency very carefully because the resonance of the LC circuit happens in a tight band (+/- 5kHz at most). The center frequency was previously measured with my function generator and the oscilloscope.
The signal from the VCO is not adequate to activate my MOSFET power transistor because it swings from 5 to 12V (darn, I didn't know that!) so I had to use a fast Op Amp (The CD4046 in the figure) as a comparator . Again, another trimmer was placed to make sure the voltage it was comparing it with would give me good switching. The Op Amp output, at pin 6, feeds a power MOSFET (yes I know the IRF630 is too slow but that's all I had in my lab!!). In order to compensate for the slowness (large capacitance) of the IRF630, I used super small resistors (R9 and R10 = 300 Ohms). It worked remarkably well, and I was able to achieve 40% efficiency for the power transfer, which is quite good for such a bodge!
Step 4: Power Receiver and the Actual POV Board
Although receiving power is actually super easy (It's just a regular full-bridge rectifier), the board got quite complicated as I added the PIC uC and the LED drivers. I eventually decided it would be a good investment to buy a professionally made board, as when the device is turned off (we hope it never does!) it would be more aesthetically pleasant!
So I grabbed a couple of months on Eagle and started to design this. I wanted to make THE WORLD - So I used a spherical board design. Actually I'd say here in Brazil it's not that expensive to make a professional board - I paid what converts to $50 for two 2-sided, machined and masked boards. I made two in case I messed up (which fortunately I didn't!).
So how does it work? Well, it's like a power supply: A full bridge rectifier gets the AC waveform and converts it only to positive cycles. Then a large cap makes it DC. A voltage regulator (7805) prevents my PIC from burning and ensures homogeneous light intensity regardless of how many LEDs are turned on at a time.
A PIC16F877A microcontroller will make sure the device knows where it is and light up the LEDs accordingly. There will be an IR receiver phototransistor (A TIL78 that is represented in the schematics as a diode because that's the package it comes) that will receive a signal from an IR LED at the base. This will act as a reference so we always know where we are and "home" the image at each full turn.
The signal from the TIL78 is compared to a voltage signal I will tweak with my trimmer with another CA3130 op-amp. The signal is sent to the RE0 pin of the PIC and on the rising edge we'll trigger the home position.
The schematics and the board design are in this step and in this GitHub link.
Step 5: Mechanical Design
We need something to hold this board and make it spin. Here I used Autodesk Inventor to design everything. I think one could use Fusion to design it. The files are in my GitHub page, as always. These were designed to be laser cut. The base is MDF wood and the cage is clear acrylic. The case has two functions: Prevent your fingers from breaking when the mesmerizing effect urges you to touch it - and also reduces the power loading in the motor (this is indeed a large fan, isn't it?).
The motor used here is a fan motor I got from an old fan. The design is, therefore, useless if you can't find the same motor. But it helps one to understand what I did. The build pictures will help, too.
Eventually I discovered the person that was laser cutting this wouldn't have 8mm acrylic and I changed the cage to 3mm. I then needed to include aluminum angle reinforcements so it wouldn't fall apart.
There's actually not much I can talk about this design, as you would probably have different restrictions / materials.
Step 6: OK, Enough of Designing. Let's Build It!
The building process was very easy given the parts are mostly lasercut. The quick GIFs above give an overview of the building process. Actually, that was hours of fun - Maybe 5-10 hours of fiddling around and getting it wrong/fixing. But that's the fun part, isn't it?
Step 7: Now Let's Build the Spinning Board
The GIF shows the board assembly. Unfortunately, the camera battery died in the middle of the recording (that's how long the build took!), so it's cut in the middle. But you get the point!
I took quite long to build the board, as I didn't actually prototype the circuit beforehand. I just designed it, prototyped parts of it (the power supply, the IR comparator, the LED driver and the PIC clock/ICSP). I wasn't actually sure everything would work, so for each group of components I soldered in, I would test it with my scope. If anything went wrong, I would know it was from the last group of components I added.
The technique turned out to be helpful. I always proceeded steadily, making sure what was soldered actually worked. And two times it didn't - so I debugged it. There actually was a short in the board itself (not my fault ^^). So that's a technique I can recommend!
Step 8: Completed Assembly! Let's Move On?
Ok. This step is here just to show the thing fully assembled. But I loved how it turned out to be!
Step 9: Now Let's Clean Our Hands and Do Some Programming
Ok, now we can actually begin to program the PIC. Or can we? We still need some image to display first, and we need to convert it to something the PIC will read. So I built first this little piece of software in the screenshot above to help me with that task. Code in this GitHub page!
Reviewing the electronic design: We have the LEDs connected to ports A, B, C and D. A total of 24 LEDs, in groups of 6 for each port. The two most significant bits of each port are left not connected, i.e. RA6 and RA7 for PORTA.
But to make things easier, let's make for each group of 6 bits a char (8 bits) and set bits 6 and 7 to 0. This program will then generate an array of 150 chars (pixel columns) for each port. Total of 4 arrays, named in the picture D, C, B and A. It's backwards because the top of the figure corresponds to PORTD.
This program needs, therefore, to resize the image to 150 x 24px (I chose 150 for reasons described below). Then it needs to binarize it (either 1 or 0, because I was lazy and made a binary LED array) according to some rule. In this case, the user can click on the top figure and select a swatch to compare the other colors to. Then the sensitivity bar will make it select colors that are inside some color radius (in the R,G,B space). Inside=1, outside=0. Or the other way around if you click the Invert checkbox.
The array comes out as a string in the textbox below. Now it's just a matter of copying and pasting to the C code shown in the next step.
Step 10: Now the ACTUAL Programming.
Sometimes I find it beautiful how simple the uC software turns out to be after so many hours of programming. I mean, since there are so little resources available, I always find myself spending hours on something that turns out not to have more than 100 lines of code with the comments. That's because we need to keep it as simple as possible - and simple is difficult.
So I'm using the PIC Timer0 interrupt for this. Why? Because this ensures the routine will run at the right time. Otherwise, it might be delayed because processing time is normally large. For example, it takes 25us to set PORTA to PORTD to the values defined. another 2us are spent on an if clause. And that's with the quickest clock available to this uC: 20MHz!
I know, this microcontroller is discontinued by Microchip. But we only have old electronics at our disposal, always at a remarkably high price.
So let's do some quick calculations. I used a function gen attached to an LED to discover what is the rotation speed of my device. It turned out to be 24.3 Hz (1458 rpm!), which is pretty fast and certainly more than enough for the POV effect. If I want to make the sphere 150 pixel columns wide (one full spin=150 pixels) then I need to update the ports of the PIC every 274us. If the PIC were busy processing (because the program is too complex), then it would never be able to update the pixels on time and the image would look wider (less pixels per full rotation). Fortunately that calculation was performed on the design phase, so I didn't need to change anything here!
The interrupt also needs to reset the pixel counter. This is accomplished with the first if clause shown. It detects a rising edge (it will occur only once regardless of the amount of pixels it takes to travel through that copper pipe) in pin RE0 and when it occurs it means the zero/home position was reached. Then it needs to reset the counter. There is also a variable called Last_Pixel_Column_Count that will be used on the main loop to set the interrupt timer (Pixel_Column_Time) correctly to make the software autocorrect for rotation speed variations during operation. But that was implemented on the main loop as it doesn't need to be that frequent as the pixel updating.
Also, it's worth commenting the block of code commented out (setting PORTX to ARROWX[Pixel_Column_Count]). That wasn't possible because MikroC has a program size limit of 2k words for the demo version, which doesn't allow me to add more than one image. Shame I don't have the resources now to purchase a license, this allows me to show only one image in the program. Still working on some free solution here... I actually was intending to cycle between several images!
Well, the rest of the software is just boring PIC config (that itself took >3 hours for me to get right!!). I will skip it to keep the text "short".
Step 11: Enjoy!
Well, the project itself was hours of fun. >100 hours to be more precise. Now it's time to sit down in our couch, plug it in, and never have to worry again about it stopping working!
If you liked this Instructable, please let me know! If you use this idea I'd love to see your project!
Thanks for reading and don't forget to have fun!