Posts | Comments

Planet Arduino

Archive for the ‘ESP8266’ Category

You don’t have to be an extinct mammal or a Millennial to enjoy the smooth, buttery taste of an avocado. Being psychic on the other hand is definitely an advantage to catch that small, perfect window between raw and rotten of this divaesque fruit. But don’t worry, as modern problems require modern solutions, [Eden Bar-Tov], [Elan Goldberg], and [Mizpe Ramon] built the AvoRipe, a device to notify you when your next avocado has reached that window.

Taking both the firmness and color of an avocado as indicators of its ripeness into account, the team built a dome holding a TCS3200 color sensor as stand for the avocado itself, and 3D printed a servo-controlled gripper with a force sensor attached to it. Closing the gripper’s arms step by step and reading the force sensor’s value will determine the softness the avocado has reached. Using an ESP8266 as centerpiece, the AvoRipe is turned into a full-blown IoT device, reporting the sensor readings to a smartphone app, and collecting the avocado’s data history on an Adafruit.IO dashboard.

There is unfortunately one big drawback: to calibrate the sensors, a set of nicely, ripe avocados are required, turning the device into somewhat of a chicken and egg situation. Nevertheless, it’s a nice showcase of tying together different platforms available for widescale hobbyist projects. Sure, it doesn’t hurt to know how to do each part from scratch on your own, but on the other hand, why not use the shortcuts that are at our disposal to remove some obstacles — which sometimes might include programming itself.

Unless you’ve held on to an old tube TV, did the hack that lets you use a light gun with an LCD via Wiimote receiver and a couple of microcontrollers, or live close to one of those adult arcades, you might be really jonesing to play Duck Hunt by now. It’s time to renew that hunting license, because [Danko] has recreated the game for NodeMCU boards, and it’s open season.

Instead of ducks, you get to shoot cute little Twitter-esque birds of varying sizes and point values, and a tiny cab-over truck if you wish. There’s a 60-second free-for-all, and then time is up and your score is displayed. As a special bonus, there’s no smug dog to laugh at you if don’t hit anything. Be sure to check out the demo and build video after the break.

This pocket console lives on a nicely-wired breadboard for now while [Danko] works on a custom PCB. He’s also planning to add support for Arduboy games in the future, and maybe a joystick instead of a D-pad of buttons.

There are a lot of myths floating around about how the old CRTs read the NES light gun, but our own [Will Sweatman] shot them down in his fascinating Duck Hunt: Reloaded write-up.

Over the last few years, the price of a good digital picture frame has dropped to the point that we don’t often see DIY versions anymore. As much as we might hate to admit it, it’s hard to justify building something yourself when the economies of scale have made it so you can buy the final product for less than the cost of the parts themselves. But of course, there are always fringe cases where building it might be the only way to get what you need.

Granted we’re not sure that [Tony Liu] actually needs a 1.8-inch digital picture frame, but we’re sure somebody out there does. The ST7735R display used in this project is a real TFT, so the color and refresh rate is pretty good; but with a resolution of just 128×160, we’d recommend keeping your expectations low in regards to visual fidelity.

What’s really interesting about this project is how low the part count is. All you need is the ST7735R display and the ESP8266 itself (or the development board of your choice, naturally). Even the 3D printed frame is technically optional. The display is driven by SPI, so with the power added in, that’s only eight wires that need to be soldered between the two devices. If you’re looking for an easy way to add a photo slideshow to a small device, say a conference badge, this is about as easy as it gets.

But where are the images coming from? You might think SPIFFS, but in this case [Tony] has converted the images to bitmaps and is loading them into the Arduino Sketch as a header file with PROGMEM. Helpfully, he provides the link for the tool he uses to convert the images into an array the graphics library can understand. This makes adding new images slightly time consuming, but we imagine if you have the need for something like this, it’s probably only showing a pretty specific set of images anyway.

If you’re looking for something bigger, or maybe just an excuse to put that dusty Raspberry Pi to use, you might be interested in one of the more substantial builds we’ve seen over the years.

With the latest release of Arduino IoT Cloud (version 0.8.0) we did a lot of work behind the scenes, and while it might be transparent to most users, it introduced some big changes. But the one we’re most excited about is that the Arduino IoT Cloud has begun supporting a number of third party devices.

Starting  with the uber-popular ESP8266 by Espressif — NodeMCU, Sparkfun’s ESP Thing, ESPDuino, and Wemos (to name a few) — along with other inexpensive commercially available plugs and switches based on this module. You can now add one to your Cloud Thing and control it using our intuitive web-based Dashboard.

Like every new release, there were plenty of obstacles to get around, especially providing security between the third party boards and the  Arduino IoT Cloud, where there’s no possibility to go through our secure certificate provisioning process because the hardware is lacking an essential component: the cryptographic element.

