Hackaday Dictionary: The ESP8266

In August of 2014, something new started showing up in the markets of Shenzhen, the hi-tech area of China where the majority of the world’s electronics components are made. This is the ESP8266, a WiFi SoC (System on a Chip) that can connect to 802.11b/g/n networks on the 2.4GHz band. It can be addressed with SPI or a serial connection, and has an AT command set that makes it behave rather like an old-style modem. Basically, it has everything you would need to connect a device to a WiFi network, with the ESP8266 chip itself handling the complicated business of finding, joining and transmitting/receiving over a WiFi network.

That’s nothing particularly new in itself: WiFi connection devices like the TI CC3000 have been around for longer, and do much the same thing. The difference was the price. While the TI solution costs about $10 if you buy several thousand of them, the ESP8266 costs less than $7 for an individual board that can plug straight into an Arduino or similar. Buy the chip in bulk, and you can get it for less than $2.

The ESP8266 is more than just a WiFi dongle, though: it is a fully fledged computer in itself, with a megabyte of flash memory and a 32-bit processor that uses a RISC architecture. This can run applications, turning the ESP8266 into a standalone module that can collect and send data over the Internet. And it can do this while drawing a reasonably low amount of power: while receiving data, it typically uses just 60mA, and sending data over an 802.11n connection uses just 145mA. That means you can drive it from a small battery or other small power source, and it will keep running for a long time.

It wasn’t an easy ship to write applications for in the early days, though: it was poorly documented and required a dedicated toolchain to work with. This made it more of a challenge than many hackers were comfortable with.  That changed earlier this year, though, when the Arduino IDE (Integrated Development Environment) was ported to the chip. This meant that you could use the much easier to write Arduino functions and libraries to write code for the chip, bringing it within reach of even the most casual hacker.

Continue reading “Hackaday Dictionary: The ESP8266”

Learn Flip Flops With Simulation

Digital design with combinatorial gates like AND, OR, and NOT gates is relatively straightforward. In particular, when you use these gates to form combinatorial logic, the outputs only depend on the inputs. The previous state of the outputs isn’t important in combinatorial logic. While this is simple, it also prevents you from building things like state machines, counters, and even CPUs.

Circuits that use their own outputs as inputs are known as sequential circuits. It is true that at the fundamental level, sequential circuits use conventional logic gates. However, you usually won’t deal with them as gates, but will deal with abstractions like latches, flip flops, and even higher level constructs. Learning about these higher level constructs will allow you to make more advanced digital designs that are robust. In fact, if you are using an FPGA, building blocks like flip flops are essential since a large portion of the chip will be made up of some kind of flip flop.

Continue reading “Learn Flip Flops With Simulation”

Ethics In Engineering: Volkswagen’s Diesel Fiasco

Every so often – and usually not under the best of circumstance – the field of engineering as a whole is presented with a teaching moment. Volkswagen is currently embroiled in a huge scandal involving emissions testing of 11 Million diesel cars sold in recent years. It’s a problem that could cost VW dearly, to the tune of eighteen Billion dollars in the US alone, and will, without a doubt, end the careers of more than a few Volkswagen employees. In terms of automotive scandals, this is bigger than Unsafe at Any Speed. This is a bigger scandal than the Ford Pinto’s proclivity to explode. This is engineering history in the making, and an enormously teachable moment for ethics in engineering.

Continue reading “Ethics In Engineering: Volkswagen’s Diesel Fiasco”

Drawbacks Of Laser Cut Delrin–and How To Slip Around Them

Welcome back to part II in this ensemble of techniques with laser-cut Delrin. Thanks for many of the great insights along the way in the comments. In this guide, I’d like to go over some of the more immediate kinks that come to mind when getting started with this material.

Sourcing Delrin Sheets

When it comes to shopping, there are a variety of suppliers to choose from, but there are a few key words and thoughts to keep in mind.

Names

First, Delrin, is the “brand name” that refers to the Acetal homopolymer. Variants may also be labeled, acetal or acetal homopolymer. Delrin’s natural color is a soft white, but dyes can take it into a range of other colors. Black and white are, by far, the most common, though.

Tolerances

In the previous guide, all of the examples were cut from a small range of sheet thicknesses (0.0625[in], 0.09375[in], and .125[in]) sourced from OnlineMetals. As the thickness of the sheet increases, the tolerances on the thickness rating will also become more loose. You might buy a .125[in] plate and find it to be .124[in] in some places and .126[in] in others. If you purchase a .250[in] sheet, however, you’ll find that it may vary as much as .126[in] oversize though!

Buy it Flat

Despite McMaster-Carr being my go-to solution for one-off prototypes where rapid build iterations trump BOM cost, I don’t recommend purchasing Delrin from them as their sheets don’t have a flatness rating and often gets shipped bent in (oddly sized) boxes. (Seriously, has anyone else gotten a few oddly-sized parts in a gigantic McMaster-box before?)

Internal Stresses

