Learn, Make and Invent
  • Educational STEM Products
  • Early Primary
    • Bee Bot
    • Ozobot
    • Matatalab Coding Set
    • Neuron coding blocks
    • Osmo ios
    • Cubetto
    • Sphero Bolt
  • Primary
    • Codey Rocky AI Robot
      • Tutorials
        • Introduction
        • Get Started
        • Upload Mode
        • Emotion Blocks
        • IoT Blocks
        • Neuron Blocks
        • IR Remote
        • Use Python
      • Examples
      • Block Reference
        • Looks
        • Lighting
        • Speaker
        • Action
        • Sensing
        • Infrared
        • Events
        • Control
        • Operators
      • Python API Reference
        • Python API for Codey
        • Python API for Rocky
        • Python API for Third-Party Libraries
        • Python API for Neuron Extension Modules
      • FAQs
    • Edison
    • mBot
      • Introduction
      • Building mBot
      • Connect mBot
      • Preset Modes
    • Microbit
    • Merge Cube
    • Bare Conductive Board
    • Tello Edu
  • Secondary
    • Microbit Grove Inventor Kit
    • mBot Ranger
    • Arduino Science Kit
    • Arduino Starter Kit
    • Arduino Grove Starter Kit
    • CoDrone
  • Senior Secondary
    • CoDrone Pro
    • Arduino CTC Go
  • Digital Tech Kits
    • Digital Tech Kit for K-2
    • Digital Tech Kit for 3-5
    • Digital Tech Kit for 6-8
    • Digital Tech Kit for 9-10
  • Makerspace
    • Otto DIY
      • User guide
      • Assembly Instructions
        • Builder Kit
        • Builder Kit +
        • Builder Kit Humanoid
        • Builder Kit E
      • OTTO enclosures 3D and laser cut files
      • Code
    • Curcuitmess
      • Circuitmess Ringo
        • Inside the Box
        • Tools Needed
        • Soldering the parts
        • Assembling the parts
        • Set up your Ringo
  • Grove Ecosystem
    • Grove System
    • Grove Modules
      • Actuators
        • Atom Node
        • Grove 2 Coil Latching Relay
        • Grove Button
        • Grove Buzzer
        • Grove Dry Reed Relay
        • Grove EL Driver
        • Grove Haptic Motor
        • Grove I2C Motor Driver V1.2
        • Grove I2C Motor Driver V1.3
        • Grove I2C Motor Driver
        • Grove LED Matrix Driver v1.0
        • Grove Mini Fan
        • Grove Mini I2C Motor Driver v1.0
        • Grove MP3 v2.0
        • Grove Recorder v3.0
        • Grove Relay
        • Grove Serial MP3 Player
        • Grove Servo
        • Grove Solid State Relay
        • Grove Speaker
        • Grove Variable Color LED
        • Grove Vibration Motor
        • Grove Water Atomization
      • Display
        • Grove 4 Digit Display
        • Grove Circular LED
        • Grove LCD RGB Backlight
        • Grove LED Bar
        • Grove LED Socket Kit
        • Grove LED String Light
        • Grove LED Strip Driver
        • Grove OLED Display 0.96inch
        • Grove OLED Display 1.12inch
        • Grove Red LED
        • I2C LCD
      • Sensors
        • Grove 3 Axis Analog Accelerometer
        • Grove 3 Axis Compass V1.0
        • Grove 3 Axis Digital Accelerometer 1.5g
        • Grove 3 Axis Digital Accelerometer 16g
        • Grove 3 Axis Digital Accelerometer 400g
        • Grove 3 Axis Digital Gyro
        • Grove 6 Axis Accelerometer And Compass V2.0
        • Grove 6 Axis Accelerometer And Gyroscope
        • Grove 80cm Infrared Proximity Sensor
        • Grove Air Quality Sensor v1.3
        • Grove Alcohol Sensor
        • Grove Barometer Sensor BME280
        • Grove Barometer Sensor BMP180
        • Grove Barometer Sensor BMP280
        • Grove Barometer Sensor
        • Grove Barometer High Accuracy
        • Grove Chest Strap Heart Rate Sensor
        • Grove CO2 Sensor
        • Grove Collision Sensor
        • Grove Digital Infrared Temperature Sensor
        • Grove Digital Light Sensor
        • Grove Dust Sensor
        • Grove Ear clip Heart Rate Sensor
        • Grove Electricity Sensor
        • Grove Finger clip Heart Rate Sensor with shell
        • Grove Finger clip Heart Rate Sensor
        • Grove Fingerprint Sensor
        • Grove Gas Sensor O2
        • Grove Gas Sensor
        • Grove HCHO Sensor
        • Grove High Temperature Sensor
        • Grove IMU 10DOF v2.0
        • Grove Infrared Receiver
        • Grove Line Finder
        • Grove Temperature and Humidity Sensor Pro
        • Grove Temperature And Humidity Sensor
        • Grove Voltage Divider
        • Grove Water Sensor
        • Grove XBee Carrier
      • Communication
        • Grove High Precision RTC
        • Grove LoRa Radio
        • Grove NFC Tag
        • Grove NFC
        • Grove 125KHz RFID Reader
        • Grove 315MHz RF Kit
        • Grove 433MHz Simple RF Link Kit
        • Grove Bee Socket
        • Grove BLE v1
        • Grove BLE dual model v1.0
        • Grove DMX512
        • Grove GPS
        • Grove I2C ADC
        • Grove I2C FM Receiver
        • Grove Protoshield
        • Grove RJ45 Adapter
        • Grove Screw Terminal
        • Grove Serial Bluetooth v3.0
        • Grove Serial RF Pro
        • Grove UART Wifi
      • Others
        • Grove Base Booster Pack
        • Grove Base Cape for BeagleBone v2
        • Grove Base HAT
        • Grove Base Shield for NodeMCU V1.0
        • Grove Base Shield for Photon
        • Grove Breakout for LinkIt Smart 7688 Duo
        • Grove Cape for BeagleBone Series
        • Grove Indoor Environment Kit for Edison
        • Grove Inventor Kit for microbit
        • Grove IoT Developer Kit Microsoft Azure Edition
        • Grove IoT Starter Kits Powered by AWS
        • Grove Recorder
        • Grove Shield for Intel Joule
        • Grove Smart Plant Care Kit
        • Grove Speech Recognizer Kit for Arduino
        • Grove Starter Kit for BeagleBone Green
        • Grove Starter Kit for IoT based on Raspberry Pi
        • Grove Starter kit for LinkIt Smart7688 Duo
        • Grove Starter Kit v3
        • Grove AND
        • Grove Base Shield for IOIO OTG
        • Grove BlinkM
        • Grove DC Jack Power
        • Grove Differential Amplifier v1.0
        • Grove Differential Amplifier v1.2
        • Grove GSR Sensor
        • Grove I2C Hub
        • Grove Joint v2.0
        • Grove Mega Shield
        • Grove Mini Camera
        • Grove Mixer Pack V2
        • Grove MOSFET
        • Grove Node
        • Grove NOT
        • Grove NunChuck
        • Grove OR
        • Grove PS 2 Adapter
        • Grove Recorder v2.0
        • Grove Serial Bluetooth
        • Grove Serial LCD V1.0
        • Grove Single Axis Analog Gyro
        • Grove SPDT Relay 30A
        • Grove Starter Kit for LinkIt ONE
        • Grove Starter Kit for mbed
        • Grove Toy Kit
        • Grove Wrapper
        • GrovePi Plus
  • Arduino
    • Graphical coding with Grove sensors
    • Arduino Comparison Sheet
    • Tutorials
      • Setup Arduino Every board in Arduino IDE
      • Arduino Cloud
      • Installing Libraries
      • Motor, Servo for Arduino
      • Sensor for Arduino
    • Examples
      • Genuino 101
        • Prerequisites
        • Shock / Tap Detection
        • LED Control Over Bluetooth
        • Board Orientation Detection
        • Pedometer – Step Counting Over Bluetooth
        • Timer Switch
        • Appendices
          • Appendix A
          • Appendix B
  • micro:bit
    • Examples
      • Servo with micro:bit
  • Halocode
    • Introduction
    • Get Started
    • Upload Mode
    • Speech Recognition
    • User Cloud Message
    • Use Python with HaloCode
    • Code with Mu A Simple Python Editor
      • Examples
        • Basic Project
          • Color Mixer
          • Compare Strength
          • Connect Wi-Fi
          • Control Multiple HaloCodes via LAN
          • Energy Ring
          • Make a Smiling Face with the LED Ring
          • Make a Volume Detector
          • Press the Button to play LED Animation Meteor
          • Rainbow Button
        • Level Up
          • Control HaloCode's LEDs via Voice Command
          • Remote Control
          • Make HaloCode the Steering Wheel of the Car on Stage
          • HaloCode's Remote Control Deck
          • Emotion Detector
          • Deep Learning and Facial Recognition
          • Use Global Variable to Interact with Sprites
        • Workshop
          • A Kitten with Blinking Eyes and a Waving Tail
          • Pedometer
          • Smart Home
  • Troubleshooting
    • Matatalab
      • Matatalab Upgrade
        • Pre Upgrade Instructions - MatataBot
        • MatataBot Upgrade
        • Matata Tower Upgrade
        • Resources for Upgrade
      • Matatalab Pairing
Powered by GitBook
On this page
  • Features
  • Application Ideas
  • Specifications
  • Platforms Supported
  • Hardware Overview
  • Getting Started
  • With TI LaunchPad
  • With Arduino
  • With Raspberry Pi
  • Project
  • Resources

Was this helpful?

  1. Grove Ecosystem
  2. Grove Modules
  3. Display

Grove 4 Digit Display

PreviousDisplayNextGrove Circular LED

Last updated 5 years ago

Was this helpful?

Grove - 4-Digit Display module is a 12-pin module. In this module, we utilise a TM1637 to scale down the number of controlling pins to 2. That is to say, it controls both the content and the luminance via only 2 digital pins of Arduino or Seeeduino. For projects that require alpha-numeric display, this can be a nice choice.

Features

  • 4 digit red alpha-numeric display

  • Grove compatible interface (3.3V/5V)

  • 8 adjustable luminance levels

Application Ideas

  • Time display

  • Stopwatch

  • Sensors' input display

Specifications

Item

Min

Typical

Max

Unit

Voltage

3.3

5.0

5.5

VDC

Current

0.2

27

80

mA

Dimensions

42x24x14

mm

Net Weight

7±1

g

Platforms Supported

Hardware Overview

Grove interface - Can be connected to digital port on Grove - Base Shield.

4 - digit display - Common anode digital tube.

Pin definition: CLK DIO VCC GND

Getting Started

With TI LaunchPad

Displaying the Numbers (4-Digital-Display)

This example demonstrates how to display some digital numbers using a Grove-4-Digital Display.

/*
 * TM1637.cpp
 * A library for the 4 digit display
 */
#include "TM1637.h"
#define CLK 39 //pins definitions for TM1637 and can be changed to other ports
#define DIO 38
TM1637 tm1637(CLK,DIO);
void setup()
{
    tm1637.init();
    tm1637.set(BRIGHT_TYPICAL);//BRIGHT_TYPICAL = 2,BRIGHT_DARKEST = 0,BRIGHTEST = 7;
}
void loop()
{
    int8_t NumTab[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};//0~9,A,b,C,d,E,F
    int8_t ListDisp[4];
    unsigned char i = 0;
    unsigned char count = 0;
    delay(150);
    while(1)
    {
        i = count;
        count ++;
        if(count == sizeof(NumTab)) count = 0;
        for(unsigned char BitSelect = 0;BitSelect < 4;BitSelect ++)
        {
            ListDisp[BitSelect] = NumTab[i];
            i ++;
            if(i == sizeof(NumTab)) i = 0;
        }
        tm1637.display(0,ListDisp[0]);
        tm1637.display(1,ListDisp[1]);
        tm1637.display(2,ListDisp[2]);
        tm1637.display(3,ListDisp[3]);
        delay(300);
    }
}

The module uses an LED drive chip - TM1637 to control the contents and change the luminance. Here we drive it to display time.

  1. Seeeduino and Grove - 4-digit display:

  2. Connect Arduino/Seeeduino to PC via a USB cable.

  3. Restart the Arduino IDE, open one demo code you like, for example ClockDisplay directly by the path:File -> Example ->DigitalTube->ClockDisplay.

  4. Upload the demo code and the clock will be ticking in a few seconds.

With Raspberry Pi

1.You should have got a raspberry pi and a grovepi or grovepi+.

3.Connection

  • Plug the sensor to grovepi socket D5 by using a grove cable.

4.Navigate to the demos' directory:

cd yourpath/GrovePi/Software/Python/
  • To see the code

    nano grove_4_digit_display.py   # "Ctrl+x" to exit #
    import time
    import grovepi
    
    # Connect the Grove 4 Digit Display to digital port D5
    # CLK,DIO,VCC,GND
    display = 5
    grovepi.pinMode(display,"OUTPUT")
    
    # If you have an analog sensor connect it to A0 so you can monitor it below
    sensor = 0
    grovepi.pinMode(sensor,"INPUT")
    
    time.sleep(.5)
    
    # 4 Digit Display methods
    # grovepi.fourDigit_init(pin)
    # grovepi.fourDigit_number(pin,value,leading_zero)
    # grovepi.fourDigit_brightness(pin,brightness)
    # grovepi.fourDigit_digit(pin,segment,value)
    # grovepi.fourDigit_segment(pin,segment,leds)
    # grovepi.fourDigit_score(pin,left,right)
    # grovepi.fourDigit_monitor(pin,analog,duration)
    # grovepi.fourDigit_on(pin)
    # grovepi.fourDigit_off(pin)
    
    while True:
        try:
            print "Test 1) Initialise"
            grovepi.fourDigit_init(display)
            time.sleep(.5)
    
            print "Test 2) Set brightness"
            for i in range(0,8):
                grovepi.fourDigit_brightness(display,i)
                time.sleep(.2)
            time.sleep(.3)
    
            # set to lowest brightness level
            grovepi.fourDigit_brightness(display,0)
            time.sleep(.5)
    
            print "Test 3) Set number without leading zeros"
            leading_zero = 0
            grovepi.fourDigit_number(display,1,leading_zero)
            time.sleep(.5)
            grovepi.fourDigit_number(display,12,leading_zero)
            time.sleep(.5)
            grovepi.fourDigit_number(display,123,leading_zero)
            time.sleep(.5)
            grovepi.fourDigit_number(display,1234,leading_zero)
            time.sleep(.5)
    
            print "Test 4) Set number with leading zeros"
            leading_zero = 1
            grovepi.fourDigit_number(display,5,leading_zero)
            time.sleep(.5)
            grovepi.fourDigit_number(display,56,leading_zero)
            time.sleep(.5)
            grovepi.fourDigit_number(display,567,leading_zero)
            time.sleep(.5)
            grovepi.fourDigit_number(display,5678,leading_zero)
            time.sleep(.5)
    
            print "Test 5) Set individual digit"
            grovepi.fourDigit_digit(display,0,2)
            grovepi.fourDigit_digit(display,1,6)
            grovepi.fourDigit_digit(display,2,9)
            grovepi.fourDigit_digit(display,3,15) # 15 = F
            time.sleep(.5)
    
            print "Test 6) Set individual segment"
            grovepi.fourDigit_segment(display,0,118) # 118 = H
            grovepi.fourDigit_segment(display,1,121) # 121 = E
            grovepi.fourDigit_segment(display,2,118) # 118 = H
            grovepi.fourDigit_segment(display,3,121) # 121 = E
            time.sleep(.5)
    
            grovepi.fourDigit_segment(display,0,57) # 57 = C
            grovepi.fourDigit_segment(display,1,63) # 63 = O
            grovepi.fourDigit_segment(display,2,63) # 63 = O
            grovepi.fourDigit_segment(display,3,56) # 56 = L
            time.sleep(.5)
    
            print "Test 7) Set score"
            grovepi.fourDigit_score(display,0,0)
            time.sleep(.2)
            grovepi.fourDigit_score(display,1,0)
            time.sleep(.2)
            grovepi.fourDigit_score(display,1,1)
            time.sleep(.2)
            grovepi.fourDigit_score(display,1,2)
            time.sleep(.2)
            grovepi.fourDigit_score(display,1,3)
            time.sleep(.2)
            grovepi.fourDigit_score(display,1,4)
            time.sleep(.2)
            grovepi.fourDigit_score(display,1,5)
            time.sleep(.5)
    
            print "Test 8) Set time"
            grovepi.fourDigit_score(display,12,59)
            time.sleep(.5)
    
            print "Test 9) Monitor analog pin"
            seconds = 10
            grovepi.fourDigit_monitor(display,sensor,seconds)
            time.sleep(.5)
    
            print "Test 10) Switch all on"
            grovepi.fourDigit_on(display)
            time.sleep(.5)
    
            print "Test 11) Switch all off"
            grovepi.fourDigit_off(display)
            time.sleep(.5)
    
        except KeyboardInterrupt:
            grovepi.fourDigit_off(display)
            break
        except IOError:
            print "Error"

5.Run the demo.

sudo python grove_4_digit_display.py

6.This demo may not work if your grovepi doesn't have the newest firmware, update the firmware.

cd yourpath/GrovePi/Firmware
sudo ./firmware_update.sh

Project

Inspired by OVERWATCH, we have made a very cool Wooden Laser Gun toy for fun these day!

The Wooden Laser Gun and the Gun Target are all based on an Arduino board called Seeeduino Lotus. The laser emitter on the Laser Gun is controlled to fire laser pulse to "activate" the Gun Target. And there are 3 light sensors on the Gun Target to detect the laser pulse. It seems very simple right? If you are interested in our project, please make one for yourself or your child! It's worth to spend one day DIY it as a Xmas present.

Resources

With

Connect the Grove socket marked "IN" on the LED Strip Driver and digital port 2 of the with a Grove cable. You can change to the digital port as you like. But don't forget to change the port number in the definition of the demo code at the same time.

Plug onto Arduino/Seeeduino or plug onto Arduino Mega.

Arduino Mega and Grove - 4-digit display:

Download and . Unzip and put them in the libraries file of Arduino IDE by the path: ..\arduino-1.0\libraries.

You can see this:

2.You should have completed configuring the development enviroment, otherwise follow .

Arduino
Grove - Base Shield
Grove - Mega Shield
the 4-Digit Display library
TimerOne library
here
Grove - 4-Digit Display V1.0 eagle files
Schematic in PDF
4-Digit Display library
TimerOne library
Four-Digit Display Suli Library
TM1637 datasheet