If you have any interest in retro computing or technology, The 8-Bit Guy is one of the best YouTube Channels. His latest video hits a little closer to home. He shows how to Character LCDs work and how to hook them up. He always does a great job with his videos, so I encourage you to check out some of his others.

He’s has some other good videos such as the one on how 8-bit video game graphics worked and, one of my favorites, how disk drives worked.

Share projects on one of these 4 platforms

Contribute back to the open source hardware community

share projects

Sharing is the maker community’s foundation. When you share projects with others, you contribute to the community. In the past, you might just post your project on a personal website. Today there are many options to share projects.

This weekend I “finished” my reflow oven controller, Open Vapors. Believe it or not, five years ago there were not a bajillion similar projects. In fact, I based my design on the only completely open source project I found. It is a reflow oven controller Arduino shield from Rocket Scream.

After completing my controller, I was excited to share the project. Then I started to think about where to post the files. Obviously, here at baldengineer.com is one option. But I wondered. Is there a better place where others could benefit from my work?

This post is a few notes on the platforms used to share projects. At first, these might seem like they all serve the same purpose. From a high level that is true. However, there are small differences that you should consider when you share projects with the open source hardware community.

Continue Reading »

Detect short and long button press using millis

Different actions based on how long the user presses a button

detect short long button press using millis

To detect a short and long button press using millis can give your project more functionality without adding more buttons. In this line-by-line example, I show how to react to a user pressing a button for a short period (100ms) or a long period (over 500ms). My example changes the blink rate of an LED on short presses. A long button press turns off the LED.

In the code, I make use of a struct so that a single variable can be used to track multiple parameters. The benefit of this method is that adding multiple buttons is easy. You could create an array of these tyepdef’d variables.

Download At GitHub

Continue Reading »

Best Sorting Resistors Method 

At least, according to me.

sorting resistors method

When you buy a grab bag of components, you might need to tackle sorting resistors. Here’s how I sorted some bags of random resistor assortments last week.

Objectives

Then method I use for sorting resistors achieves these objectives:

  1. Fewer Bins. It doesn’t take long to create a large matrix of resistor values. My resistor sorting method is relatively compact.
  2. Quick to find. When I’m building up a circuit, I don’t want to spend time sorting through a pile. Once I know the value I need, I find a single package and then look for a single color band.
  3. Works with 4-band and 5-band resistors. Let me be upfront: I *hate* 5-band resistor color codes. While the 5th ring is supposed to be slightly offset, or wider, or a different type of color; it doesn’t matter. It’s nearly impossible to tell read a 5-band resistor color code when they are in a pile. However, using my method for sorting resistors, it doesn’t matter if I’m looking at a 4-band or 5-band resistor. I can immediately identify the resistor value.

Based on #3 alone, you might be wondering what is the fantastic method (and how much will it cost to get it!) Here’s the basics of my method for sorting resistors. (For FREE!)

Continue Reading »

Arduino Data Logger: Serial Monitor Alternatives

Forget the serial monitor, here's 5 other ways to do Arduino data logging

arduino data logger options

The Arduino serial monitor is usable when you want to watch data from an Arduino. However, it does not have a built-in method for saving the data. Here are some ideas if you want to build an Arduino data logger with or without a PC.

Important note on Arduino Data Logger examples

With all of these examples, please remember that whenever you open the Arduino’s serial port, the board will reset. So if your log file shows “Initializing SD card…” with a few data lines in between, it is because there is a reset happening.

Initializing SD card…initialized.
Temp: 34, Time: 03:24:44
Temp: 33, Time: 03:24:45
Temp: 34, Time: 03:24:46
Tem

Initializing SD card…initialized.
Temp: 34, Time: 03:24:50
Temp: 34, Time: 03:24:51
Temp: 33, Time: 03:24:52
Temp: 34, Time: 03:24:53

In that code you can see data logging started and then restarted. What happened is that after programming, the board starts logging. Then when you open the Serial Monitor, the data logger restarts.

