Skip to content

Getting Started with Pants Hardware

Andrew Litt edited this page Jun 7, 2016 · 7 revisions

Just bought WiFi Pants for your Raspberry Pi? Here's what you need to assemble it.

Putting your Pants On

or

A Moment Before Your Iron Heats Up

Included Parts

The WiFi Pants board should include one 40 pin header, one 5 pin header, and one 2 pin JST power header.

Power options

The WiFi Pants board's power supply is designed to run the Pi, attached HATs, and USB devices from a battery. The converter supplies up to 10 watts to the Pi at 5V, and is 85-95% efficient depending on the battery voltage. There is a low voltage cutoff that shuts the Pi down if the battery voltage drops below 2.7V to prevent over discharge of batteries.

The battery or other power source should be able to provide enough power to boost up to 5V. If you're new to this, you should pick a battery that lets the power supply run at its full 10W range (5V at 2A), which I'll go into detail on below. But if you know your project won't draw anywhere near 2A from the 5V supply, then you can use an 85% worst-case efficiency and your estimated current draw to figure out how much current your battery will need to feed.

Lithium Ion and LiPo

LiPo and LiIon batteries work great with the WiFi Pants. When choosing a Lithium battery, look for a 1S (3.7V) battery that can supply at least 3A continuously. In lithium battery language, and most RC model shops, this is the "C" discharge rating of the battery, which is multiplied by the pack's capacity in mAh to give the maximum current the battery can crank out. A battery that's sold as "2200mAh 1S 2C" can provide 4400mAh or 4.4A at 3.7V.

Lithium rechargeable batteries have some safety concerns that other battery types don't. They are very good at catching fire, especially if they overheat during charging or discharging. They also become more likely to short themselves out and overheat if they are charged at too high a voltage or allowed to discharge below a certain voltage.

WiFi Pants has an undervoltage lock-out of 2.7V which should keep most batteries safe from being under-discharged. However it doesn't have a charger or overvoltage cutoff so be sure to use the correct charger for your battery type.

For safety reasons, follow these recommendations when using a lithium battery:

  • Choose a battery that can provide 3 amps at 3.7V continuously safely
  • Use a battery with built-in under and overvoltage protection. These are often called "protected cells", "PCM", or "PCB".
  • Make sure the battery wires are secured with a properly crimped connector or solder connection
  • If the battery comes with a JST PH connector, make sure the polarity is correct before plugging it into the WiFi Pants
  • Use strain reliefs where possible to prevent battery wires from being yanked off the board
  • Tape over exposed battery connections, specifically the battery + connections on the bottom of the Pants board after the connector is soldered
  • Don't put the battery in a place where it could be crushed or punctured. Use a protective case for your project and keep the battery secured and protected inside.
  • Don't mount the battery directly to the front or back of the WiFi Pants board. The power supply can get quite hot when running at full capacity, and can cause the battery to overheat.

Nickel Metal Hydride (NiMh) and primary cells

WiFi Pants can work with off-the-shelf NiMh and primary (disposable alkaline and carbon-zinc) batteries. These tend to be safer than LiPo and are more readily available, but don't have as much capacity for their weight and size and don't come in as many shapes.

For NiMh batteries, please use only 3 cells. NiMh cells are nominally 1.2V. But when freshly charged they can reach 1.4V each, which would push the voltage well over 5V in a 4 cell pack.

1.5V alkaline and zinc batteries should also be used in 3 cell packs. These cells may be used in a 2 cell pack but may shut down prematurely due to the 2.7V undervoltage lock-out. This lock-out can be disabled by desoldering R8 and R9.

I have used the 3 AAA battery pack from Adafruit extensively. It comes with a JST PH plug which fits directly with the one provided in the WiFi Pants kit. A fresh pair of low self discharge NiMh AAAs lasts a little over 2 hours on a charge powering a Pi Zero and small LED matrix display and actively using WiFi. Similar 3 AA packs are available which can provide much longer run times, but don't come with the plug already on the end of the wires.

Power connections

Power can be fed into the 2 pin JST connector, or through the PWR_IN and GND pins of the 5 pin power/UART header. To use the PWR_IN pin, put a solder blob between the pads on the back side of the board marked "PWR_IN isolation".

Control options

If you want a switch or some other way to turn the WiFi Pants power supply on and off, there are a couple of options:

Always on / no switch

The default is for the power supply to turn on when a battery is connected. If you want the WiFi Pants to power up the Raspberry Pi as long as a battery is connected, then you're good to go.

Battery power switch

Not recommended, but you can use a power switch between the battery and WiFi Pants battery input. Some battery holders have a built-in switch that works this way. This is likely fine if the load on the 5V is being kept low, but might cause the switches to overheat or battery input to sag when heavily loaded.

Logic power switch

