Prototyping and software testing

Now that I have the working breakout board for the TLC59282, I was able to get the software working and get it tested pretty quickly. I did have one minor wiring problem that was just due to the way I’ve got my breadboard setup, but after I fixed that, everything worked as I expected. This chip is WAY easier to use than the TLC5940!

In the process of setting up the SPI, I did discover another problem with the boards I had ordered. Turns out the Slave Select line is on the same pin as my IR in for the remote control, but in order for SPI to work correctly, this pin needs to be kept low. So, in order to move the pin, I first looked at my board layout to see if I could move it to a pin closer to the IR and make the layout easier. I read a post (on reddit I think) where someone said they do the planned PCB layout first, before the schematic, so they have a better idea of how to hook things up to make the layout easier. I should have done that, or at least looked for some optimizations, but it’s no big deal. I’ll remember to do that next time as I was able to find some trivial changes to the circuit that made the layout easy. The schematic now looks like this:

New schematic based on changes I discovered while prototyping on the Arduino

New schematic based on changes I discovered while prototyping on the Arduino

I did get everything prototyped out, including the LED controller, hall effect sensor, and IR input. I verified they all worked together, the hall effect sensor worked on the new interrupt pin (which I’m hoping works better than a PCINT I was using on the previous version), and the IR works with everything else running. I also did a bunch of speed tests. I’m able to run the SPI at 8 MHz and wanted to see if that was fast enough to keep up with the spinning board. From the tests I’ve done, it looks like it will be more than enough!

Breadboarded version of the SpinnerHD to test the TLC59282 and make sure everything works like I expect.

Breadboarded version of the SpinnerHD to test the TLC59282 and make sure everything works like I expect.

And here’s the code I used to test the prototype.

Exciting and not so exciting day

Last night a little after 7 pm, I got email from OSH Park that my boards were back from fab and by 9:30, email that my boards had been shipped! Fantastic news since I am hoping to get them before President’s Day so I can populate them on my day off work.

On Thursday, I got the headers I needed to use the breakout boards for the TLC59282. This morning, I finally got a chance to put them on. As it turns out, the headers I ordered aren’t quite what I wanted–they are double sided, so the pins are the same length on each side. They will still work though and were quick and easy to get soldered on:

My breakout board mounted on a breadboard

My breakout board mounted on a breadboard

So finally I can get to prototyping and working on the software. I used the same breadboard I had when using the TLC5940 earlier because it already had a bunch of LEDs on it. Everything was good up until the point where I realized the LEDs were hooked between the chip and VCC, not the chip and GND. Took a quick look at the datasheet and then at my schematic and realized I did wrong. In my schematic, I have the common side all to GND, not VCC. At first I thought I could work around this by cutting the traces to GND and fix them to go to VCC. Then I remembered that I did a GND fill, so I don’t have just one or two traces to cut total and one new wire to VCC, but three traces for each LED and adding new wire hacks (grr–why can’t I remember the real name of these wires right now?) to each LED.

So, in other words, the boards are pretty much DOA. They aren’t completely useless. I’ll still get to use them to test the balance, make sure all the drill holes and everything else was manufactured as expected, and photograph to use as the banner for this blog. I did actually expect that this first board probably would have issues that would make it not work. I was expecting those problems to be manufacturing issues I didn’t know about though, and not my own stupid errors. As I mentioned in a previous entry, I did know I was risking this by ordering the boards by prototyping, but it’s still disappointing.

Now this post does make it sound like I’m pretty rash and impulsive, making many mistakes. Can’t argue with you there. I knew the risks though and it’s not that big of a deal–just another week or two delay. This time I’ll get everything prototyped before I order the next board.

Home Depot

I love Home Depot. It’s great for all my projects. I’ve spend a lot of time lately trying to find a simple toggle switch that can handle up to 5 Amps. I finally found one I liked that’s about $6 a piece and was about to order some, but held off. Then I stopped by Home Depot just to get some PVC to wind an electromagnet around. I figured I’d look through the electronics isle just in case they had a switch. Suddenly, inspiration struck! A cheap switch that can handle at least 5 A? A light switch of course–for only 69 cents!!:

Cheap lightswitch I found at Home Depot that looks like it will meet my needs and pretty cheaply

Cheap lightswitch I found at Home Depot that looks like it will meet my needs and pretty cheaply

Okay, it does say 15A 120 VAC only, but I assume that will also work fine with <12 VDC @ 5 A. I did also pick up a 1/2″ PVC pipe so I could start on my first electromagnet.

My goal was to use 26 AWG wire, 13 turns per layer (to make a coil 1/4″ long) and 10 layers. As it turns out, winding these is rather difficult, especially without a form. I tried to wind it close to the edge of the pipe so I could see if a 1/2″ ball bearing could be picked up by it, but I couldn’t get enough tape on the edge to keep everything from falling apart. So, I decided to wind it further up the pipe so I could use a lot more tape. Without any side pieces to hold the shape, it’s difficult to get each layer of wires to stack on the previous. But I did eventually get approximately 5 layers done:

My first attempt at winding an electromagnet

My first attempt at winding an electromagnet

Figure that’s good enough for now, so I’ll see what it can do. I did a quick test with the meter to find about 1.8 Ohm resistance. Since that’s not going to limit the current much, I didn’t want to try it with a real power supply and instead started with a 9V battery. I got some sparks off it, so I went for a magnetic test. Placed my ball bearing close to it and did see it move! Not far or far, but it did move. I tried putting the ball bearing inside the PVC, as my current goal is to hold it in there. That test failed though. I couldn’t get the ball in the right position at the same time as keeping the the power on to the coil. And, of course, one problem with a PVC pipe is that it’s not transparent, so I can’t see what’s going on inside. One of my next goals is to find something I can see inside of for this… I wish I had been able to wind the coil closer to the end of the pipe so I could try sucking the ball bearing into it. Maybe after I work on my winding technique, I can try that again later.

Missing parts…

The breakout boards I ordered from adafruit arrived today. As soon as I could, I soldered on a TLC29282 so I could breadboard it and start testing it and writing the software for the spinner. Turns out it is kinda difficult to solder at this pitch. Although, I don’t think my soldering iron is working very well either. I accidentally left it on for several days one time and now it feels a little different. As I was testing that I hadn’t left any solder bridges, it suddenly occurred to me that I didn’t have any of the headers I needed to actually use this:

2013-02-04_21-37-20_889

 

So, now it’s a couple more days while I wait for headers to show up in the mail… 🙁