The Arduino IoT Cloud was born with security in mind and developed around the Arduino MKR series of boards featuring Microchip’s ATTECx08, an encryption chip capable of elliptic-curve cryptography. These boards store the bits necessary to authenticate with a server in a very secure way, guaranteeing your board is connecting to the real server and exchanging data over TLS.

When it comes to boards that don’t have enough RAM and do not feature such cryptographic elements, we had to enable a secondary way to get in. Data transfer will still be encrypted over SSL, but the server authentication part will be a little less strict, allowing the Arduino IoT Cloud to be available to a wider user base. Nevertheless, we do inform users that if they want the highest levels of security they’ll have to use a board which embeds a cryptographic chip. As more and more IoT device users become concerned with security, manufacturers are starting to implement such technologies. We have just recently seen standalone ECC modules which can be paired with your microcontroller of choice. It’s looking bright, and we’re proud to have been amongst the first to bring about this change.

For third party boards without a crypto chip, we had to extend our API and allow the creation of a device-exclusive unique identifier (which will be used as a username) and the generation of a Device Key, providing the final user to access the platform using a username: password pair. 

Internally we already used those tools and APIs; we’re just opening them up for use by a broader audience.

One small requirement for this to work is that you’ll need to upgrade your Arduino Create plan to the ‘Maker plan.’ This will give you access to ESP8266 compilation and IoT Cloud pairing of the device. The Maker plan will also extend the amount of original Arduino boards and Things you can create and manage.

This is just the first step in opening up to more and more hardware, and we have a lot of things lined up for our users. We really hope you’ll enjoy the ease of development and the tools to bring your application to the Cloud in the shortest possible time.

Head over to Arduino IoT Cloud and show us what you got!

Light painting has long graced the portfolios of long-exposure photographers, but high resolution isn’t usually possible when you’re light painting with human subjects.

This weekend project from [Timmo] uses an ESP8266-based microcontroller and an addressable WS2812-based LED strip to paint words or custom images in thin air. It’s actually based on the Pixelstick, a tool used by professional photographers for setting up animations and photorealism shots. The equipment needed for setting up the light painting sticks runs in the order of hundreds, not to mention the professional camera and lenses needed. Nevertheless, it’s a huge step up from waving around a flashlight with your friends.

The LED Lightpainter takes the Pixelstick a few notches lower for amateur photographers and hobbyists. It directly supports 24-bit BMP, with no conversion needed. Images are stored internally in Flash memory and are uploaded through a web interface. The settings for the number of LEDs, time for the image row, and STA/AP-mode for wireless connections are also set by the web interface. The project uses the Adafruit NeoPixel, ArduinoJson, and Bodmer’s TFT_HX8357 libraries for implementing the BMP drawing code, which also allows for an image preview prior to uploading the code to the microcontroller. Images are drawn from the bottom row to the top, so images have to be transformed before updating to the LED painter.

Some future improvements planned for the project include TFT/OLED support, rainbow or color gradient patterns in the LEDs, and accelerometer or gyroscope support for supporting animation.

There aren’t currently too many galleries of DIY LED-enabled light paintings, but we’d love to see some custom modded light painting approaches in the future.

This isn’t the first LED light stick we’ve seen, if you’re interested in such things.

In the movie Wall-E, future humans live in floating chairs and have everything done for them. Today, we grumble if we have to go to physically find a light switch or a remote control. How far away can floating chairs with screens be? T2, the Tea Bot, gets us one step closer to that. Using a laser-cut frame, an ESP8266, and a servo motor, the T2 brews your tea for exactly the right amount of time.

We were kind of hoping the robot would at least dunk the tea bag in and out, but it does provide a web interface that lets you select the brew. Of course, the code is available, so you could make modifications — maybe turn on a hotplate underneath the cup.

While this isn’t particularly practical for most people, it is a nice short example of how to provide a web interface and do something with an ESP8266. Maybe you want to lock a desk drawer or put a marshmallow into a flame, for those tasks you could use very similar code.

Since a servo takes a pulse width and draws very little current, you could probably drive a bunch of them and parallel process a lot of teacups if you were serving a crowd. Naturally, this isn’t the first automated brewer we’ve seen. It isn’t even the only one with a servo.

Potentially, one of the great things about having a device connected to the network is that you can update it remotely. However, how do you make that happen? If you use the Arduino setup for the ESP8266 or ESP32, you might try [scottchiefbaker’s] library which promises to make the process easy.

Adding it looks to be simple. You’ll need an include, of course. If you don’t mind using port 8080 and the path /webota, you only need to call handle_webota() from your main loop. If you want to change the defaults, you’ll need to add an extra call in your setup. You also need to set up a few global variables to specify your network parameters.

The only caveat is that long delay statements in your loop can block things from working and aren’t a great idea anyway. If you have them, you can replace all your delay calls with webota_delay which will stop the system from ignoring update requests.

