Posts | Comments

Planet Arduino

Archive for the ‘wireless hacks’ Category

We’ve covered the Sonoff a few times–a very inexpensive box with an ESP8266, a power supply, and an AC relay along with a way to tap into a power cord. Very inexpensive means $5 or $6. The supplied software will work with several systems (including, recently, Alexa). But what self-respecting hacker wants to run the stock firmware on something with an ESP8266 inside?

[Tzapu] certainly didn’t. But he also knew he didn’t want to start from scratch every time he wanted to deploy a switch. So he built SonoffBoilerplate and put the code on GitHub. The code manages taking configuration (including network settings) using a web-portal, can update itself over the air, and integrates with Blynk and MQTT. If you don’t like that code base, there are other choices including one that has a failsafe reconfiguration mode.

You do have to solder a header to the board to reflash it. Since all of these provide for updating over the air, you could probably press fit the header just to get the initial flash, if you like.

Of course, if you want you can totally reprogram it, too. Or use the stock firmware and control it like all the normal people do.

If you plan to use Blynk, we’ve covered it before. For that matter, we’ve talked about MQTT, too. You can see more details about Sonoff, including a quick reveal of the insides, in the video below.

Filed under: Arduino Hacks, wireless hacks

Hardware hackers are always looking for devices to tear apart and scavenge from. It’s hardly a secret that purchasing components individually is significantly more expensive than the minuscule cost per unit that goes along with mass manufacturing. Bluetooth devices are no exception. Sure, they’re not exactly a luxury purchase anymore, but they’re still not dirt cheap either.

Luckily for [Troy Denton], it seems dollar stores have started carrying a Bluetooth camera shutter for just a few dollars (it was three bucks, perhaps the dollar store actually means divisible-by). The device is designed to pair with a smart phone, and has two buttons allowing you to control the camera from afar. The fact that it works at all at that price is a small miracle, but the device also has potential for hacking that adds to its appeal.

Inside is a Bluetooth chips with integrated ARM controller. It connects to an EEPROM via I2C. Using an oscilloscope, an Arduino, and a Bus Pirate, [Troy] has so far succeeded in dumping and deciphering the EEPROM and was successful in renaming the device. He has high hopes that he’ll be able to discover something juicy from his preliminary explorations of the USART on the Bluetooth chip.

Ultimately he plans to document his quest to rewrite which keys the device’s buttons emulate. Once that’s accomplished, this dollar store find will have a lot of potential for cheap Bluetooth control. If you’re a reverse engineering veteran we’d love to hear some suggestions of low hanging fruit for him to explore. If you’re eager to learn more about about what you can do with Bluetooth, check out our awesome BLE primer.

Filed under: Arduino Hacks, wireless hacks

If you are a regular Hackaday reader, you’ve probably seen plenty of ESP8266 projects. After all, the inexpensive device is a workhorse for putting a project on WiFi, and it works well. There is a processor onboard, but, most often, the onboard CPU runs a stock firmware that exposes an AT command set or Lua or even BASIC. That means most projects have a separate CPU and that CPU is often–surprise–an Arduino.

It isn’t a big leap of logic to imagine an Arduino with an integrated WiFi subsystem. That’s the idea behind the MKR1000. But the real question you have to ask is: is it better to use an integrated component or just put an Arduino and ESP8266 together?

[Andreas Spiess] not only asked the question, but he answered it in a YouTube video (see below). He examines several factors on the MKR1000, the Arduino Due and Uno, and several other common boards. The examination covers performance, features, and power consumption.

We’ve covered a slew of ESP8266 projects. We’ve also seen at least two MKR1000 projects, one for an automotive project and the other controls a shower.

Filed under: Arduino Hacks, wireless hacks

This simple WiFi serial port monitor would have saved us a lot of trouble. We can’t count how many times where being hooked into an Arduino with USB just to get the serial out has nearly been more trouble than it’s worth. Times where we sat cross-legged on the floor and could choose comfort or accidentally shifting the set-up and ruining everything, but not both.

