May 03, 2021

Pulse Oximeter MAX30100 Interface with NodeMCU

The MAX30100 has integrated pulse oximetry and heart-rate monitor sensor integrated circuit with I2C interface. NodeMCU is mostly preferred as it is a 3.3V controller.

Components Required:
  • Pulse Oximeter MAX30100
  • NodeMCU
  • Jumper Wires
  • Bread Board
  • Soldering Kit (Optional)

Before the connection is done there is slight modification needs to be done. The board shown above has little issue with NodeMCU or any other controller. As the NodeMCU is a 3.3V controller it sends or receives I2C signals at a 3.3V logic level. MAX30100 usually comes with its I2C bus pulled up to 1.8V. This is why if you don't make any modifications, the code might not run. Although without modification, you would be able to check its I2C address but rest of the functions won't work.
Now before we go for the modification let's see the Pinout of MAX30100. It has 14 pins. The I2C bus is at Pin 2 and Pin 3 is SCL and SDA. Pin 13 is for INT (Interrupt), Pin 11 and 12 is for Power and Ground.
If we look at the module we will be able to find that Pin 2(SCL), Pin 3(SDA), Pin 5(IR_DRV), Pin 6(R_DRV), Pin 13(INT) are connected to the header. Pin 9(R_LED+) and Pin 10(IR_LED+) are connected to 3.3V. Pin 11(VDD) is connected to 1.8V. Pin12(GND), Pin4(PGND) are connected to the ground. 
Above the red marked 3 pin device is a 1.8V regulator supplying 1.8V to VDD (Pin 11) and also to the three 4.7k Ohms pull-up resistors.

Here we have three 4.7k Ohm resistor pulling up Pin 2(SCL), Pin 3(SDA), Pin 13(INT) up to 1.8V. Here we have to make a change and we have to pull these pins up to 3.3V to connect them with NodeMCU. This could be done in two ways.

Option 1: Remove them and connect 3 external 4.7k Pull up Resistors for 3.3V.

Option 2: Without removing them we will use them by making a slight change in the module. To do that at first with a help of a sharp cutter we will disconnect them from the 1.8V pin of the regulator. Just make a cut at the Red marked position shown in the image below. To make sure the disconnection is complete check continuity using a Multimeter. Do it carefully so that no damage happens at any other part of the device.
Then Connect the points shown below. Make sure during soldering no other points get connected.
If the above step is difficult for you then you can connect these two. Both the pins are 3.3V so they won't make any difference.
For me the first option was easier so after mofification my module looks like this.



Connection Diagram:
Now connect the pins accordingly.
  • VIN to nodeMCU 3.3V Pin
  • SCL to nodeMCU D1 Pin
  • SDA to nodeMCU D2 Pin
  • INT to nodeMCU D0 Pin
  • GND to nodeMCU GND Pin
Before you upload the code library needs to be installed. Please follow the below mention instruction to install the library.
https://creativestudio1973.blogspot.com/2019/11/introduction-to-arduino-library-manager.html

Source Code:

Video:

Datasheet:
https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf

Reference:
[1] Sarkar, S., Ghosh, A., Chakraborty, M., & Mondal, A. (2024). Design, Hardware Implementation of a Domestic Pulse Oximeter Using IOT for COVID – 19 Patient. International Journal of Microsystems and Iot, 2(1), 469–475. https://doi.org/10.5281/zenodo.10629635

May 02, 2021

Light Sensor BH1750 Interface with Arduino

Light Intensity is an important parameter. This could be measured by various components (eg. LDR) with proper calibration. This is why BH1750 is easy to use. It has an I2C interface so data could be extracted easily using the I2C Bus.


Things we need:
  • BH1750
  • Arduino
  • Jumper Wires
  • Bread Board (Optional)
Connection Diagram:
Connection is very simple, BH1750 has five pins Vcc, Gnd, SCL, SDA, Addr. Connect the pins accordingly.
  • VCC pin to Arduino 5V
  • GND pin to Arduino Ground
  • SCL pin to Arduino A5
  • SDA pin to Arduino A4
Once the connection is done open Arduino IDE and upload the code below.

Before you upload the code library needs to be installed. Please follow the below mention instruction to install the library.
https://creativestudio1973.blogspot.com/2019/11/introduction-to-arduino-library-manager.html

Source Code:

Video:

May 01, 2021

Dot Matrix Display Interface with Arduino using MAX7219 Driver

In our previous blog, we discussed interfacing of Dot Matrix Display with Arduino and found out that the process consumes lots of Arduino pins. To solve this issue we will use a driver IC. With help of this driver IC, we will control an 8x8 Dot Matrix Display using only 3 I/O pins. 

The module has five pins. Their descriptions are given below.
VCC  - 5V
GND  - Ground
DIN    - Data In
CS      - Chip Select
CLK   - Clock

Materials Required:
  • Dot Matrix Display Module
  • Jumper Wires
  • Arduino
Circuit Diagram:
  • VCC pin to Arduino 5V pin
  • GND pin to Arduino GND pin 
  • DIN pin to Arduino Pin 11
  • CS pin to Arduino Pin 7
  • CLK pin to Arduino Pin 13

Connect the display module with Arduino as shown above. After the connection is complete then upload the program. You should find the result as shown in the below video.

Source Code:

In this second version, the array is introduced. Using array we can store multiple values in a variable. This allows us to make the code short. If you go through the resulting video you will find that this second version is more complex sill the code size is less. 

Source Code 2:
Video: 

Video 2:

Dot Matrix Display Interface with Arduino

Dot Matrix displays are categorized upon their number of rows and number of columns and size of pixels. Usually, dot matrix displays come in the square shape of 8x8 LEDs but here we are going to demonstrate a 7x5 LEDs Display. The benefit of a dot matrix display is that you will be able to display characters or images using this. The process shown here is very simple to understand but the drawback is that this process consumes lots of pins. If you look at the Arduino in the video below you will see that 12 digital I/O pins are used to control one display. For come controllers, we might not have 12 I/O pins at all. The process of overcoming this scenario we will discuss in our next blog.

Things we need:
  • Arduino
  • 7x5 Dot Matrix Display
  • 330 Ohms - 7 Nos
  • Dot Vero (KS-100) or Bread Board
  • Jumper Wires
  • Soldering Kit (Not required for Bread Board)

Connection Diagram:

Connect the pins as described then upload the code below. The first code is about displaying a heart in portrait mode and the second code is about displaying the same heart in landscape mode. Check the results in the video below.

Source Code:

Video:

April 30, 2021

7 Segment Display Interface With Arduino

Seven segment displays come in different sizes. Their pin configuration also varies. So after purchasing any Common Cathode (CC) or Common Anode (CA) type display one must find the pin configuration. Usually, the datasheet could be found using the printed model number on the 7-Segment display. Depending upon the type (CC or CA) drivers are available to drive a display. Otherwise, they require an 8bit data line and 1bit control line per display. Drivers also help to drive the current for segments as sometimes for bigger displays the requirement of the current might be more than the controller could supply.

In a 7 Segment Display, the segments are named as a,b,c,...,e,f, and Dot Point. The segments are positioned as below.

   

To interface 7-Seg display with Arduino, we need

  • Arduino UNO / NANO
  • 7-Seg Display Common Anode type
  • 330 Ohms Resistor
  • 40x1 Male Berg Strip
  • Dot Vero or Bread Board
  • Connecting Wires
  • Jumper Wires - Male Female Type
  • Soldering Kit (Not required for Bread Board)

Connection Diagram:
  • D2 is connected to A
  • D3 is connected to B
  • D4 is connected to C
  • D5 is connected to D
  • D6 is connected to E
  • D7 is connected to F
  • D8 is connected to G
  • D9 is connected to Common Pin
Once the connection is complete copy the below code to Arduino IDE and upload it to your Arduino.

The code is for displaying 0-9. After uploading you should see the counting started. Please check the video for results.

Troubleshoot:
  • If you find that all the segments are not glowing at 8 that means there are some wires that are not connected properly.
  • If you see that display is showing abnormal values please check the connection diagram between Arduino and the Display.

Source Code:

Video:
 

April 29, 2021

Introduction to LED Based Displays

LEDs are the most basic kind of display. But the problem is One LED has only two states, On state and Off state. So it can not give more than two outputs. If we need more than two outputs what option do we have?

We can use multiple LEDs to make a display. So eight LEDs are combined together to make a display that can show 0-9 and Dot point. To display a digit maximum of seven segments consists of seven LEDs are used. Hence the name came Seven Segment Display. Eight LEDs can be connected in two ways either we could common all of their positive together or the negative together. This is why we have two types of seven-segment displays. Common cathode and common anode. A typical structure and connection diagram of the 7-Segment display is shown below. 0-9 is not enough to display right? What if we need to display characters, symbols, or images?
       

Dot Matrix displays are the solutions. Multiple LEDs are connected together to form an array. They are connected row-wise cathode and column-wise anode or vice-versa. Now with this formation, we can easily display anything we want. If we use RGB LEDs then displaying colored images also possible.  A typical connection diagram and image of the dot matrix display are shown below.







16x2 LCD Interface with Arduino using IIC Module

LCD Displays comes in different sizes. These displays are popular because they are easy to interface with. We had already interfaced 16x2 LCD with Arduino Microcontroller in our previous blog LCD Display Interface with Arduino.

There was one drawback. LCD Displays require a minimum of six pins. Most of the microcontroller does not have this much pins to bare. What if we need to interface two LCDs, that would cost twelve pins. To solve this issue we need the I2C Module.


With help of this module, we only need only the I2C bus. The advantage is multiple devices could be connected on one bus.


Things we need:

  • Arduino Uno
  • IIC Module for LCD Display
  • 16x2 LCD Display
  • 2mm Pitch 1x40 Female Berg Strip
  • 2mm Pitch 1x40 Male Berg Strip


Connection is simple, First using Berg Strip connect LCD Module with the IIC Module. Then using Jumper wire connect Arduino 5V pin to Modules VCC Pin, Arduino Gnd pin to Module Gnd Pin, Arduino A5 Pin to Modules SCL Pin, and Arduinos A4 Pin to I2C Modules SDA Pin as shown below.

LCD Module can be soldered directly with the IIC Module but this would create a problem if any of the two gets damaged. Otherwise, LCD can be brought together pre-soldered with the IIC Module.

Circuit Diagram:

After the connection is complete copy-paste and upload, the I2C scanner code. Then open the Serial Monitor there you will find the I2C address for your device. Note the IIC address.

I2C Scanner: 

Now Copy the code below to your Arduino IDE and Replace my IIC address (0x3F) with your IIC address that you noted ago. Then upload the code. And you should see the screen working. If nothing on the screen try to rotate the Potentiometer that you have on the IIC Module. That pot controls the Contrast of your display.

Before you upload the code library needs to be installed. Please follow the below mention instruction to install the library.
https://creativestudio1973.blogspot.com/2019/11/introduction-to-arduino-library-manager.html

Source Code:

Video: