Battery Basics – Choosing a Battery for Your Project

If choosing a rechargeable battery for your project intimidates you, [Afroman] has prepared a primer video that should put you at ease. In this tutorial for battery basics he not only walks you through a choice of 5 rechargeable chemistries and their respective tradeoffs, but gives a procedure that will allow you to navigate through the specs of real-world batteries for sale – something that can be the most intimidating part of the process.

You cannot learn everything about batteries in 9 minutes, but watching this should get you from zero to the important 80% of the way there. Even if your project does not give you the specs you need to begin buying, [Afroman] tells you what to measure and how to shop for it. In particular, the information he gives is framed in the context you care about, hopefully ensuring you are not waylaid by all the details that were safe to ignore. If this is not enough, [Afroman]’s prequel video on battery terminology has more detail.

Much like your high school English teacher told you, you need to know the rules before you can choose to break them. Many of battery absolute Dos or Don’ts are written for the manufacturer, who provides for the consumer, not the hacker. Hackaday has published hundreds of battery articles over the years; search our archives when you are ready for more.

Continue reading “Battery Basics – Choosing a Battery for Your Project”

Compiling Your Own Programs For The ESP8266

When the ESP8266 was first announced to the world, we were shocked that someone was able to make a cheap, accessible UART to WiFi bridge. Until we get some spectrum opened up and better hardware, this is the part you need to build an Internet of Things thing.

It didn’t stop there, though. Some extremely clever people figured out the ESP8266 had a reasonably high-power microcontroller on board, a lot of Flash, and a good amount of RAM. It looked like you could just use the ESP8266 as a controller unto itself; with this chip, all you need to do is write some code for the ESP, and you have a complete solution for your Internet connected blinking lights or WiFi enabled toaster. Whatever the hip things the cool kids are doing these days, I guess.

But how do you set up your toolchain for the ESP8266? How do you build projects? How do you even upload the thing? Yes, it’s complicated, but never fear; [CNLohr] is here to make things easy for you. He’s put together a video that goes through all the steps to getting the toolchain running, setting up the build environment, and putting some code on the ESP8266. It’s all in a git, with some video annotations.

The tutorial covers setting up the Xtensa toolchain and a patched version of GCC, GDB, and binutils. This will take a long, long time to build, but once it’s done you have a build environment for the ESP8266.

With the build environment put together, [CNLohr] then grabs the Espressif SDK from the official site, and puts together the example image. Uploading to the module requires pulling some of the pins high and some low, plugging in a USB to serial module to send the code to the module, standing well back, and pressing upload.

For his example image, [CNLohr] has a few WS2812 RGB LEDs connected to the ESP8266 WiFi module. Uploading the image turns the LEDs into something controllable with UDP packets on port 7777. It’s exactly what you want in a programmable, WiFi chip, and just the beginning of what can be done with this very cool module.

If you’re looking around for some sort of dev board with an ESP8266 on it, [Mathieu] has been playing around with some cool boards, and we’ve been looking into making a Hackaday version to sell in the store. The Hackaday version probably won’t happen because FCC.

Continue reading “Compiling Your Own Programs For The ESP8266″

Flash Memory Endurance Testing

[Gene] has a project that writes a lot of settings to a PIC microcontroller’s Flash memory. Flash has limited read/erase cycles, and although the obvious problem can be mitigated with error correction codes, it’s a good idea to figure out how Flash fails before picking a certain ECC. This now became a problem of banging on PICs until they puked, and mapping out the failure pattern of the Flash memory in these chips.

The chip on the chopping block for this experiment was a PIC32MX150, with 128K of NOR Flash and 3K of extra Flash for a bootloader. There’s hardware support for erasing all the Flash, erasing one page, programming one row, and programming one word. Because [Gene] expected one bit to work after it had failed and vice versa, the testing protocol used RAM buffers to compare the last state and new state for each bit tested in the Flash. 2K of RAM was tested at a time, with a total of 16K of Flash testable. The code basically cycles through a loop that erases all the pages (should set all bits to ‘1’), read the pages to check if all bits were ‘1’, writes ‘0’ to all pages, and reads pages to check if all bits were ‘0’. The output of the test was a 4.6 GB text file that looked something like this:
Continue reading “Flash Memory Endurance Testing”

Finding a Cheaper USB to Serial Chips

