Arduino Projects

The heart rate, also referred to as pulse rate, has been recognized as a vital sign since the beginning of medicine, and it is directly related to a person’s cadiovascular health. Today, we are going to make a PC-based heart rate monitor system using an Arduino board and Easy Pulse V1.1 sensor. Easy Pulse is a pulse detecting sensor that uses the principle of transmission photo-plethysmography (PPG) to sense the pulse signal from a finger tip. The sensor output is read by the Arduino board, which then transfers the data to the PC through a serial interface.
Inside larger seven segment LED modules, the display segments are made of multiple LEDs connected in series and parallel to provide sufficient light to illuminate the segment, and as such they require a higher forward voltage and more current to operate. Recently, I have designed this display driver board that can be used as a bridge in between larger seven segment LED displays (with segment forward voltage up to 24V) and Arduino. On its input side is MAX7219 which receives the display data from the host microcontroller through a 3-wire SPI bus.
A light meter is a device that measures the intensity of light. It finds applications in schools, hospitals, production areas, passageways and more to measure and maintain proper lighting levels. It is often used by photographers to determine the proper exposure for a photograph. Today we are going to build a simple light meter using an Arduino board and a BH1750 digital light sensor. The measured lighting level or intensity is displayed on eight seven segment LED displays, in both Lux and Foot-candle units.
MCP9802 is a digital temperature sensor from Microchip that measures temperatures between -55°C and +125°C to a digital word. It provides an accuracy of ±1°C (maximum) from -10°C to +85°C. The MCP9802 sensor comes with user-programmable registers that provide flexibility for temperature sensing applications. The register settings also allow user-selectable 9-bit to 12-bit temperature measurement resolution. This sensor has an industry standard 2-wire I2C compatible serial interface, allowing up to eight devices to be controlled in a single serial bus. In this blog post I am going to write about an Arduino sketch to interface the MCP9802 sensor with an Arduino for temperature sensing application.
In this blog project, I am providing you step by step instructions to build a very simple temperature and relative humidity meter for indoor use. All you need to build this project are an Arduino Uno or compatible board, a DHT11 sensor, and a MAX7219 based 8-digit serial 7-segment LED display. The temperature is displayed in degree Celsius and relative humidity in percentage.

Pages: 1 2

Continue Reading ...