[Frenky]’s set-up is simple and clever. The Ardunio’s serial out is hooked to an ESP8266. The Arduino spams serial out to the ESP8266 in its usual way. The ESP8266 then pipes all that out to a simple JavaScript webpage. Connect to the ESP8266’s IP with any device in your house, and get a live stream of all the serial data. Neat.

As simple as this technique is, we can see ourselves making a neat little box with TX, RX, GND, and VCC screw terminals to free us from the nightmare of tethering on concrete floors just for a simple test. Video after the break.

Filed under: Arduino Hacks, wireless hacks

In the dark ages, you had to use a key to lock and unlock your car doors. Just about every car now has a remote control on the key that lets you unlock or lock with the push of a button. But many modern cars don’t even need that. They sense the key on your person and usually use a button to do the lock or unlock function. That button does nothing if the key isn’t nearby.

[Pierre Charlier] wanted that easy locking and unlocking, so he refitted his car with a Keyduino to allow entry with an NFC ring. What results is a very cool fistbump which convinces your car to unlock the door.

Keyduinio is [Pierre’s] NFC-enabled project, but you can also use a more conventional Arduino with an NFC and relay shield. The demo also works with a smartphone if you’re not one for wearing an NFC ring. Going this round, he even shows how to make it work with Bluetooth Low Energy (BLE).

In the video below, you can see how he removed the car’s internal lock switch and modified the wire harness to take the connection to the Arduino. He’s also included all the code. About the only tricky part is doing the actual wiring in your car and finding a suitable source of power. That varies from car to car, so it isn’t easy to give specific instructions.

Opening doors of one kind or another is a popular project theme. While [Pierre’s] project might open the door on a coupe, we’ve seen another project that works on a coop.

Filed under: Arduino Hacks, car hacks, wireless hacks

[Akiba] over at FreakLabs just put up a detailed tutorial outlining how to control and sequence lighting wirelessly using an Arduino and Vixen lighting sequencer software.

For those that don’t know [Akiba], he’s the guy behind Wrecking Crew Orchestra (TRON Dance) and their EL wire costumes. [Akiba] hacks on his projects at Hacker farm out in rural Japan.


In the tutorial, he sets up a simple 6 LED circuit on a Fredboard (an Arduino compatible board with integrated breadboard). [Akiba] then describes configuring the Vixen sequencer software to control the Arduino, providing simple example code to decode the Vixen serial protocol. Finally [Akiba] shows how to use the ChibiArduino protocol stack to build a wireless illumination system.

[Akiba] has used these tools in many stage performances including with the Wreaking Crew Orchestra (shown above) and the world number 1 flair bartending crew, UPT.

This tutorial is particularly awesome, as it includes both step-by-step videos and a text reference. The videos give a great overview of the process, while the text provides a handy reference to refer to as you hack on your own illumination projects.

Thanks for the writeup [Akiba]! With Christmas just round the corner we hope to see readers using these techniques in their own festive illuminations soon!

Filed under: Arduino Hacks, led hacks, wireless hacks

Historically when hams built low power (QRP) transmitters, they’d use a crystal to set the frequency. Years ago, it was common to find crystals in all sorts of radios, including scanners and handheld transceivers. Crystals are very stable and precise and it is relatively easy to make a high quality oscillator with a crystal and a few parts.

The big problem is you can’t change the frequency much without changing crystals. Making a high quality variable frequency oscillator (VFO) out of traditional components is quite a challenge. However, today you have many alternatives ranging from digital synthesis to all-in-one IC solutions that can generate stable signals in a wide range of frequencies.

[N2HTT] likes to build radio projects and he decided to take an Si5351 clock generator and turn it into a three frequency VFO for his projects. The Si5351 uses a crystal, so it is very stable. However, you can digitally convert that crystal frequency into multiple frequencies over a range of about 8kHz to 160MHz.