To solve this issue, either disable auto-reset, add a 3-4 second delay at the start of setup(), wait for a character to be received, or wait for a button press. That will give you time to open the Serial Monitor.

Continue Reading »

Sending simple serial commands to an Arduino

Don't send words when characters will do

sending simple serial commands arduino

Sending simple serial commands to an Arduino is the easiest way to communicate between an Arduino and a computer. The computer could be a PC, a Raspberry Pi, or any device that communicates with serial.

By sending and “decoding” a single character it is easy to add a simple debug menu or even serial menu. Plus, it is easy to extend.

Single Character vs. Full Words

The mistake I see many people make is that they try to send full-text strings as serial commands. For example, to turn on a LED, I have seen (silly) commands like “RED LED ON” or “RED LED OFF.” While you could use something like strcmp(), as I showed on the Multiple MQTT Topics example, that tends to be overkill for most serial commands.

Humans like words, computers like binary. Just send one character over serial.

switch (variable) {
  case ‘a’:
	// A Stuff

  case ‘b’:
  case ‘c’:
	// B and C Stuff
  break;
}

Continue Reading »

Multiple MQTT Topics with Arduino PubSubClient

Adding a few more subscriptions is pretty easy.

multiple mqtt topics

In my Arduino MQTT Examples, I kept things simple by only subscribing to a single topic. One of the strengths of MQTT is that a device can subscribe (or publish) to multiple topics. The broker will sort things out. Even though my first example only showed one, it is straight forward to get the Arduino PubSubClient library to subscribe to Multiple MQTT topics.

The quick answer is that you need to look at the MQTT response to find out which topic sent the payload.

tl;dr version

If you’re looking for a quick answer, here’s the magic code we’ll add to the callback() function.

void callback(char* topic, byte* payload, unsigned int length) {
if (strcmp(topic,"pir1Status")==0)
  // whatever you want for this topic
}

Keep reading for a more detailed explanation of how to Subscribe to Multiple MQTT topics with Arduino’s PubSubClient. Obviously, this code will work on Arduino boards with a TCP/IP interface and, of course, the ESP8266 based boards.

Continue Reading »

It is commonly known that ceramic capacitors change capacitance with applied voltage. What isn’t always as well known is how strong this effect can be and why it occurs. At KEMET we’ve put together a technical video that answers that question.

What is Ask An FAE?

Ask An FAE is a new video series we launched at my day job, KEMET. An FAE is a field application engineer. These engineers are very common in the electronics industry. Companies like KEMET, where I work, have FAEs who meet with customers to answer technical (and very detailed) questions about how to use their products. In UBM’s Mind of an Engineer survey, FAEs were ranked as one of the top information sources for design engineers.

At KEMET we decide to use FAEs to answer the questions. While I’m not an FAE today, I was in the past and happy to kick off the series with our CEO.

Check out KEMET’s Ask An FAE

Mooshimeter Review – Smartphone Multimeter

Can your phone replace your DMM?

Mooshimeter Review

For fifteen years I used my Radio Shack 22-168A digital multimeter as my go-to meter. A couple of years ago I bought a Fluke 115. Not because the RS meter lacked a measurement, but because I wanted a backlit screen. Here’s the crazy thing though in 20 years of multimeter development, there hasn’t been much innovation. Well outside of maybe auto-ranging.

All three meters I have, plus the Virtual Bench I reviewed about a year ago all continue to have the same limitation: they can only perform one measurement at a time. That’s one feature that makes my latest meter, the Mooshimeter, unique. It can measure both voltage and current at the same time. Oh, and it doesn’t have a screen.

Continue Reading »

Fading LED: analogWrite millis() Example

Add a fading LED without delay()

Fading LED millis() Example

It’s a well-known fact of engineering: LEDs make everything look better. And that means a Fading LED is even better. Using Arduino’s analogWrite(), fading a LED is just a matter of a loop. If you use delay(), you can’t easily add other actions. What can you do? Well, Fading a LED with millis() is pretty simple. Here’s the code to do it and a quick explanation.

Continue Reading »