Extruded Delrin has internal stresses built up inside of the sheet. There are a variety of reasons why this could be the case, but my biggest hunch is that the extrusion process at the factory results in different parts of the sheets solidifying at different times as the sheet cools, possibly causing some parts of the sheet to tighten from the cooling before other gooier sections have yet to finish cooling. What this means for you is that as your part gets lased out of the sheet, you’re, in a sense, relieving that stress. As a result, the part that you cut–especially for thin sheets–may come out of the laser cutter slightly warped.

Continue reading “Drawbacks Of Laser Cut Delrin–and How To Slip Around Them”

Why Are You Still Making PCBs?

Few things have had the impact on electronics that printed circuit boards (PCBs) have had. Cheap consumer electronics would not be as cheap if someone still had to wire everything (although by now we’d be seeing wiring robots, I’m sure). Between removing the human from the wiring process and providing many excellent electrical properties (at least, on a well-designed board), it isn’t surprising that even the cheapest examples of electronics now use PCBs.

For many years, the hallmark of being a big-time electronic hacker was the ability to make your own PCBs. There have been many ways that people have tried to bring PCB manufacturing into the hacker’s garage: stick on decals, light-sensitive blank PCBs, and even using laser printer toner (that last one spurred me to write a book on PCB layout many years back). You also see a lot of people using 3D printers or CNC mills to create PCBs. Hardly a week goes by that someone doesn’t ask me how to make a PCB in a home or small business lab.

Continue reading “Why Are You Still Making PCBs?”

This Is What A Real Bomb Looks Like

In 1980, Lake Tahoe, Nevada was a popular tourist spot. The area offered skiing, sailing, hiking in the mountains, and of course, gambling on the Nevada side of the lake. It was in this somewhat unlikely place where the authorities found the largest improvised bomb seen to that date in the USA.

Harvey’s casino was opened by former butcher Harvey Gross in 1944. In less than 20 years it grew to a 192 room, 11 story hotel casino. Thousands of people played Harvey’s slot machines and table games. Some were winners, but most were losers. John Birges was one of the latter. Formerly a successful landscaping company owner worth millions, he lost all of it to his gambling addiction.

Born in Hungary in 1922 as János Birges, John grew up in Budapest. When WWII hit, he flew an Me-109 for the Luftwaffe. He was arrested by the Gestapo for disobeying orders during the war, but was released. After the war, he again found himself in hot water – this time with the Russians. He was arrested in 1948 and charged with espionage. His sentence was 25 years of hard labor in the Gulag. The stories vary, but most agree that Birges was able to escape his work camp by detonating a bomb as a diversion.

In 1957 Birges and his wife Elizabeth immigrated to California. He changed his name from János to John to fit in. The couple had two sons, Johnny and Jimmy. John built up a successful landscaping business and bought a restaurant, working his way into the millionaires’ club. From the outside, they were the perfect example of the American dream.

Appearances can be deceiving. Behind closed doors, Birges was a right bastard to his family. He beat his wife and his children, even forcing them to kneel on gravel when they disobeyed him. Eventually, Johnny left home to escape his father’s fists. Elizabeth filed for divorce, and was later found dead under mysterious circumstances. Birges began gambling heavily, especially at Harvey’s Wagon Wheel casino in Lake Tahoe. He eventually burned through his personal savings, as well as the income from his businesses. The once millionaire was now penniless, but he had a plan. Just as a bomb had helped him escape the Gulag, he’d use a bomb to extort his money back from Harvey’s.

Continue reading “This Is What A Real Bomb Looks Like”

Embed With Elliot: Interrupts, The Good…

What’s the biggest difference between writing code for your big computer and a microcontroller? OK, the memory and limited resources, sure. But we were thinking more about the need to directly interface with hardware. And for that purpose, one of the most useful, and naturally also dangerous, tools in your embedded toolchest is the interrupt.

Interrupts do exactly what it sounds like they do — they interrupt the normal flow of your program’s operation when something happens — and run another chunk of code (an interrupt service routine, or ISR) instead. When the ISR is done, the microcontroller picks up exactly where it left off in your main flow.

Say you’ve tied your microcontroller to an accelerometer, and that accelerometer has a “data ready” pin that is set high when it has a new sample ready to read. You can wire that pin to an input on the microcontroller that’s interrupt-capable, write an ISR to handle the accelerometer data, and configure the microcontroller’s interrupt system to run that code when the accelerometer has new data ready. And from then on everything accelerometer-related happens automagically! (In theory.)

This is the first part of a three-part series: Interrupts, the Good, the Bad, and the Ugly. In this column, we’ll focus on how interrupts work and how to get the most out of them: The Good. The second column will deal with the hazards of heavyweight interrupt routines, priority mismatches, and main loop starvation: the Bad side of interrupts. Finally, we’ll cover some of the downright tricky bugs that can crop up when using interrupts, mainly due to a failure of atomicity, that can result in logical failures and corrupted data; that’s certainly Ugly.

Continue reading “Embed With Elliot: Interrupts, The Good…”