The chip has two PLLs that multiply the crystal frequency by a programmable amount. Then you can set each channel to start with the crystal frequency or either PLL and divide it by an integer or a fractional amount. As you might expect, the integer divisions result in a more stable output, but if you really need a particular frequency and can accept some jitter, you can get almost anything you want out of the device.

The device [N2HTT] used is in a tiny 10 pin MSOP package, but there are plenty of inexpensive breakout boards available. You control all the multiplying and dividing by sending configuration data to the chip via I2C. There’s even a software package that can tell you the best settings for the frequencies you want to generate.

One thing of interest is the breadboard the VFO is built on. [N2HTT] used an Arduino and a small display along with an encoder to control the chip. But the chip generates some high frequencies and common wisdom is that solderless breadboards aren’t good for high frequency. Acting on a tip he read in a magazine article [N2HTT] took a bamboo cutting board and then affixed standard solderless breadboards to unetched copper PCB material. He then made sure the PCB ground planes were well connected and grounded. It seems to work (you can see it working in the video below).

The output of the chip is a square wave, so if you wanted to use it for radio applications, you’d probably have to low pass filter the output to get a sine wave. The device is only as accurate as the crystal and will exhibit some phase noise and jitter (especially if you don’t have integer divisions). However, having a wide range programmable frequency source for a few bucks is a great building block for lots of different projects.

In fact, we covered a project to use the same part to implement a digital communications mode a few months ago. There’s also more than one Arduino library out there. Since it is I2C, you can use it with many other processors, too.

Filed under: Arduino Hacks, wireless hacks

The number of things that can carry Internet traffic is always increasing. Now, you can add LED light bulbs to this list, as engineers in Disney Research have just demonstrated a system that transmits Internet traffic using an LED light bulb. This method of communication isn’t new: Visible Light Communication (VLC) has been demonstrated before by Disney and others, but this project puts it into a standard LED light bulb. This bulb has been modified to include an Atheros AR9331 SoC running OpenWRT and an Atmel ATmega328p that controls the LED elements and sensors that send and receive the data. So, the device is acting as a gateway between a WiFi network and a VLC one.

Disney’s new test system (PDF link) isn’t especially fast: it can only carry about 380 to 400 bits per second, so it won’t be streaming video anytime soon. That is definitely fast enough, though to send control data to a toy, or to send a continual stream of updated data to a device in the room, such as an ebook reader with a continually updated encyclopaedia. This being Disney, the authors coin a new phrase to end their paper: The Internet of Toys.

Filed under: Arduino Hacks, led hacks, wireless hacks

In August of 2014, something new started showing up in the markets of Shenzen, 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.

ESP8266 Decapped
A decapped ESP8266, with area of interest marked by Reddit user swimmerdude. The big area on the right is memory

Why Is the ESP8266 Important?

The ESP8266 almost achieves the holy trifecta of electronics: cheap, powerful and easy to work with. Before this, if you wanted to add a wireless connection to a project, you had to use more power-hungry devices like USB WiFi dongles, or squish everything into a serial connection and use a wireless serial link. Either way added to the complexity of the project: you either needed a system that supported USB and had WiFI OS support, or you had to put up with the limitations of wireless serial links, which typically offer very limited bandwidth. The advent of WiFi SoCs removed these limitations because the SoC did the heavy lifting, and WiFi offered much more bandwidth. And the ESP8266 did this all at a very low cost: do some digging on eBay and you can get an ESP8266 board for less than $2. So, it is no surprise that we are starting to see the ESP8266 showing up in commercial products

How Can I Use the ESP8266?

With the popularity of the ESP8266 for adding WiFi to projects, it is no surprise that there are a lot of options for trying it out. On the hardware side, ESP8266 development boards are available from a number of places, including Seeedstudio, Sparkfun and Olimex. Adafruit also has a nice ESP8266 board that breaks out all of the signals for easy breadboard use, and adds a 3.3V output, so it can drive an external device. It is also FCC approved, which is important if you are looking to sell or use the devices you build commercially. Some users have also been building their own development boards, which add features such as LCD displays and buttons.

The Adafruit Huzzah ESP8266 dev board
The Adafruit Huzzah ESP8266 dev board

On the software side, the easiest way to get into the ESP8266 is to use the Arduino compatible mode. This involves loading custom firmware that turns the chip into a mid-range Arduino board, which makes for much easier programming. The people behind this project have produced a list of supported ESP8266 boards: buying one of these will make the installation process easier, as they have noted which data lines in the Arduino SDK correspond to the physical pins on the board. These boards also provide easy access to the reset lines that you have to use to install the Arduino compatible firmware.

This does include some limitations, though: it is rather complicated to upload new sketches over WiFi, and you can’t produce multiple PWM signals, which would make controlling multiple devices difficult. To get access to the full capabilities of the ESP8266, you’ll need to go to the source, and use the SDK that the manufacturers offer. [cnlohr] published an in-depth guide here on Hackaday for bare-metal programming the ESP8266 whih was mentioned earlier. Espressif also offer a pretty good getting started guide that covers creating a virtual Linux machine and connecting this to their chips.

The third option is to flash NodeMCU to the ESP8266 module. This turns it into a Lua interpreter. Scripting can be done in real-time to prototype your program, then flashed to the EEPROM to make your program persistent and remove the need for a serial connection.

Beginners will be comfortable with both the Arduino and NodeMCU approaches, but experienced users should be able to wade straight in and start writing code for this cheap, powerful and fairly easy to use chip.

Filed under: Arduino Hacks, Hackaday Columns, wireless hacks

These days, connecting your microcontroller project to a WiFi network is pretty easy — you connect up an ESP8266 to your microcontroller project and pretend it’s a WiFi modem, using these old-school-style AT commands. But what do you do if you need to flash new code into the microcontroller? You can’t reprogram the micro remotely through the ESP8266 because those stupid AT commands get in the way.

The solution? By flashing the esp-link firmware into your ESP8266, you talk directly to the microcontroller over WiFi as if it were connected by a serial cable: the ESP8266 becomes a totally transparent WiFi-serial bridge. Now, with a serial bootloader and an ESP8266 in Wifi-to-serial bridge mode, you can reflash your microcontroller wirelessly, and then telnet in to interact with and debug the system remotely. Once you’ve fixed the bugs, you can re-flash the microcontroller: all over WiFi, without having to climb up a ladder to reach your IoT attic-temperature sensor.

To flash a connected Arduino, for instance, all you need to do is convince AVRDUDE to use the network instead of a locally-connected USB-serial cable: avrdude -p m328p -c arduino -b 115200 -P net: -U:yourHexFile.hex. The ESP8266 passes the data straight through its TX and RX lines to your microcontroller and everything works as if it were wired.

Configuration to allow the ESP8266 to join your WiFi network takes place on a self-hosted webpage that uses [Sprite_tm]’s esp-httpd standalone server, which makes setup pretty painless. And then after that you can simply telnet to the ESP8266 at port 23 and type away, or do anything else you would with a wired serial connection.

Although the simple bridge mode came first, esp-link looks like it’s growing to be a one-stop shop for all your IoT or microcontroller + WiFi needs. In addition to the serial bridge code, there is also a REST-based microcontroller-to-internet mode and there is bi-directional MQTT support in the wings. We haven’t had a chance to dig into these yet, so if you have, let us know in the comments.

If you want to dig in deeper, head over to [Jeelabs]’ blog for a slightly outdated tour of the project written by the code’s author, [Thorsten von Eicken]. For the most up-to-date development news, follow the very active development of esp-link in this thread on the esp8266 forums.

Filed under: Arduino Hacks, ARM, wireless hacks

  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook