Tag

ESP8266

Browsing

Funny how a simple idea can spider out into multiple paths. Arduino EEPROM seemed like a straightforward concept. A few a years ago it was as easy as having either 512 or 1024 bytes of flash memory. The Arduino IDE offered an EEPROM library which let you read and write a single byte. Today, however, with many different processor architectures saving data to EEPROM varies. It is now possible to save any datatype to EEPROM but not on all boards and not all using the same method.

While programming an coin accepter sold by Adafruit on an AddOhms live stream, I discovered two “new” methods in the Arduino library. At least, these functions are new to me! A couple of years ago EEPROM.get() and EEPROM.put() appeared. Using these functions, you can store any datatype in EEPROM.

This post covers tidgets related to using Arduino EEPROM to store any value across multiple boards, or platforms. Specifically boards such as the Uno, Nano, Mega, and Zero are covered. Additionally Arduino-compatible boards from Espressif, PRJC, and Adafruit are covered as well.

My recent SONOFF WiFi Switch experience reminded me of something from high school. I attended an off-site electronics class with my best friend. As teenage boys, we were prone to doing stupid things. One of our favorite games was to see who could handle the highest voltage. Our bench had a variable AC supply that went from 0 to 120 volts. So we would grab the alligator clips while the other person slowly turned the knob up. John once made it to 50 volts. I seem to recall my tolerance around 30 volts. First, DO NOT do this. It was stupid. Second, I think this game is why handling AC makes me so uncomfortable.

While I am not an electrician, I do know the basics about wiring mains AC circuits. So when one of my studio lights needed a new switch, I was okay to replace it. Mains AC does not scare me when it is off. I did not have a mechanical switch available. Instead, I opted for a SONOFF WiFi Switch. I did not intend to connect WiFi, at least not yet. I just wanted to control the light with the manual push button.

The clever solution seemed to be clever, at least for a few minutes. Suddenly the light turned off. I thought maybe there was a timeout for the manual button. Annoying, but workable. The lamp remained off for about another 2 minutes when I started to smell that unmistakeable burning plastic odor. Touching the case of the SONOFF identified the culprit immediately.

Great. So I have an AC mains switch that isn’t working, but I do not want to go poking my multimeter into it. What do I do?

Turns out, that SONOFF module was defective. I wanted to debug it, but I did not want to measure anything while connected to AC. Here’s how I used a thermal camera to debug my SONOFF.

What is a SONOFF?

The SONOFF WiFi switch is an inexpensive AC relay. Internally it has an ESP12 chip, which became popular with the ESP8266. There is even an unpopulatd serial header which can be used to reflash the firmware. Among hackers, these modules are a popular way to get an AC relay that is easily programmed.

Back in 2013, a Kickstarter ran for a project to put a python interpreter on a microcontroller. At the time I could not see the benefit. Cool project, but I asked myself: “why?” On my last Adafruit order, I received a free Circuit Playground Express. The board comes with CircuitPython pre-installed. After playing with Circuit Python, or CP, I finally “get it.”

For Valentine’s Day, I made an animated LED heart for a new love in my life, Circuit Python. Well, love is a bit of a strong word. The past couple of weeks I have been learning Circuit Python, and I am excited by what it offers.

What is Circuit Python?

It is a Python implementation that runs on microcontrollers. The code exists on the microcontroller as text. The interpreter runs the code from that text file. Circuit Python is built on, or based on, MicroPython. Adafruit is designing it to teach programming. It is easy to get started, just open up the code.py file from the auto-mounted drive and start typing. When you hit save, the code runs. That’s it.

Four days ago, I found out I needed to make a piece of a costume. The idea was to combine a TFT LCD with a microcontroller and Bluetooth Low Energy. I checked my microcontroller bin and found some Adafruit Feather Boards. In this post, I will introduce the feather family and provide a decision chart for choosing the right one for your project.

The Feather board have a standard footprint and pinout. Most(All?) have a USB connector, a microcontroller, two rows of pins, and a battery charger. They measure 50.80 by 22.86 mm, which is 2.0 by 0.9 inches.

The Zener diode is often used to create a reference voltage. In tutorials and even college texts, there are mentions of creating a Zener diode based regulator. The idea is that the Zener maintains a known voltage drop. The problem is that current matters. This post looks a quick Zener diode overview and shows what happened when I tried to power a microcontroller using a “Zener diode regulator.”