Embedded electronics are in a countless number of devices and appliances, with microcontrollers at the heart of the operation. A microcontroller is a compact integrated circuit that controls a specific operation in an embedded system. There was a time when only BASIC stamp microcontrollers, with a simple interpreter, were available for designing, prototyping, and testing…
Arduino compatible coding 02: Getting started with Arduino
Arduino are single-board microcontrollers that are easily programmable through a USB connection. They are used with electronics to design embedded system prototypes, the Internet-of-Things (IoT), and electronic gadgets. Much like other microcontrollers, Arduino provides software-backed computing and embedded control to basic electronics applications. That means getting started with Arduino is no different than with other…
Arduino compatible coding 03: Basics of Arduino sketches and Embedded C
The previous tutorial included a discussion about the tools and components necessary to get started with Arduino. However, before starting with Arduino UNO (or any other Arduino board) — and experimenting with hardware projects on various sensors, actuators, and modules — it’s important to get through the basics of Arduino sketches and the embedded C…
Arduino compatible coding 04: Interfacing and driving LED by digital output
In the previous tutorial, we discussed the basics about Arduino sketches, with a a quick Arduino language reference. Now, it’s time to get our hands dirty. Interfacing LED and driving digital output from a source is the “Hello World” of embedded systems. As discussed in the previous tutorial, a microcontroller interfaces and interacts with other…
Arduino compatible coding 05: Interfacing buttons for digital input
In the previous tutorial, we discussed digital output from Arduino to drive an LED. A controller can interface and interact with other devices in five ways: digital output, digital input, analog output, analog input, and serial communication. In this tutorial, we will use digital input from Arduino to read the state of a tactile switch…
Arduino compatible coding 06: Analog output (PWM) on Arduino and LED fading
In the previous tutorial, we discussed the digital input process for using Arduino. We also explained push buttons (momentary type buttons) and how to use them for data or command input via a digital input. Any controller can interface and interact with other electronic devices in five ways: digital output, digital input, analog output, analog input,…
Arduino compatible coding 18: Synchronous serial communication using the I2C bus
In previous tutorials, we’ve covered serial communication using the UART and software serial in Arduino. The universal asynchronous receiver/transmitter (UART), I2C, and SPI are the most commonly used serial interfaces in embedded systems. UART is useful for full-duplex serial communication with a single device over two wires. The I2C or two-wire interface (TWI) is used for half-duplex…
Arduino compatible coding 19: Interfacing an ADXL345 accelerometer using I2C bus
In the previous tutorial, we covered the I2C bus in Arduino. We also learned about using the wire library to communicate with the Inter-integrated circuit or I2C devices using Arduino boards. The I2C bus is commonly used by digital sensors. When using this interface, hundreds of slave devices can be connected over just two wires. Each device —…
Arduino compatible coding 14: Interfacing the LM35 temperature sensor with Arduino
In the previous tutorial, we learned how to display custom characters on a character LCD. Character LCD is the most commonly used display device in embedded systems and circuits. Although character LCDs are from sophisticated, they provide a simple interface that’s easy to use and learn. They also convey useful information about operating conditions, warnings,…
Arduino compatible coding 15: Reading sensor data from DHT-11 without using a library
In the previous tutorial, we learned how to interface an LM35 temperature sensor with Arduino. LM35 is an analog sensor that can be interfaced with Arduino’s analog input pin. In this tutorial, we’ll cover how to interface a DHT-11 sensor with Arduino. DHT-11 is a digital temperature and humidity sensor. It outputs a much more…
Arduino compatible coding 16: Serial UART communication
In the previous tutorial, we learned how to interface a DHT-11 sensor with Arduino. DHT-11 is a digital sensor that comes integrated with an 8-bit microcontroller. This integrated microcontroller outputs humidity and temperature values in the form of a 40-bit digital data packet. In the last tutorial, we read the data packet by polling one…
Arduino compatible coding 17: Using softwareSerial in Arduino
In the previous tutorial, we learned about serial communication in Arduino using the universal asynchronous receiver-transmitter (UART). We also discussed how Arduino can talk with a computer system using the UART protocol. The UART is a dedicated circuit that implements serial communication according to its protocol. Arduino boards have one or more UART/USART. These UART/USART interfaces are available through…
Arduino compatible coding 09: Interfacing SSD with Arduino
In the previous tutorial, we discussed interfacing RGB LEDs with Arduino. In this tutorial, you’ll learn how to interface seven-segment display (SSD) when using Arduino. When interfacing with any kind of display device, Arduino and other controllers use digital output or serial communication. Driving SSDs by Arduino is as simple as driving an LED on it. The seven-segment…
Arduino compatible coding 10: Seven-segment multiplexing using Arduino and MAX7219
In the previous tutorial, we learned how to interface a seven-segment display with Arduino. A seven-segment display is comprised of a unit of eight LEDs and seven of which are bar-shape and one is a dot. These display units are ideal for displaying numbers or letters. For example, they’re often used as a display unit…
Arduino compatible coding 12: Scrolling long text on the character LCD using Arduino
In the previous tutorial, we discussed: The functional blocks of a character LCD How character LCD works and is interfaced with a controller How to display text on a character LCD In this tutorial, we will learn about scrolling long string of text on a character LCD, which can be tricky. A character LCD module has…
Arduino compatible coding 07: Analog input using Arduino
In the previous tutorial, we discussed analog output in the form of PWM signals when using Arduino. We generated a PWM wave from Arduino by employing the analogWrite() function that approximates to a rectified sine wave. It, then, uses that analog output to fade an LED. A controller can interface and interact with external electronic components…
Arduino compatible coding 08: Interfacing an RGB LED using Arduino
In the previous tutorial, we discussed analog input when using Arduino. So far, we have covered four out of the five ways that controllers can interface and interact with other electronic components and devices. This includes digital output, digital input, analog output, and analog input. In this tutorial, we discuss how to interface RGB LEDs using Arduino.…
Arduino compatible coding 11: Interfacing character LCD with Arduino
In the previous tutorial, we discussed multiplexing seven-segment displays (SSDs). Continuing with the display devices, in this tutorial, we will cover how to interface character LCD when using Arduino. Character LCDs are the most common display devices used in embedded systems. These low-cost LCDs are widely used in industrial and consumer applications. Display devices in embedded systems…
Arduino compatible coding 22: Interfacing a TTP229 capacitive touch keypad
In the previous tutorial, we learned how to interface a buzzer with Arduino. A buzzer is an audio signaling output device. Embedded systems are built by interfacing several input and output devices with a controller or computer. In this tutorial, we’ll interface an input device — specifically, a TTP229 capacitive touch keypad — with Arduino.…
Arduino compatible coding 21: Interfacing buzzers with Arduino
In the previous tutorials, we learned about serial communication using the SPI (serial peripheral interface) and seven-segment multiplexing using the MAX7219 IC. We’ve also covered digital I/O, analog input, PWM (pulse width modulation), and all of the serial communication protocols commonly used by embedded controllers (the UART, I2C, and SPI). This completes the basic coverage of the Arduino platform. With the above-mentioned skillsets, we…



