9 comments

  • Have done building the template from Whatimade after some change it runs.

    http://www.whatimade.today/programming-an-8-digit-7-segment-display-the-easy-way-using-a-max7219/

    Only drawback with the Raj-display, they light up ALL segment FULL brightnes on power up.
    This sucks much current!
    This happens all the time you power up the circuitry, regardless of having placed the Iset-resistor or having set the brightness register to “1”.
    Please, read the notes regarding placing and modifying the rinkydinky libraries carefully.

    The code (Fahrenheit portion removed):

    /**
    * Display (Date) Time Temperatur on 2*4 Max7219 Raj LED-Display
    * used those with the Max7219 SMD SO chip soldered on
    *
    *
    * RTC DS3231 (read the clock and temp sensor)
    *
    *
    * Rinkydinky “DS3231” and “HW_AVR” libraries used
    * Copy both the DS3231-library files AND the HW-Library files into the same DS3231-folder!
    * They have to be placed manually to the library folder structure.
    * Remove the hardcoded links /avr/hardware/… from both files HW_AVR_defines.h and HW_AVR.h !
    * Let the library manager scan and by doing this way rebuilding the datase of installed libraries!
    * In case the compiler mocks about having found many DS3231 libraries, move those unwanted libraries *temporarily out of the libry folder!
    * Let the library manager scan and rebuilding the datase of installed libraries again!
    * Let the IDE “correct and reload the code”.
    * Thereafter I have successfully compiled on Arduino IDE 1.6.5
    *
    * @file max7219_DS3231_temp_clock.ino
    *
    * @brief view DATE/TIME/TEMPERATURE using an 8-digit
    * 7-Segment display
    *
    * @history Feb 6th, 2017
    *
    *
    * @author Allan Schwartz
    * Michael Diamond
    *
    * @maker/editor April 7th 2019 changed for using Raj 2*4 digit I2C Max7219 LED display
    *
    *
    * @notes The following Arduino Pins are attached:
    *
    * name Arduino 7 Segment display
    * —– —- —–
    * +5V VCC
    * GND GND
    * DIN D10/MOSI DIN
    * CS D11/SS Load/CS
    * CLK D12/SCK CLK
    *
    * name Arduino RTC module
    * —– —- —–
    * nc 32K
    * nc SQW
    * SCL SCL/A5 SCL
    * SDA SDA/A4 SDA
    * 5V VCC
    * GND GND
    */

    #include // import library from rinkydink.com

    // define pins attached to MAX7219 (and also see notes above)
    #define MAX7219_DIN 10
    #define MAX7219_CS 11
    #define MAX7219_CLK 12

    enum { MAX7219_REG_DECODE = 0x09,
    MAX7219_REG_INTENSITY = 0x01,
    MAX7219_REG_SCANLIMIT = 0x0B,
    MAX7219_REG_SHUTDOWN = 0x0C,
    MAX7219_REG_DISPTEST = 0x0F };

    enum { OFF = 0,
    ON = 1 };

    const byte DP = 0b10000000;
    const byte C = 0b01001110;
    const byte c = 0b00001101;

    DS3231 rtc(SDA, SCL);

    void setup()
    {

    // Serial.begin(115000); // initialize serial communication
    // Serial.println(“max7219_7segment_date_time_temp”);

    // define type of pin
    pinMode(MAX7219_DIN, OUTPUT); // serial data-in
    pinMode(MAX7219_CS, OUTPUT); // chip-select, active low
    pinMode(MAX7219_CLK, OUTPUT); // serial clock
    digitalWrite(MAX7219_CS, HIGH);

    resetDisplay(); // reset the MAX2719 display

    rtc.begin(); // init. the DS3231 RTC interface

    // Uncomment the following lines to set the RTC initally ONLY!
    // nur zum Stellen der RTC ( mit Batterie) einmalig aktivieren

    //rtc.setDOW(WEDNESDAY); // Set Day-of-Week to WEDNESDAY
    //rtc.setTime(3, 40, 0); // Set the time to 4:20pm
    //rtc.setDate(7, 4, 2019); // Set the date, adjust this to the time you compile and send the code over!
    }

    void loop()
    {
    String str;
    // … display Date, dd.mm.yyyy
    // read the date as a string from the RTC
    // str = rtc.getDateStr(FORMAT_LONG);
    // Serial.println(str); // debug
    // displayDate(str); // display on the 7-segment
    // delay(5000);

    // show the time for 10 seconds, then the temperature
    // … display Time: hh-mm-ss
    for ( int i = 0; i < 9; i++ ) //adjust i to the amount of repeated cycles you want

    {
    // read the time as a string from the RTC
    str = rtc.getTimeStr(FORMAT_LONG);
    // Serial.println(str); // debug
    displayTime(str); // display on the 7-segment
    delay(1000);
    }
    { // display temp in lower row
    String str;
    float t = rtc.getTemp();
    str = String(t, 2); // format that value
    Serial.println(str); // debug
    displayTemp(str,c); // display on the 7-segment
    delay(3000); //adjust i to the display time you want
    }
    } // End loop

    //—– Sub routines —–

    void displayTemp(String tempString, char c ) // display the temp on the lower row Centi grade value followed by a small chracter "c"
    {
    set_register(MAX7219_REG_SHUTDOWN, OFF); // turn off display
    set_register(MAX7219_REG_SCANLIMIT, 7); // scan limit 8 digits

    // decode the 3 mostsignificant Temp-digits ONLY, use the following data for control only
    // have the temp output shortended to 3 digits only see the three "1" register bits below

    set_register(MAX7219_REG_DECODE, 0b11100000);
    //set_register(8,0); //0=Blindschalten
    //set_register(8,1); 1="1"
    //set_register(8,2); 2="-"
    //set_register(8,DP); DP on

    // Temp-Bits: 0(Zehner), 1(Einer), 2=Doppelpunkt ignorieren, 3(Zehntel), 4(Hundertstel) ignorieren

    set_register(1,0);
    set_register(2,0);
    set_register(3,0);
    set_register(4,0);
    set_register(5,c);
    set_register(6, tempString.charAt(3));
    set_register(7, tempString.charAt(1)| DP); //DP aktivieren
    set_register(8, tempString.charAt(0)); // ganz links
    set_register(MAX7219_REG_SHUTDOWN, ON); // Turn On display
    }

    //——————-

    void set_register(byte reg, byte value)
    {
    digitalWrite(MAX7219_CS, LOW);
    shiftOut(MAX7219_DIN, MAX7219_CLK, MSBFIRST, reg);
    shiftOut(MAX7219_DIN, MAX7219_CLK, MSBFIRST, value);
    digitalWrite(MAX7219_CS, HIGH);

    }

    //——————-

    void resetDisplay()
    {
    set_register(MAX7219_REG_SHUTDOWN, OFF); // turn off display
    set_register(MAX7219_REG_DISPTEST, OFF); // turn off test mode
    set_register(MAX7219_REG_INTENSITY, 0x01); // display intensity
    }

    // … display the DATE on the 7-segment display
    void displayDate(String dateString)
    {
    set_register(MAX7219_REG_SHUTDOWN, OFF); // turn off display
    set_register(MAX7219_REG_SCANLIMIT, 7); // scan limit 8 digits
    set_register(MAX7219_REG_DECODE, 0b11111111); // decode all digits

    set_register(1, dateString.charAt(4)| DP); // plus decimal point
    set_register(2, dateString.charAt(3));
    set_register(3, dateString.charAt(1)| DP);
    set_register(4, dateString.charAt(0));
    set_register(5, dateString.charAt(9));
    set_register(6, dateString.charAt(8));
    set_register(7, dateString.charAt(7));
    set_register(8, dateString.charAt(6));
    set_register(MAX7219_REG_SHUTDOWN, ON); // Turn on display
    }

    // display the time (hours, minutes) on the top row
    // display the seconds on the second row
    void displayTime(String timeString)
    {
    set_register(MAX7219_REG_SHUTDOWN, OFF); // turn off display
    set_register(MAX7219_REG_SCANLIMIT, 5); // scan limit 6 digits

    // reserve 6 digits (1-6) for the temp-Data,
    // those with "0" (digit 7,8) are reserved for control data i.e. blank the digit by sending "0"

    set_register(MAX7219_REG_DECODE, 0b00111111);

    // Time-Bit 0,1, 2=Doppelpunkt ignore, 3,4, 5=Doppelpunkt ignore, 6,7 control data

    set_register(1, timeString.charAt(4)| DP);
    set_register(2, timeString.charAt(3));
    set_register(3, timeString.charAt(1)| DP);
    set_register(4, timeString.charAt(0));
    set_register(5, timeString.charAt(7));
    set_register(6, timeString.charAt(6));
    set_register(MAX7219_REG_SHUTDOWN, ON); // Turn on display

    }

    • Hi Raj,
      By accident I have found out the reason why it does not work properly together with the Arduino and RTC-chip.
      Have all placed on a big breadbord with a lot of smoothing capacitors and some filtering resistors in series with Vcc.

      The LED module with the Max7219 must be considert being a RF-transmitter.
      When touching the metal plate underneath the breadboard it works as it should.
      Obviously this is the same story when I had it attached to the DIY PIC-controller board.
      I’m not an Radio amateur.
      But I know this is exactly the effect when making a capacitive counterwight to an antenna or operating high resistive high impedance amplifiers (tube or MOSFET) I made earlier.
      Touchsensitive device long before the stupidly small touchscreen phones came up.

      Cheers

  • hey I want your help on arduino based program, to make automatic autoclave I need it with simulation.

  • Hi – I’m an 82 YO senior citizen and I’m trying to learn and build a phone interface using an Arduino R3. I have no previous software or embedded systems experience and would like to build a prototype of this phone interface. Which system would be best for me to get this project headed in the right direction.

    Thank you.
    Stan Simon
    ssimon333@hotmail.com

  • Is there a tutorial for connecting an Arduino Uno to a Nokia 5110?
    Most tutorials (including yours) use either a different Arduino to connect to the Nokia or a different LCD to connect to the Arduino Uno. .
    Thanks.

  • do you have any example for Bmp180 sensor using a Graphic Display LCD?

  • i request the source codes for blood glucose based micro controller pic18f4520 circuit which use Gsm modem to send sms to the mobile phone.

Leave a Reply to Stan Simon Cancel reply

Your email address will not be published. Required fields are marked *