Wednesday, November 28, 2012

Cat Toy (PIC12F1840)

I decided to revisit the 'Cat Ball' after I found the original board in my project box. It looked like I had cannibalized the board for parts, so it was definitely not working. And the perf board was actually broken in half. Oops.

So - instead of a 'Cat Ball', we will just call it a 'Cat Toy'. It has a PIC12F1840 at the heart, a piezo speaker to play sounds / music, two LEDs (green and red) for color, and a vibrating motor I scrounged from an old cell phone.

As always, here's the schematic:

And a few pictures:

Crowded! There's a lot on this little board.

The ugly underbelly. I was more concerned with fast than pretty.

And a short movie:


Tuesday, November 27, 2012

Chinese Meteor Lights (UCS1212, 30 Multi-Color LEDs)

Another trip to Uno (a local discount store), another meteor light find. This one is a large tube with only 30 LEDs - 3 LEDs per bank vs. 4 LEDs, only 10 banks vs. 12 banks - but they are multi-colored (red, green and blue) instead of either just all white or all blue. It still uses the UCS1212 IC in the design, but done just a _little_ bit differently. And it's a little cheaper than the larger, 48 LED tube (p189 vs p219 - p30 difference which is about US$0.75). Here's the schematic:

And here's a direct link to the UCS1212 Datasheet (PDF) - be forewarned, it's in Chinese.

Saturday, November 24, 2012

17 LED Light Bar (PIC12F1840)

UPDATE 12.1127:
I updated the schematic - removed the PINK LEDs, as they are doing some weird leakage nonsense. So they are replaced with another two RED LEDs. I also changed the way that the POWER LED is handled. And I updated the amplifier circuit for use with a 1" speaker instead of an actual microphone.

Another project I just wanted to put up in a post before it gets lost. It's a 17 LED Light Bar, approximately 81cm long, meant to be mounted about the Flat Panel TV set. It does patterns like the other LED projects I do, but also a 'Music Mode' so it acts like a colorful 'equalizer' bar. I am building it for my father-in-law for Christmas, so he can have some 'bling' when doing Karaoke.

Still working on the microphone preamp circuit. I'm a software guy who also knows digital hardware, but this analog stuff will be the death of me yet.

Front side - 81cm long, 17 LEDs

Back side - holes cut in the back to make room for the larger components (caps).

Close view of all of the good stuff sticking out of the back.

Tuesday, November 20, 2012

Iron Man Chest Arc Reactor (PIC12F1840) V3.00

I decided to rework the Iron Man Chest Arc Reactor - it is now at version 3.0. I reworked the old hardware for the 2N4403/2N4401 transistor scheme, which gives me 8 individually controlled LEDs instead of 4. So instead of 4 groups of 4 LEDs, there is now 2 groups of 8 LEDs.

Ugly backside of the board before the rework.

Ugly frontside of the board before rework.
Too many components, especially 1K ohm resistors.

Removing the old wiring.

Wiring removed, now removing the extra components.

All components removed, except the PIC, ICSP header and the LEDs.

Rewiring the LEDs. MUCH nicer.

Rewiring the ISP header.
I have wired up so many of these, I could do it in my sleep.

The finished new version 3.0 Chest Arc Reactor.

Short demo movie below the fold...

Sunday, November 18, 2012

17 LED Picture Frame (PIC12F1840)

UPDATE 12.1119:
I strong-armed the frame into a 'music mode'. Video below the fold (at the bottom of this post).
Here's a project that I have just started working on - a picture frame with 17 LEDs around the edge. 16 LEDs are controllable in pairs, 1 LED is a power indicator. There is also a push button at the bottom edge of the frame to change the light patterns that are displayed.

It's just another derivative of the Dual Die project. But the implementation is what is cool. I may try to figure out how to turn on the frame / select patterns using noise detection - a clap or whistle - but that involves microphones and op amps. I don't have enough of either of those.

I need to finish the prototype (pictured below) and get the code settled quickly. I need to make 8 of these (yes, EIGHT) for Christmas presents for the girls in the family.

In the prototype, I drilled through the entire frame to install the LEDs - that was before I realized the white part of the frame is actually an insert. So - the next frames will have LEDs installed UNDER the inserts, so you won't see them until they light up. The only hole in the insert will be in the bottom one, for the push button switch.

I'm hoping to power these from either a +9V battery (I have lots of +9V battery clips) or a 4 'AA' battery pack, but I don't have any 4 cell holders and I don't know where to get them.

More as I progress...

Video below the fold...

Saturday, November 17, 2012

Another Chinese Meteor Light - 8-Pin Micro, 18 LEDs

UPDATE 12.1221:
Major update! It _is_ a PIC or PIC-like micro. See the new post HERE.
UPDATE 12.1127:
I updated the schematic to reflect that is is, in fact, some kind of specialty IC and not a micro. I can't tell you what part it is because the markings on the top of the chip have been obliterated.

UPDATE 12.1117:
I removed their 'micro' and wired in a PIC12F1840. And - I can't get individual lights to turn on by themselves. If you look at the truth table, when you set the GPIOs to turn on one LED, you also set up for turning on up to three others. They must have a special part that disconnects the circuit path for the other LEDs so they can get only one light on at a time. Damn.


I just thought I'd throw this up here, since I have spent a few hours this afternoon reverse-engineering the design.

Only an 8-pin micro part. I'm assuming a PIC12F629 or something with a similar pin out (NOTE: WRONG ASSUMPTION). They are only using 5 GPIO pins to individually drive 18 LEDs. And from what I have figured out, they could drive 20 LEDs.

Interesting that they are using only one resistor - between the VCC and the micro. I guess to limit the amount of current the total design will draw.

Here's the schematic - enjoy!

NOTE: On my schematic, I assume it's something similar to an 8-pin PIC. NOT SO. It appears to be a specialty part.

Friday, November 16, 2012

How NOT To Fix A Microwave

The membrane keypad on our microwave oven went on the fritz. It turns out that corrosion - that nasty gremlin that lurks everywhere in the Philippines - took out some of the connection fingers on the membrane. Can't solder to fix it, because it's printed conductive ink on plastic and tends to melt before you can do anything else with the soldering iron. And if you do manage, somehow, to get a wire soldered to it, it will probably pull off quickly or the printed trace will crack. So...

After checking the rest of the electronics to make sure nothing else was damaged, I reverse-engineered the keypad and then built up a 12 button replacement on a piece of perfboard. Everything works now, but it's not pretty. I think "Not Pretty" is an understatement. It's not bad for about 2 hours worth of work, $0 cost - just parts that were laying around - and it gives us a microwave for a little while longer. But - I think we will be looking for microwaves on sale in the near future.

LOL, this thing is damn ugly. I crack myself up sometimes...

Monday, November 12, 2012

Seven Eight-Button IR Remote Control (PIC12F1840)

UPDATE: 12.1113: It's actually an 8-Button IR Remote. I didn't populate the eighth button because it wasn't needed it for the amplifier controller design. I'll update the schematic / pictures for the eighth button.

UPDATE: 12.1114: Added pictures of modified remote (now eight button).

UPDATE: 12.1114: Added second sheet of schematics, updated to V1.01, removed 7-button 4015 pics.
I've been working on this 8-Button IR Remote Control for a while, but I never got around to documenting it. So - I've drawn up one sheet of the schematics and decided to post it. When I finish the second sheet (with all of the buttons and the HEF4015 interface), I will also post that.

This came about because I was working on decoding IR commands using a PIC. I have a PIC-controlled amplifier interface I am working on and I wanted to incorporate IR remote commands for changing the volume, selecting the input, etc. etc. That led to my wanting to creating a specialized IR remote control for that amplifier project, which led to this.

It works rather well, except that I only have a range of 4-5 feet. I've tried all sorts of configurations of the IR LED circuit and 4-5 feet is the max range I have been able to achieve. Does anyone out there have any ideas on what I can do to improve the range?

The really cute thing is that there is an bit-banged I2C interface that can drive a 2x16 LCD display module. That was helpful when I was trying to debug some issues, but mostly just a neat hack that really isn't that useful. And - too expensive for a cheap remote.

New Code For Electronic Dice (PIC12F629) V1 Hardware

This is the latest code for the Electronic Dice (PIC12F629-based). If you copy and paste it into MPLAB, the formatting should be okay. This code works well on the V1 hardware (the board that has 2 transistors). On the V2 hardware - without the transistors - it doesn't work so well.

This code has been heavily streamlined, and SLEEP mode has been added. If the 'ROLL DICE' button is not pressed within 10 seconds of the last press, the PIC will enter sleep mode and wake up when the button is finally pressed. Hopefully this will save some battery life.

Thursday, November 8, 2012

My Version Of 'Meteor' Lights

UPDATE 12.1221:
Major update! You _can_ control 20 LEDs with an 8-pin PIC. See the new post HERE.
Update 12.1115:
Just in case anyone is interested, I have drawn up the schematic of the Chinese Meteor Lights I bought at a local store. I don't know what kind / brand of lights you are getting in the States (or elsewhere), but if it has a UCS1212 IC as part of the design, then it is probably very similar to this.

And if you are interested, here is the PDF for the datasheet. Be forewarned - it's in Chinese.

Update 12.1114:
I found meteor lights for sale at Uno. One large tube with 48 LEDs was p219.50 (US$5.34) and a string of 6 smaller tubes with 18 LEDs in each tube was p439.50 (US$10.59). I can't beat that - the Chinese win again *sigh*. I was shooting for around p1000 (around US$22.50) retail for a set like the 6 smaller tubes. They have me undercut by OVER 50%.