The code started from a different online tutorial but packaged the code up nicely for reuse. To do an update, simply navigate to the device with a web browser and use the correct port number and path. From there you can upload a new binary image taken from the Arduino IDE with the export compiled binary command.

The only concern we saw was the code didn’t appear to authenticate you at all. That means anyone could load code into your ESP. That might be ok on a private network, but on the public Internet it is surely asking for trouble. The original tutorial code did have a hardcoded user and password, but it didn’t look very useful as the password was in the clear and didn’t stop you from uploading if you knew the right URL. Dropping it from the library probably makes sense, but we would want to build some kind of meaningful security into anything we deployed.

If you have a network connection, we’ve seen the same trick done with a normal Arduino with a wireless chip. You can even do it over WiFi but using an ESP8266 which you’ll then want to be able to update, too.

It used to be that Web browsing was simple. You asked a server for some text, which was duly sent, and then formatted by your browser. Now a web page is as likely to be a full-blown application that is reading mail, editing text, or lots of other things and may use WebSockets to create a back channel to the server. Thanks to affordable hardware like the ESP8266 one of those things a modern web browser can do is sense and control the real world. [Acrobotic] has an interesting video about using WebSockets to allow a browser to talk to an ESP8266 web server in real time. You can see his simple demo in the video below.

Of course, you’ll use the usual language you use on the ESP8266 — [Acrobotic] uses C++ in the Arduino IDE. On the browser side you’ll use JavaScript, although that will be embedded in your C++ program which acts as a web server.

It’s as well to remember that there are several other ways you could do this. You could, for example ask for a different URL, or pass data in a query string. The problem here is that the performance would suffer as you have to establish a new connection every time. you want to transact with the server. You could also use AJAX methods but they are not as efficient either since they are primarily aimed at updating a portion of a web page dynamically. The web socket is simple enough and as you can see in the video, the performance is quite good. It also facilitates non-browser based clients that use the same service.

We’ve seen this technique used to fly a quadcopter. WebSockets have been around for a while, so your browser should support them. If it doesn’t, though, you can always use this hack — at least in one direction.

Connecting your shiny new ESP8266 to WiFi can be as simple or as complicated as you please. Most people decide to manually add it. Some people find clever ways to make the bloody thing connect itself. [Eduardo Zola] transfers his WiFi password using the flashing light of a smartphone screen.

A simple photo-resistor and a bit of tinkering allows him to easily send credentials — or any data really — to his ESP8266, through the power of LiFi. Short for Light Fidelity, LiFi transmits data using light with on and off states representing digital values. It can use visible light, or reach into either the ultraviolet or infra-red radiation if need be. For the nitty-gritty details on the subject, check out our primer on LiFi.

 A flashing LCD screen and a photo-resistor barely make the cut for a one-way LiFi system, but [Eduardo Zola] makes it work. The approach is to build a resitor divider and watch an input pin on the ESP for changes.

The trick is to keep ambient light out of the mix. The test sensor shown here places the LDR in a black cap, but [Eduardo] 3D-Printed a slick little enclosure for his reverse flashlight so it fits flush with the phone screen. One click and about half a minute of a flashing screen later, and the Wi-Fi credentials are transferred. This circuit could really be added onto any project, for short data transfers. With a bit more work on the sensor circuit, speed could be improved with the limiting factor being the timing on the phone screen itself.

Since the ESP8266 has its own WiFi connection, it’s likely you’ll use that for data transfer once the LiFi gets it onto the network. But any situation where you don’t have a full user input or a network connection could benefit from this. Pull out that old scrolling LED matrix project and add this as a way to push new messages to the device!

When [Im-pro] wants a display, he wants it to spin.  So he built a persistence of vision (POV) display capable of showing a 12-bit color image of 131 x 131 pixels at 16 frames per second. You can see a video about the project below, but don’t worry, you can view it on your normal monitor.

The project starts with a Java-based screen capture on a PC. Data goes to the display wirelessly to an ESP8266. However, the actual display drive is done by an FPGA that drives the motor, reads a hall effect index sensor, and lights the LEDs.

Perhaps the most interesting part of the project is the FPGA-based mapping of the rectangular coordinates of the incoming video to the polar coordinates required by the display. There are 4 arms of LEDs or “wings” and a 3D printed structure that is all included in the post.

The FPGA is a Cmod S6 which is a breakout board for a Xilinx Spartan 6 with more than enough horsepower to handle the workload. There are also custom PCBs involved, so when you think about it, it is a fairly wide-ranging project. Java software, ESP8266 software, FPGA configurations, a 3D-printed design, and PCB layouts. If you want something simple to tackle that has a bit of everything in it, this might be your next project.

Most of the POV displays we see don’t have this kind of color-depth and resolution. We’ve seen displays built around fans. Our favorite, though, is the dog speedometer.



  • 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