close
KnowledgeBase

(1/4) BPM (Pulse Sensor) and Pedometer (ADXL345 Accelerometer) Wearable Device with OLED Display

Capture

Overview

As technology moves forward, components get smaller. As components get smaller, humanity’s creativity expands towards infinity.

Wearables are a product of miniaturized electronic components, relentless creativity, and quick prototyping microcontroller boards (such as Arduino Minis or Nano).

To demonstrate the power of modern technology,we are going to make a prototype fitness tracker. For this purpose, we are integrating a 128×32 OLED with a Heartbeat Sensor  and a ADXL345 Accelerometer as a Pedometer.

As how babies learn to how to walk, we’ll be dissecting each element into parts. For this first part of this mini-project series, we are going to explore how to display texts to a 128×32 OLED display.

Hardware Used

For the course of this mini-project, the following will be used :

Software Used

  • Arduino IDE
  • LCDAssistant
    • For changing the boot display logo

Library Used

SPI.h and Wire.h are both built-in Arduino libraries that are ready to use. The Adafruit_GFX and Adafruit_SSD1306 needs to be imported either manually or via the Arduino Library Manager.

  • SPI.h

This library allows you  to communicate with the Serial Peripheral Interface (SPI) Devices

  • Wire.h

This library allows you to communicate with the Inter-Integrated Circuit (I2C)/ Two Wire Interface (TWI) Devices

The base library that contains the necessary function calls for Adafruit_SSD1306 or similar display devices

This library is a simplified compilation of function calls from the Adafruit_GFX

Application Description

Defined by howstuffworks.com, OLEDs are solid-state devices composed of thin films of organic molecules that create light with the application of electricity. OLEDs can provide brighter, crisper displays on electronic devices and use less power than conventional light-emitting diodes (LEDs) or liquid crystal displays (LCDs) used today.

The 128×32 Organic Light-Emitting Diode (OLED) Display is an monochromatic electronic display that, unlike a traditional LCD, has no backlight.

So how does an OLED work?

Organic Light-Emitting Displays are made up of pixels. Each pixels have a subpixels which are Red, Green, and Blue LEDs.

  1. To turn on a subpixel, we attach a voltage across the negative and positive terminal.
  2. As electricity starts to conduct, the cathode receives electrons, and the anode loses them. (n-type semiconductors have “electrons” as carriers, p-type semiconductors have “holes” as carriers)
  3. The flow of electrons make the emissive layer more negatively charged (gaining electrons), while the conductive layer is becoming more positively charged (losing electrons)
  4. When the voltage across a subpixel is high enough to overcome the PN Junction barrier, the holes and electrons meet up (which is called recombination). This process releases a brief burst of energy or photons.

Set-up the Hardware

Pinouts

  • GND – Common Ground
  • VCC – 5V
  • SCL – A4 / SCL
  • SDA – A5 / SDA

Code

Initially, we should scan the address of our I2C device using the following code:

If the scanned I2C Address does not match the default 128×32 OLED Display (0x3C), change the address in display.begin();

Code Breakdown

Clears the OLED Display. Use this to update/refresh the screen.

Clears the OLED Display. Use this to update/refresh the screen.

Sets the starting point of the text.

Display the text “String Here” in the OLED display.

Basically draws a dot in the screen.

Conclusion

An Organic Light-emitting diode Display is one of the many electronic devices employed to make a device more human-friendly. It creates a view-able onscreen user interface that can interact with the user. For systems that relays data to the user, an OLED display is a device that can be considered.

References

http://www.explainthatstuff.com/how-oleds-and-leps-work.html

https://learn.adafruit.com/adafruit-gfx-graphics-library/overview

https://playground.arduino.cc/Main/I2cScanner

http://www.explainthatstuff.com/how-oleds-and-leps-work.html

Tags : 128x64accelerometeradxl345arduinoDisplayheart rateOLEDPulse SensorSSD1306

Leave a Response