The Pants power supply has a logic level control that can be used with any type of switch.

Simply put a switch between pins 1 and 2 of the Power/UART header. The power supply will be turned off when the switch is closed.

This does mean that the WiFi Pants board is still "live" when the battery is attached, only 100uA is drawn from the battery as a result of the pull-up resistor while turned off.

**NOTE: ** the /SHDN pin is part of the undervoltage lock-out circuit. Do not actively drive this signal or add external pull-ups, pull-downs, or other loading. The resistors on both sides of this signal control the UVLO on and off voltages. Use only open drain logic if you use external logic like a microcontroller to control the supply.

Mounting options

There are a couple of different ways the Pi and the WiFi Pants board can be stacked. You need to decide this before you solder on the headers.

Pi HAT-style mounting

The WiFi Pants kit comes with a long pin 2x40 socket intended for plugging into HAT compatible Raspberry Pis. Because this board is not a HAT by definition and does not have an EEPROM, it can be stacked in between a Pi and certain other HATs. Circles on the silkscreen of the WiFi Pants indicate pins that may conflict with other HATs. The bold circles are pins that are "owned" by the WiFi Pants and cannot be shared. Light circled pins can be shared, but caution must be taken to insure that the HAT does not itself "own" that signal.

In this configuration, the included header is mounted below the WiFi Pants and soldered on top. The included header spacer can be put on top to give clearance for the soldering. It is recommended that the bold circled pins be clipped after soldering for signal integrity of the SDIO bus between the Pi and WiFi module.

All Raspberry Pi models except the Zero come with the header. A 2x40 header will need to be soldered on to the Zero before using this method.

The battery input jack and power/UART header can be soldered after the 2x40 HAT connector is soldered, and may be soldered to either side of the board.

The included 2x40 header is the correct height for the usual Pi HAT M2.5x11mm standoffs. In a pinch, M3 hardware may be used if the WiFi Pants and Raspberry Pi mounting holes are reamed out slightly.

Pi Zero back-side permanent mounting

Since the Raspberry Pi Zero does not come with a header soldered, the WiFi Pants board can be mounted to the back side of the Pi. An additional male 2x40 long pin header will need to be purchased to mount it this way. Insure that the header pins are long enough to stack HATs when fed through the Pi, and that there is sufficient clearance between the top of the Pants board and the back of the Pi such that there is no possibility of components shorting.

This mounting method is permanent as both the WiFi Pants board and Zero will be soldered together through the header. The other headers (battery, power/UART) will need to be soldered down first. Each WiFi Pants board is tested before shipment so it should "just work", but any soldering mistakes or post-assembly damage will be difficult to fix.

The usual M2.5x11mm standoffs cannot be used here, so creative application of junk drawer hardware will be necessary for mechanical stability.

Pi Zero front-side permanent mounting

Like the back-side permanent mounting, but swapping the order of the boards. All of the same issues apply.

Header options

In addition to the 2x40 HAT connector mentioned above, the WiFi Pants board comes with a 2 pin JST PH connector for a battery and a 5 pin header for the power/UART signals.

Both connectors can be mounted on either side of the board, or not at all. Battery, switch, and UART wires can be soldered to the appropriate pads on the board instead, though for safety it's best not to solder a battery directly to the board without some kind of other way to disconnect it.

The JST PH connector is keyed, so to keep the correct polarity it must be mounted with the connector end facing towards the edge of the board when on the component side of the board, and towards the inside of the board when on the back side.

Heat considerations

The power supply components on the WiFi Pants board can get quite hot when running at the full 10W load. The TPS61232 chip can reach over 80C when operating. Although this is normal, make sure to leave clearance around the inductor and chip and try to allow some airflow around the entire board. The chip has a 100C thermal cutoff to prevent thermal runaway.

RF / WiFi considerations

The WiFi antenna extends past the edge of the board so that the signal is not obstructed when stacked on a Pi along with a HAT. Metal standoffs and larger (B+, 2B, 3B) Pis should not affect the antenna performance. Choose a case that is RF transparent at 2.4GHz (most plastics) and keep screws, wires, and other metal items away from the antenna.

Assembly tips

  • When soldering the included 2x40 header, put some flux on the PCB pads before inserting the connector. Touch the iron only to the junction with the PCB, and use just enough solder to fill the hole. Big blobs or stray solder on the pins will make it hard to stack HATs on top.
  • Don't plan to stack a HAT on top of the Pants board? Use flush cutters to snip off all of the pins after soldering.
  • The 2 pin JST battery connector is compatible with most Sparkfun and Adafruit batteries. Despite that, it pays to check for correct polarity before trying a new battery.
  • There is an outline of the JST connector that matches the correct orientation for each side of the board. Use it.

Is your WiFi Pants board assembled? Then move on to software