Electronics

First Sign of Life!

19 Aug, 2012

Well, I couldn’t wait to see some results, so I went for something visible.  The one thing I KNEW I could fix was the marquee.  I grabbed the old bulb and the old starter and headed to the hardware store.  I paid way too much for replacements and popped them in and flipped on the power.  Nothing.

IMG_20120725_183544

Well, so much for the quick-fix.

In my research on the interwebs, I found some good tips.  It seems that the biggest culprit in this cabinet is “Big Blue”.  Big Blue is a large, 27 farad, electrolytic capacitor on the power supply.  (The one in the photo is black because I forgot to take a photo before I replaced it.)  Electrolytic capacitors have a shelf life, and a usable life, because the fluid inside breaks down over time.

2012-08-07 21.04.27 

The second-most common cause of failure for this machine is the electrolytic capacitors on the “A/R”, or “Audio/Regulator” board.

2012-07-25 21.24.51

A common thread in many of these repair write-ups was mentions of obtaining parts from “The Real Bob Roberts”, who was portrayed as one of the gods of arcade machines.  I found his site and, while he may not be a god, he is certainly a saint.  Bob has pretty much any part you might need, and at very reasonable prices.  Bob is pretty old-school; no online store, no PayPal, no credit cards.  His site is basically a listing of parts he has to offer and their prices, all in one table.  It’s a bit hard to find a particular part, but it’s well worth looking through the whole list.  Bob has links from many of the part listings to photos to help identify the right replacement, or to very helpful tips pages.  To order, you send Bob an email, listing out the parts you want.  Bob responds almost immediately with a quote including shipping and his physical address.  You send him a check, he sends you your parts; old-school.  I would recommend him to anyone ten times out of ten.

My first parts order included a “Big Blue” capacitor, an A/R board “kit” (high-failure part replacements), a G07 monitor “deluxe kit” (more on this in another post), and a ballast for the marquee light.  When the parts arrived, I started replacing things.

First, Big Blue; a simple replacement.  Unplug power supply connections, remove power supply, unscrew capacitor terminal connections and mount, reverse to replace.  I tested the outputs, but they seemed pretty far off-spec (more on this in another post).  No joy there.

Next, I pulled the marquee/speaker board, and replaced the fluorescent light ballast.  I put that all back together and finally had my first sign of life!

IMG_20120716_203822  IMG_20120725_185015

Hey, you gotta take the small wins when you can.

I haven’t had a lot to blog about for a while.  Life has been happening, but I don’t blog about that, I blog about my projects.

Well, I have a new one: I bought a Dig Dug arcade cabinet!  I was browsing around a consignment store, and I saw this hidden behind a steel locker:

IMG_20120713_165140 IMG_20120713_165058 IMG_20120713_165121

The proprietor said it just “hums”, and that they wanted $200 for it.  The whole thing was in pretty decent physical shape.  I could see original monitor and marquee glass, an original control panel with original controls in pretty good shape, a Coin Controls coin door with mechs, lockout solenoids, and an original coin hopper housing with hopper and original service control panel (showing 43,265 plays).  I thought I could probably part those items out for at least $100, then gut the cabinet and convert it to a MAME machine.

I offered $150, and they snapped it up.

IMG_20120714_155613

Once home, I checked inside and found out this machine was ALL original! Right down to original manuals, and matching serial numbers on the cabinet, monitor, and main board!  I turned it on and, as promised, it just hummed.

 IMG_20120714_170902 IMG_20120725_211046

I couldn’t mess with an original classic like this that had (almost) survived 30 years! (Manufacture dates on the parts all seem to be in 1982.)  I decided that, rather than parting the machine out, I would restore it to working condition as close to original as I could.  THAT ought to give me something to write about!

I’m hoping to find a collector to buy it when I’m done.  I’ll use that cash to fund my MAME cabinet build.  I’ve actually started the restoration.  I just finally realized I should blog about it.  Next up: First Sign of Life!

