Electronic – arduino – controlling singing-dancing santa with Arduino

arduino

We have a 3 AA batteries-powered Santa figure (which sings and dances 😛 ) we want to control from an Arduino Uno board.

Being quite noob to electronics and Arduino, we have been able so far to light up a set of Xmas AC-connected lights using Arduino and a relay.

The complimentary Santa figure is giving more problems:
We have connected the Arduino board's GND pin to the negative pole of the batteries' case and a digital output pin (pin 10) to the switch of the figure (which is always switched on, to let current turn the figure on).

But the most we could get was a bit of led blinking in the figure, as if the current was not being constantly held.

So is there any standard layout to connect the figure to the Arduino board or do we have to connect the pins in a different way?

Best Answer

Summary

Your diagnosis is correct. Your Santa figure requires more power to operate than the Atmel ATMega MCU can supply (Santa input impedance too low; MCU output impedance to high) from one of its GPIO pins (~14mA*, max, safely). Continuing to attempt to power it in this way will ultimately result in the destruction of the Arduino's processor's output pin (specifically, the internal component known as the output buffer).

You need an amplifier. The simplest way (component count, cost, tolerance to variation) to do this is to put an N-type MOSFET (NFET) in the ground path of the Santa figure.

Proposed Solution

Schematic

Simplified Schematic

Netlist

The above schematic embodies the following netlist:

  • Battery(+) --> Santa(+)
  • Battery(-) --> NFET(Source)
  • Arduino(GND) --> NFET(Source)
  • Arduino(GPIO) --> NFET(Gate)
  • Santa(-) --> NFET(Drain)

Note: I haven't really addressed your power supply situation. If you require further assistance with that, let me know.

Explanation of Solvency

Notice the two connections to the NFET Source Pin. This configuration is called a common-source amplifier (bet you can't figure out why ;-) ). For your application, practically any discrete NFET you are likely to encounter will work.

I'll elaborate more specifically on the (1) parameters of principal interest, (2) design constraints that guide their selection, (3) an approximation of the value, and (4) the rationale:

Ids,max

  1. The maximum continuous allowable drain-to-source current of the transistor
  2. Choose for >2 times the expected current demand of the Santa (Isanta)
  3. Perhaps something like 2A is reasonable given the 3AA battery compartment
  4. Prevent excessive voltage drop and temperature rise in the transistor

Vgs,th

  1. The "threshold" voltage at which the transistor "turns on" (the voltage at which the channel begins enhanced linear behavior)
  2. Choose Vgs,th < 0.9 * Vcc,arduino
  3. Let's say, Vgs,th < 4.5
  4. If Vgs,th is too high then the resulting Rds (resistance in the transistor channel) will be higher resulting in more voltage drop in the transistor (lower voltage delivered to the Santa) and less current flow. At excessive levels the transistor will be in cut-off (effectively an "off" switch) and the Santa will not sing and dance (oh no!).

Qg

  1. Total gate charge -- the total amount of charge transfered to the gate during a charge cycle.
  2. If Qg > 10nC, use R1 to limit the in-rush current
  3. for 2, a rather large transistor compared to the output buffer of the arduino, Qg = >50nC. Set R1 = 250 to 1k Ohms.
  4. There is a wide latitude in these numbers since you are dealing with operating characteristics and long-term reliability. The overriding goal is to prevent the gate, which momentarily looks like a short-circuit when switching, from sucking too much current out of the arduino's output buffer and doing a little bit of damage in the process that accumulates over time. Externally limiting this instantaneous current with R1 > Varduino/Iarduino,safe is an excellent practice. The exact value of Iarduino,safe has been the subject of some debate as described by @Kortuk below.

A Suggested Part

Vishay Si4836Dy -- probably overkill, but will definitely work.

*This value varies based on the supply voltage of your circuit and temperature, please check the datasheet of your specific chip with your operating conditions to determine the acceptable value here, 14mA should be safe for all operating conditions of the chip used in an arduino. 20mA should be more then safe if you are using an arduino.