If you're doing stuff out and about, you may need to run some electronics. This justifies a brief discussion about how to get electricity when you're away from readily-available power outlets.
Batteries vs. Generators
Your basic sources of energy are the use of batteries or the use of generators. Batteries store energy in a chemical state, while generators burn fuel to produce electricity. There are two kinds of electricity: Alternating Current (AC) and Direct Current (DC). Generators typically spit out AC power, whereas batteries provide DC power. The stuff that comes out of your wall is AC (110-120 volts in the United States), whereas the stuff that comes out of batteries is DC. If the thing you want to power that has a plug on it, it uses AC (though its power supply cord may have a 'rectifier' on it that converts that AC into DC). This guide will discuss how to use batteries to provide AC power using an inverter, as well as how to use a generator. It will then lightly cover DC electronics (there is plenty more help with this online).
How to determine whether to use a generator or a battery
The answer to this question pretty much comes down to how much power you need. If you're going to use above 300 watts, especially for an extended period of time, you probably want to use a generator. If your electricity needs are more modest or short-lived, consider using a cleaner, quieter battery. Just about all electronics say on them how many "watts" they use (you can also Google it). If this number is higher than 300, you should seriously consider using a generator, which often offer 2,000 watts, and can run for hours on a single tank of gas. Important: NEVER use a generator inside. Like a car, they produce carbon monoxide, which will kill you if you breathe too much of it. This is a serious risk--don't do it!
Generators are basically miniature power plants. Like real power plants, they convert fuel into power by spinning a magnet through a coil. They spit out AC power, and usually have normal AC outlets on them that you can plug household electronics into. If you have a lot of equipment to run, this is probably the way to go.
Choosing a Generator
There are nice generators (they're quieter, more reliable, put out cleaner power, rarely have issues, are serviceable, and are often lighter and smaller) and there are cheap generators (they often put out 'dirty power' [varying voltages and sine waves], are typically louder, heavier, break more often and are harder to fix because less people know how to fix them). The golden standard of generators is the Honda EU2000, which puts out 2,000 watts, runs quietly, and can even be tethered to a second Honda to provide extra amperage if you overload its capacity (that is, if you exceed 2,000 watts). Unfortunately, these generators cost between $800 and $1,000 dollars, so they are definitely an investment. That being said, it comes out in the wash if you use it a lot, because other generators will break down and need to be replaced/fixed much, much more, with the added cost of missed opportunity and unreliability. That being said, if you're just doing a few events, and you have enough extension cables to get far away from a loud, cheap generator, and you're not powering sensitive electronics (you don't want to run a computer or other sensitive electronics off of the 'dirty power' of a non-inverter generator), then there are much cheaper options available.
Most generators run on gasoline. They have a tiny gas tank, which usually takes a gallon or less. You should make sure that you have a bit of extra fuel in a red gas can if you think you might run out. Typically, a generator can run between 3 and 6 hours on a single tank of gas. Nicer generators have an 'eco-mode,' which adjusts the amount of power generated by the generator according to how much electricity is being drawn. If a high-power appliance is being used, the generator will work harder (and be louder), consuming far more fuel than it will if it is only running a small load. Some cheaper generators are '2-stroke,' meaning that you need to mix 2-stroke oil (usually 1 part oil per 50 parts gasoline) into their fuel, whereas the other ones are 4-stroke (meaning that they have a dedicated, separate reservoir of motor oil [which you should change after every 40 hours of operation]).
You should use extension cables and power strips, which you will want a number of. Note that extension cables have an electricity loss, and the further away you get from the generator, the more of a loss there will be. This can be mitigated somewhat by using thicker extension cables with a lower gauge ('AWG').
Putting a generator far away from where you are (or even behind some kind of barrier), with its exhaust pipe facing away from you is the best way to get away from its noise. This will involve using extension cables and power strips.
Never use a generator indoors or in an enclosed space. If you smell exhaust, you should change the orientation or position of your generator. This is a serious risk, and failure to heed this warning can result in death or serious injury.
Storage and Transportation
Store your generator upright somewhere that is well-ventilated and preferably away from people. They can off-gas and pollute the air and/or pose a fire risk if they are stored improperly. Don't turn them on their side, because they can spill gas and oil. Don't take them on transit.
Maintenance & Repair
If your generator is a 4-stroke, change its oil after every 40 hours of use. Hondas are very common, and are highly serviceable. You can take them to a tool rental place and even to some auto repair shops to get repaired. The same goes for some other generators, though the knowledge of how to service those generators can be hit-or-miss.
Batteries put out DC power, in varying voltages. Here, we will be discussing the use of rechargeable 12v lead acid batteries.
Connecting to a battery's terminals
Batteries have 'terminals'--one positive (typically marked as red) and one negative (typically marked as black). Depending on the type of battery, these terminals will be a different size and shape. For smaller lead acid batteries, use female spade connectors crimped onto wires or alligator clips to connect to the terminals. For larger car batteries, use battery terminal cable connectors or large jumper-style clips. Your inverter will likely come with hardware for either connecting to a battery, or for connecting to a cigarette lighter adapter, which you will need a converter for (see below).
Choosing a battery
Batteries have different capacities, which are measured in Ampere Hours ('Ah'). An amp hour is the amount of power that it takes to spit out the voltage of the battery at 1 amp for an hour. To calculate how much capacity you will need, figure out how many watts your electronics/equipment use. Let's say you're using a string of lights with 10 x 12-watt light bulbs on it, which you intend to run continuously for three hours. This means that you are using 120 watts for three hours. To calculate the amp hours you will need for this, you will need to remember this simple conversion: Watts = amps x volts. We know that your battery is 12v, so we can say that
120 watts = amps x 12 = amps x 12 = 120 = (amps x 12) ÷ 12 = 120 ÷ 12 = amps = 10 .
For 120 watts of power, you need 10 Ah of power for every hour of run time, so you need a minimum of 30 Ah of capacity to run 120 watts for three hours. If this math isn't clear, just use a watts + volts to amps calculator and multiply the result by the number of hours you will be running your equipment.
The range of battery capacities is large. Standard sizes of small lead acid batteries range from 7 Ah ($17) to 12 Ah ($25) to 18 Ah ($33). Medium lead acid batteries are generally car batteries in the 35-45 Ah ($64-$100) range. There are also deep-cycle batteries with >100 Ah capacity (~$200).
These batteries all have different amperage ratings as well, measured in Cold Cranking Amps ('CCA') and Cranking Amps ('CA'). It's just important that the amperage be equal to the amount of draw that you intend to subject the battery to.
Using an inverter to get AC power from a battery
In its raw state, a battery's DC power is not going to be useful for running AC equipment. In order to run AC equipment off of a battery, you must use an inverter, which is a device that converts DC to AC. Inverters have different wattage outputs, so you need to select the right one for the load you intend to run. Note that a high-wattage inverter will use more electricity that a low-wattage one, and that this will drain your battery quicker. Also note that most inverters come with a 12v cigarette lighter-type plug for plugging into a car, so you may need a cigarette lighter socket adapter for connecting to the battery, into which you will plug your inverter.
Batteries must be recharged after they have been discharged. For this you will need a 12v car battery charger. There are faster and slower chargers (with higher and lower amperages), but you can expect to spend roughly $20-$30 on one. To use, set the charger to 12v mode (if it has such a setting on it), plug it in, and connect the red clip to the red (positive) terminal on the battery, and the black clip to the black (negative) terminal. The charger will have an indicator light on it that will inform you that the battery is full.
This guide will not offer a comprehensive guide to using DC power, which can get pretty complex. Instead, it will offer some brief suggestions for running basic DC electronics.
DC Sound Systems
For sound systems, it's silly to use AC power from a battery unless you are stuck with active speakers (meaning that your speakers have amplifiers inside of them--an increasingly common setup these days). The reason that doing this doesn't make a ton of sense because amplifiers generally operate on DC, and contain an internal rectifier that turns AC into DC power. If you run an active speaker that's plugged into an inverter that's drawing from a battery, what's occurring is that the inverter is turning DC into AC, which your amplifier is plugged into, and inside of the amplifier, the rectifier is turning that AC back into DC, which it is using to drive your speakers. This is super inefficient, since energy is lost each time the power is converted. It's not too big of a deal if you're using these speakers at home, or running them off of a generator, but out and about, you may as well use a battery-powered car or D-class amplifier to drive passive speakers (passive just means that they need to be driven by an amplifier). To do this, follow this guide.
Most LED lights run on DC. That being said, many LED fixtures plug into AC and convert that AC to DC using an internal rectifier. There are also many LED fixtures that run on 12v DC, and which can therefore be powered with a 12v battery. Making these fixtures work will require connecting their positive and negative leads to the positive and negative terminals of your battery, probably with the intermediate use of an extending wire. 20AWG speaker wire can be useful as an extension of DC 12v power operating at <20 watts. To do this, simply join the red lead wire of the LED fixture to the red side of the speaker wire, and the black lead to the black side of the speaker wire. On the other end, crimp the speaker wire onto spade connectors.
Other DC-powered electronics
Many electronics run on DC 12v. To easily get a sense of whether something does, look at its power cable. If it has a power supply cable that has a bulky boxy thing on it, that is probably a rectifier for turning AC into DC power. Take a look on the box, and read its specifications. You're looking for something like this:
The 'INPUT' section tells you that the power supply accepts between 100 and 240 volts of AC power (AC power is represented by the squiggly ~ symbol. The 'OUTPUT' symbol tells you that the power supply converts AC into +12 volts DC (DC power is represented by a dashed line alongside a solid line) at 1 amp (represented as '1A'). The other information is less relevant for our purposes.
What this is telling us is that there is 12v DC current flowing at 1 amp through the output wire that is coming out of the block part of the power supply cable. If you wanted to run the gizmo that this power supply is feeding off of a battery, you could cut this wire (with it unplugged, of course), strip the ends of the supply side (usually there is a 'barrel connector' on the gizmo-side of the power supply wire), and crimp spade connectors (or alligator clips) onto the stripped part of the wires (use a red spade connector on the positive side [which usually has red or striped/dashed insulation] and a blue spade connector on the negative side [which is either black, blue or unmarked wire]). Connect these to a battery with a corresponding voltage to the voltage listed on the boxy switching adapter (don't worry about amperage, unless the battery's amperage is less than what the power supply generates), and plug the power supply's barrel connector into your electronic device. It should work!
If the voltage is different from 12v, you can either use a voltage regulator (Google it) if the voltage needed is lower than that provided by the battery, or use batteries connected in series if the electronic device requires higher voltage.