This is hilarious and educational, all at the same time!  For those who don’t get how pointers work, this clears it up:

IMAG0183 IMAG0182

I noticed I was doing a lot of breadboarding at my desk (as opposed to my worktable in the basement).  That was fine, but I always had to have a battery pack/power supply hanging off of the breadboard.  I had this neat enclosure I got as a sample that has a battery compartment.  It’s made for AA batteries, but two 9v batteries worked fine (I put electrical tape over the other contacts).  I built two power supplies (5v and 3v) on a project board and mounted it inside.

IMAG0175 IMAG0176

I soldered some leads to the underside of the breadboards, then wired up some switches and power LEDs

IMAG0171 IMAG0179

I made the 5v (green) LED brighter because I wanted to be sure I noticed that there was a higher, potentially damaging voltage on one of the power rails.  I put a few other safety features in place, such as diodes between the positive terminals of the 9v batteries (in case I put one in backwards), diodes on the ground rails (to prevent unwanted circuits through the power supplies), and disconnection of the power rail(s) through the switch(es) to completely isolate them when the switch is off.

Here’s the schematic:

bench-power-supply-v3

Let me know of any errors in the comments.

image

STMicroelectronics has a new “evaluation board” for its “value line” of STM32 microcontrollers, priced at “under $10″.  (Product page) This seems to be a follow-up to its little brother: the STM8S Discovery board: (Product page) STMicroelectronics seem to have ceded the 16-bit hobbyist market to TI’s MSP430 LaunchPad (Product page) which, at $4.30 is the most inexpensive evaluation board I’ve seen offered for any microcontroller.  Despite STM’s claim of “under $10”, the STM32 Value Line Discovery board is selling at Mouser for US$11.85, and at Arrow for 13,16 EUR.  The STM8S Discovery board can be had for US$9.60 at Mouser (up from ~US$7.20 release price back in November 2009).

The STM32 Value Line Discovery board has many familiar features to the MSP430 LaunchPad crowd.  There is an integrated USB programmer/debugger, two user LEDs, a user button, and a reset button.  All of the uC’s pins (plus some others) are broken out to headers along the edges of the board.  There is a free programming tool chain available, as well as several example programs.

Despite many similarities to TI’s LaunchPad, the STM32 Value line Discovery board (and the STM8S Discovery board) have some distinct differences.  The processor on these boards is a surface-mount type and thus, soldered on.  The programmer/debugger cannot be separated from the uC, physically or electrically (except, in the case of the STM8S Discovery, by snapping the board apart).  The STM uCs also seem to require several external components for operation; rather inconvenient if one is accustomed to the self-contained MSP430.

The STM32 is, however, quite a capable uC.  I didn’t grab all the specs, but the family is listed as being: “An advanced ARM-based 32-bit MCU with 16 to 128 KB Flash, 12 timers, ADC, DAC & 8 comm interfaces.”  Now, the specs I did see on the STM32F100RB chip on the board included 7 16-bit timers plus some specialty timers, 16 12-bit ADCs, 2 12-bit DACs, 2 SPI, 2 I2C, and 3 USARTs.  In lowest power mode, it can run on 1.7uA.

If you need this kind of power, the STM32 Value Line Discovery board is available now.  Me?  I’m sticking with the MSP430 LaunchPad.  It’s plenty powerful enough for me, and I like being able to remove the uC from the board and use it in my own circuits.  Now, if TI would just release those 20-pin models; I could use the extra I/O pins!

With some very helpful basic electronics advice from NJC (of NJC’s MSP430 LaunchPad Blog), and others on the Four-Three-Oh! forums, I rebuilt my IR sensor with a lower value pull-up resistor.  I used the same IR sensor (salvaged from an old mouse), but since it actually had two phototransistors in the part, I wired them in parallel and gave it another trial.  On that partly cloudy day, it worked!  I have yet to test it in full sunlight, but I have hope.