I looked up the IC in the big tubes - it's a UCS1212,  a custom made 16-pin Chinese part who's only function is meteor lights. One supplier has 100 MILLION parts on hand, at around $0.05 each. I. Just. Can't. Beat. That.
And then, with a quantity discount, maybe $0.04 or $0.03 each? No way I can compete with that. PLUS - they have a custom circuit board in the tube (I can't do PCBs - not yet at least) AND they have nice molded connectors and tube caps. Nope - I just can't beat that.

Did I mention in each of the big tube lights was a transformerless 220VAC-13VDC power supply? WOW.

Here's some pictures I took of the business end of one tube:

To drive 48 LEDs with the 16 pin part - actually only 14 pins, as two pins are used for power and ground - they must be doing some sort of crazy-ass charlie-plexing and fast strobing of the LEDs. You can barely see the traces (slightly darker under that white mask) shooting to the right to the string of 48 LEDs. FOURTY-EIGHT LEDS. Wow. Let's see - 12 pins as drives to the LEDs. That makes 4 groups of 12 LEDs. Use the last two pins as multiplexors. Yeah, it's doable. Consider, also, that the IC may be doing it's own voltage regulating, and it has to generate it's own internal clock. Must be nice to see a need, think up an IC, get it designed and built, and then have 100 MILLION of the damn things for sale.

The AC is coming in through the blue/brown wires to the left. The single IC is the UCS1212, a dedicated 'Meteor Light' piece of silicon. The 4 diodes to the left form the bridge rectifier. A 13V 1W zener diode brings down the rectified power to something usable for the IC. The 48 LEDs (one shown) continue to the right. Yup - I can't compete with this. I keep saying that so that it will finally sink in. I was SO looking forward to building these damn things.

I just realized - the plastic tube is also custom. It has a grove on either side that holds the PCB in place. NOPE - too much for me. I give up.
Consider this project CLOSED.

Oh, btw: I did manage to get fading to work from the interrupt service routine. It works really nice - so I'll be able to use that chunk of code for other projects. Not a complete loss, then.

I'm trying to recreate the 'meteor' lights I am seeing for sale in the Manila area. Most have 10-12 plastic tubes, with 8-16 LEDs each, which simulate icicles handing from the roof edge. Most do a single pattern - a top to bottom LED cycle, with the topmost LEDs slowly fading out.

I've recreated on 'tube' of LEDs using a PIC12F1840 and 8 LEDs. I would use a PIC12F629, which is cheaper, but I am currently out of stock. The 12F629 will be used in production units.

I'm using Charlie-Plexing to drive the 8 LEDs with only 5 pins from the PIC. No resistors or transistors are in the design. My pattern does the top to bottom LED cycle, then all LEDs on, then repeat. I have not programmed in the slow fade of the LEDs yet.

Hopefully I can produce a full string of LED tubes (12 tubes / 8 LEDs each) for 1/3 the cost of the lights that are currently for sale in the stores - my cost including parts, labor PLUS a nice profit. I want to have a full prototype ready within a week - maybe units for sale by the end of the month. If there is interest, then next year we will be ready for the Christmas Holidays selling cycle - which means building up inventory all next summer.

All LEDs lit on the workbench.

Short video. Horrible quality, but you get the idea.
Yes, that's drunken Karaoke you hear in the background.
At least 2 times a week there is some kind of party in the
neighborhood, and drunken LOUD Karaoke is usually a
big part of the celebrations. I just turn my music in the lab
up _really_ loud to counteract it.

Monday, November 5, 2012

8x8 LED Grid Using Two PIC12F629s

I've got this idea in my head to make an 8x8 LED Grid (64 LEDs total) controlled by two PIC12F629s. One PIC is for column strobing, the other for row strobing. The ROW PIC will communicate with the COL PIC to tell it when to start strobing and what data to write during the strobing. But - 64 LEDs, 16 transistors, 25 resistors, and a big chuck of perf board is required. Plus some fancy programming. This project will have to wait until I find a reliable and reasonably priced parts supply house in the Manila area.

Thursday, November 1, 2012

Digital Theremin (PIC12F1840)

Since the homebrew power supply is complete, and that, in turn, completed the Remote Controlled AC Outlet project, it's time to turn to something new and different - something that doesn't involve LEDs or relays.

I used to own a Theremin from Big Briar (it is now Moog Music Inc. and their Etherwave Theremin products are here) - it was a kit that I put together and it was _very_ cool. If you don't know what a Theremin is - have you ever seen a monster or sci-fi flick where there was weird, warble-y, ethereal music playing? _That_ is a Theremin. It's the only music instrument you play without actually touching it. Sound strange? It is - and it's damn fun to play with.

I found a video on YouTube that has Leonid Theremin playing the instrument he invented:

I found a design for a theremin using a couple of HEX converters (CD4069UBE), but I was never able to get it to work. I'm using a HCF4069UBE instead of the CD4069UBE, so that may have something to do with it. You can find that project here.

Anyway - I've decided to gut the old electronics from the original project and replace it with new electronics based on the PIC12F1840. That PIC has A/Ds, a DAC, capacitive sensing, PWM, and other goodies that can be used to implement this design. This should be interesting, educational, --- and fun!

The original project. I like the box and antenna, but I'm going to
scrap the electronics and replace them with a PIC12F1840 based board.