2. Adding an AC-Power Adapter to a Battery-Operated Toy

(article continued from previous page)

This is a toy traffic signal light from the cheap bin at a major retailer. We’ve already inspected the upper portion that contained the microcontroller and colored LEDs. Now let’s focus on the base of the device.

Soft on/off power pushbutton.

Soft on/off power pushbutton.

Most toys have small slide switches, but this device features a software-controlled on/off button. That’s unusual. Perhaps a pushbutton costs less than a slide switch?

My initial concern was that the batteries would be exhausted more quickly since electrically-powered circuitry has to constantly monitor a pushbutton. In comparison, a switch mechanically disconnects all of the electronics from a battery wire. Yet, upon testing this device in “off” mode, I was remarkably surprised to find that the current consumption was unmeasurably low (less than 1/10th of a microamp). Kudos!

After turning off the LEDs, the chip must enter a sleep state where the semiconductors are in a static (non-changing) state until the pushbutton is pressed again. CMOS chips consume very little current in such states. In fact, the batteries themselves diminish due to age more rapidly than the load from this chip will deplete them.

Another reusable part! Like the LEDs, lenses, and project box case, the momentary pushbutton can be desoldered to use in another project. Alternatively, the button can be connected to an added microcontroller to provide additional software modes to the traffic light, besides off and on.

Knowing that current consumption is not a problem, the only design issues remaining with the pushbutton are the placement (underneath the base) and fact that it difficult to press because the actuator tip is flush with the base. You have to use a pencil tip or something similarly pointy. Of course, if the pushbutton stuck out, then the base would sit lopsided. The correct solution would be to move the button to the rear-side of the base and to have the tip stick out farther.

Existing battery-pack and pushbutton wiring in the base.

Existing battery-pack and pushbutton wiring in the base.

The battery pack accepts three AAA batteries for a total voltage of (1.6V × 3 =) 4.8V when fresh, 4.5V normally, and slowly down to 3V when depleted.

The positive terminal of the battery pack connects to a red wire. The ground (or negative) terminal of the battery pack connects to a white wire. (Aside: Most people prefer a black wire for ground.)

One lead of the pushbutton connects to the ground terminal of the battery pack. The other lead goes up to chip on the main board of the stop light. When the button is pressed, the chip’s pin will read 0V (ground). When the button is not pressed, the chip’s built-in pull-up resistor will bring the pin voltage to 4.5V (or whatever is the voltage of the positive terminal of the battery pack).

Missing AC Adapter Plug?

The traffic light is battery powered, which is nice for portability. However, light-up devices consume batteries rather quickly, so an AC-to-DC power adapter would be preferable.

Redacted AC adapter power jack.

Redacted AC adapter power jack.

Upon opening the base, I discovered that an AC adapter was a consideration at some point! (Notice the telltale curve of a round plug and that some text below “DC 4.5V” has been covered-up in the plastic molding.)

Is this a feature reserved for the “Platinum Executive Edition Plus”? Or, did they simply not perceive a market for a desktop traffic light that cost more than $2.50? The addition of an AC adapter and plug might have raised the cost too high.

Well, we cannot allow their dreams to go unfulfilled. We must add an AC plug at this location on the traffic light.

Roughing-out the AC plug slot with a Dremel rotary tool.

Roughing-out the AC plug slot with a Dremel rotary tool.

Using the existing molded shape as a guide, the beginning of the hole for the AC-adapter plug is crudely sliced out with a cut-off disc. After snapping off the remaining plastic, the slot is fine-tuned to a square shape using miniature files.

Test fitting the power jack in the traffic-light base.

Test fitting the power jack in the traffic-light base.

A 2.5mm-pin DC power jack (All Electronics #DCJ-6 for $0.25) is super-glued into the round opening. Then, the base cover is slid on top to determine whether it fits.

It took a couple of tries and a bit more filing until the parts mated. As you can see by the narrow gaps on the sides, the final fit is a little looser than intended. Nevertheless, it works just fine and it doesn’t stand out as not belonging.

Power Supply Conflict

There is a serious concern with providing more than one power source to a device: the power sources can damage each other due to conflicting voltages.

Connecting a power source to batteries is a fire and chemical hazard, because primary (like alkaline and standard lithium) batteries are not meant to be recharged, and secondary batteries (like NiMH, NiCad, and lithium-ion) must be carefully recharged by special circuitry.

Don’t create a circuit with more than one power source unless you are qualified to do so.

There are a couple of solutions I considered for the traffic-light project:

For my own experiment, I decided to try using my plug’s special feature that physically disconnects the battery pack wire when an AC connector is inserted. I don’t know if this is an industry-standard acceptable practice.

AC adapter power jack and battery pack wiring.

AC adapter power jack and battery pack wiring.

Using a multimeter with my chosen 5V AC-to-DC adapter plugged in, I determined the rear terminal is positive for this AC adapter (labeled "center-positive"). The front terminal is negative/ground because that corresponds to barrel (outer part of the cylinder), which is ground for this AC adapter. Obviously, your results will vary.

The remaining terminal on this particular DC plug mechanically connects to the front terminal when an AC plug is removed. The metal inside the plug lifts up and mechanically disconnects this terminal when an AC plug is inserted. This means if the ground wire on the battery pack is connected to the side terminal, it will automatically be disconnected from ground when an AC plug is inserted. Thus, the battery pack is automatically disconnected when an AC power plug is connected.

It is worth noting that the AC-to-DC power adapter I selected for this project supplies steady 5V DC. Anything between 4V DC and 5V DC is acceptable for the traffic light.

Lower voltage would make the LEDs too dim. Higher voltage or AC output would damage the circuitry.

Be careful relying on the voltage listed on the AC wall-wart transformer. Cheap or old adapters may supply a different voltage than listed. It is worth measuring the actual voltage under load before trusting it.

The desktop traffic light now has a steady household power source, so I can modify the main circuit to keep the LEDs lit without worrying about expensive batteries. Because we know that the main chip is encapsulated under a black epoxy blob, this is going to require overriding it with an external microcontroller.