The lower pull-up resistor value helped (I got better range when I tested it on a breadboard with a single side of the sensor), but I think wiring both phototransistors in parallel cut back on the resistance through the sensor as well.  For this reason, I would suggest using a mouse-style dual IR sensor wired in parallel if you choose to try this project.

I went to a tire store and got an old trash inner tube for free. I cut a strip of rubber, cleaned it, and super-glued it into a loop to fit around the meter. I punched a hole with a nail and fed the wire (from the same old mouse where I salvaged the phototransistor) through the hole; it fits water-tight. I decided I might as well use both of the IR phototransistors in the unit, so I soldered three wires to it and super-glued it in place at the right distance from the edge. It fits pretty well!:

IMAG0105 IMAG0107

I bought a PVC conduit corner piece similar to the larger ones connecting to my meter and feeding into my house. I cut the back connection off, and sealed the back hole with scrap rubber and super-glue. I also used some rubber over the bottom opening to feed the wires through (and keep spiders out). I put a small strip of 1/4″ plywood inside, super-glued a terminal strip to it, and ran screws through the terminal strip, plywood, and rubber and out the back hole to mount to the house.

IMAG0109 IMAG0110

I ran a piece of CAT-5 cable through an existing hole in the side of the house and into my basement, where the microcontroller and computer will be. The CAT-5 and the terminal strip give me eight conductors in case (when) I run more sensors outside.  I did have a setback that the screws on the terminal strip are ‘cupped’ underneath, so they kept cutting the thin solid CAT-5 wires.  I solved this with a pair of washers per screw.  The only sensor connected so far is the IR phototransistor for the meter (top two terminals on right).  I forgot to get a shot with it all closed up, but it fits visually with the other utility conduit and boxes around it.

IMAG0142 IMAG0143

I have tested the connection inside, and I am able to detect the pulses on my DMM (drops to ~5 ohms) and with the LaunchPad (triggers an interrupt reliably).  Next up: Firmware and software. More when I get it running!

image

TI’s MSP430 LaunchPad is growing a great community, and along with it, some opportunities.  Joe over at http://joesbytes.com/wordpress/ recently sent me a sample of his new LaunchPad Mini Proto Board; a handy prototyping board similar to an Arduino prototyping “shield”.  You can buy the boards on his site for $6 with free shipping.  Joe even makes the Eagle files available, but I doubt you can fab it for less than $6 shipped! 

The board is currently only available as a bare board, so you’ll have to supply the parts to populate it.  This is a much more compact method if you only need a small breadboard or prototyping area.  (If you want a full breadboard, see my LaunchPad Breadboard Adapter.)

IMAG0100

This is a high-quality, well thought out board with a few simple extras that make it great.  Most of the board’s space is a prototyping area that is thoughtfully perfectly sized to fit one of SparkFun’s mini breadboards.  All of the LaunchPad’s 20 pins are brought in to headers next to the prototyping/breadboard area.  The Vcc and Gnd lines are broken out into extra headers; both Vcc and Gnd are available on three sides, and there are holes for extra decoupling capacitors next to the headers on two sides.  A nice extra is the provision for two on-board LEDs with accompanying resistors, attached via dedicated jumpers to P1.4 and P1.7.  The silkscreen is excellent, with every pin and part well labeled.

The mini proto board’s dimensions are just a bit shorter than the LaunchPad, coming up exactly even on three sides when assembled and attached.  The LaunchPad’s buttons, LEDs, and external power header are accessible with the mini proto board attached (though the extra Gnd on the power header is a bit tight).

Assembly was easy, as all the parts are through-hole.  I chose to have some of the power headers female, and some male.  I did have to sacrifice the female headers that came with my other two LaunchPads because the female headers I ordered haven’t arrived yet and I’m impatient!  I chose blue and white for the LEDs since the LaunchPad already has red and green.

Here are a few shots of my finished board:

IMAG0102  IMAG0103

The only glitch I had was that my resistors seem a bit longer than the board is designed for.  I popped on a couple of jumpers, and tried out my “police light” program.  The flashing blue and white LEDs look great.  I’m going to order a mini breadboard right away.  You should order your LaunchPad Mini Proto Board now!

IMAG0086 IMAG0085

My circuit boards arrived, and they are beautiful!  The quality on these boards is outstanding.  I will definitely be ordering through DorkbotPDX again.  You can see that the cuts are perfect (with small, perforated, easy to snap tabs!), the trace, drill, soldermask, and silkscreen are perfectly aligned, both front and back.

So, why the odd title to the post?  See if you can spot what’s wrong with these pictures:

IMAG0094 IMAG0093

Yes, that’s right; the fab house made them exactly as I designed them!  (Not how they should have been designed…)

I did measure twice… well, at least on the LaunchPad breadboard adapter…  The problem was that I did not do a final measurement check before I sent off the order.  In the midst of making things look decent and work properly, I somehow made the LaunchPad end of the adapter 0.1” too wide.  The power supply I probably made to fit the extra space and intended to adjust the size before sending, but forgot.

C’est la guerre!  I may be able to salvage these boards (lots of empty space on the power supply, and maybe some angled pins for the adapter), but I have learned a lesson:  Always double-check the “Final” plans.

(BTW: I will post the corrected Eagle board file here once I fix it.  The “mini-LaunchPad” portion will not be included; I’ll post that another time, once it’s proven workable.)

EDIT: Eagle board file (fixed?)

credit: http://davestech.blogspot.com/2008/02/itron-remote-read-electric-meter.html

One of the main reasons I wanted to learn microcontrollers was that I wanted to make my own energy consumption monitor.  I live in the US, and I have an Itron digital electric meter on my house.  On the top of the meter is a plastic optical conduit that goes to an IR LED that flashes once for each watt-hour used.  I was hoping to use an IR transistor to read the meter flashes with an MSP430, and pass the info to a host computer (probably an old junk laptop I have).  Once I had the meter-reading done, I could start considering weather sensors and appliance sensors to see how they affect the electricity usage.

So, I tried wiring up an IR sensor (one side of a dual-IR phototransistor salvaged from an old ball mouse) and hooking it up as I would a switch on an input pin.

I ran a test program, aimed an old VCR remote at it, and voila!  It worked!  While still jazzed about this, I took the LaunchPad outside with a battery pack, and taped the IR phototransistor over where the IR flash should be… nothing.  I turned on the air conditioning to be sure I was using a decent amount of energy… nothing.

I finally broke out my cell phone camera and tried to see the flashes.  At first, I thought my meter didn’t flash.  Then, I put the camera up close.  It wouldn’t focus, but I could see the flashes (please excuse the noise from the A/C unit):

Too dim for my set-up.  I need to either find a more sensitive sensor, change the circuit to amplify the signal (an o-scope would be nice!), or can this idea.

Any ideas?  I would love your comments.

IMAG0074

On Saturday, gatesphere posted a code on the Four-Three-Oh! forums for a free TI eZ430-F2013 USB stick style development board (+s/h).  Well, since “free” translates roughly to: “You must order this,” and I am liking the MSP430 line anyway, I went ahead and ordered.

Since I was paying for shipping anyway ($5-6 for FedEx 2-day, not bad!), I went ahead and ordered a set of three extra target boards ($10), and three more LaunchPads.  Sadly, the LaunchPads are backordered.

The other items, however, arrived this morning!  I like the LaunchPad a bit better due to the buttons and LEDs, but I’m sure I’ll find a use for the eZ430-F2013.  The target boards have a breakout for all 14 pins and an LED that seems to be permanently tied to a pin.

Who knows?  This may eventually be the target for my electricity usage sensor.  It could, at least, be a handy portable test platform to carry outside with my netbook.  Or, maybe a simple little logic analyzer?