FTDI-gate wasn’t great for anybody, and now with hardware hobbyists and technological tinkerers moving away from the most popular USB to serial adapter, some other chip has to fill the void. The cheapest USB to serial chip on the market appears to be the CH340G, available for 20-40 cents apiece from the usual retailers. There is, however, almost no English documentation, and the datasheet for the CH340 family doesn’t include this chip. [Ian]’s here to help you out. He got his mitts on a few of these chips and managed to figure out the pinout and a few reference schematics. He even made an Eagle part for you. Isn’t that nice?

The CH340 series of chips do exactly what you would expect them to do: a full-speed USB device that emulates a standard serial interface, with speeds from 50bps to 2Mpbs. The chip supports 5V and 3.3V, and all the weird modem lines are supported. This chip even has an IrDA mode, because wireless communication in the 90s was exactly as rad as you remember.

With [Ian]’s help, we now have a cheap source of USB to serial chips. If you need the datasheet, here you go. The driver is a bit more difficult to find, but what you’re looking for is the CH341 family of chips. That can be found with a little bit of Google fu.

Palatable Pallet Procurement Procedures

Wooden pallets are a versatile and widely-available starting point for a multitude of projects. Best of all, they can usually be acquired free of charge. But choose the wrong kind of pallet and you could end up paying dearly. [Eric] has compiled a great deal of useful information about pallets that will help you find ideal candidates and prepare them for whatever project you have in mind, be it a coffee table or a backyard roller coaster.

Pallets come in several styles and loader configurations. Some are made with space between the boards, and others are closed. If you take nothing else away from his article, just remember to look for plain, untinted pallets with no markings and you’ll be fine.

No markings means the pallet was used domestically, so markings aren’t required. Marked pallets from abroad should feature the IPPC logo as well as a treatment code indicating the method used on the material. Debarked (DB), heat treated (HT), and pallets with the European Pallet Association logo (EPAL) are all safe choices. Pallets labeled (MB) were treated with methyl bromide, which is a poisonous fungicide. Colored pallets should be avoided as well. If you find one in a cool color, take a picture of it and find some paint in a similar hue.

Safe pallets can be had from many places ranging from hardware stores to feed and tack supply stores. Find someone you can ask for permission to take pallets—they might even help you load them. Keep some gloves in your trunk to avoid splinters.

A Description of Maddening Battery Terminology

Once again, [Afroman] is here for you, this time breaking down electrolyte and the terminology behind batteries.

Volts and Amps are easy mode, but what about Amp hours? They’re not coulombs per second hours, because that wouldn’t make any sense. An Amp hour is a completely different unit podcast, where a 1Ah battery can supply one amp for one hour, or two amps for 30 minutes, or 500 mA for two hours.

Okay, what if you take two batteries and put them in series? That would double the voltage, but have the same Ah rating as a single cell. Does this mean there is the same amount of energy in two batteries as what is found in a single cell? No, so we need a new unit: the Watt hour. That’s Volts times Amp hours, or more incorrectly, one joule per second hour.

Now it’s a question of the number of cells in a battery. What’s the terminology for the number of cells? S. If there are three cells in a battery, that battery has a 3S rating. You would think that C would be the best letter of the alphabet to use for this metric, but C is entirely different. Nothing here makes any sense at all.

What is C? That’s related to the number of amps a battery can discharge safely. If a 20C battery can discharge 2200mAh, it can deliver a maximum current of 44 A, with 20C times 2.2Ah being 44A.

So there you go. A complete description of something you can’t use logic and inference to reason through. Video below.

Continue reading “A Description of Maddening Battery Terminology”

A Li-ion Battery Charging Guide

Although [pinomelean’s] Lithium-ion battery guide sounds like the topic is a bit specific, you’ll find a number of rechargeable battery basics discussed at length. Don’t know what a C-rate is? Pfffft. Roll up those sleeves and let’s dive into some theory.

As if you needed a reminder, many lithium battery types are prone to outbursts if mishandled: a proper charging technique is essential. [pinomelean] provides a detailed breakdown of the typical stages involved in a charge cycle and offers some tips on the advantages to lower voltage thresholds before turning his attention to the practical side: designing your own charger circuit from scratch.

The circuit itself is based around a handful of LM324 op-amps, creating a current and voltage-limited power supply. Voltage limits to 4.2V, and current is adjustable: from 160mA to 1600mA. This charger may take a few hours to juice up your batteries, but it does so safely, and [pinomelean’s] step-by-step description of the device helps illustrate exactly how the process works.

[Thanks mansalvo]