Switching Things On And Off With An Arduino

One of the first projects many people new to the Arduino do is blinking an LED and there many many guides on line. Unfortunately, many of the guides never go beyond the very basic first sketch. In this guide, I hope to help new users take the next step.

Besides the obvious fact that blinking an LED is cool in its own right it is a good exercise because switching an LED on and off is the same process for switching any digital device on and off. Once you can create the code to blink an LED you can create code to turn anything on and off. Of course, you do not need to control an LED, you can use the same methods to do almost anything that is controlled in the same way. For example, I use similar techniques when setting up remote controls using Bluetooth and wifi connections and instead of setting a pin state I send control codes.


Polling vs interrupts
Connecting Arduino pins directly to vcc
Polling. Example 01: Very simply press for on, release for off
Polling. Example 02: Press for on, release for off. Slightly refined
Polling. Example 03: Toggle switch
Polling. Example 04: Multiple states from a single push button switch
Polling. Example 05: Start and stop an action
Interrupt. Example 01: Turning an LED on and off
Interrupt. Example 02: Turning an LED on and off with debounce

Continue reading

HC-05 with firmware 2.0-20100601

There are now many cheap and no brand HC-05 modules that use the 2.0-20100601 firmware and rather than keep making the same post for different modules I will have a single main post which, as I update and add to it, will become a single point of reference.

The 2.0-20100601 firmware is originally by HC/Wavesen and as the version number may suggest it is from 2010. I am not sure if other manufacturers use it under license or simply copy it since the genuine HC/Wavesen modules now use version 2.1 firmware.

HC-05 with 2.0-20100601: AT Command Mode
HC-05 with 2.0-20100601: Connecting to an Arduino
HC-05 with 2.0-20100601: Initial Communications Test
HC-05 with 2.0-20100601: Main AT Commands
HC-05 with 2.0-20100601: AT Commands Dealing With Connections
HC-05 with 2.0-20100601: Making A Connection

Continue reading