0

members

Medium Basics: Project 018j 4 digit 7 segment display modules 5641AH or 3461BS, 74HC595, 10 KOm thermistor

of Acoptex.com in UNO

Basics: Project 018j

Project name: 4-digit 7-segment display modules 5641AH or 3461BS, 74HC595, 10 KOm thermistor - Temperature display. 

Attachments: sketch1 (common cathode), sketch2 (common anode)

In this project, you needed these parts :

1.Aruduino Uno R3 (you can also use the other version of Arduino)

2.Arduino IDE ( you can download it from here  )

3.Jumper cables

4. Resistor 9 pcs ( 8 pcs 220 Ohm or 330 Ohm, 1 pc 10 KOhm)

5. Breadboard

6. 4-digit 7-segment display module 5641AH or 3461BS 1 pc

7. Chip 74HC595 (shif register) 1 pc

8. Thermistor 10 KOhm 1 pc

General

In this project we will learn how to connect a 4-digit 7-segment display modules  5641AH or 3461BS and 74HC595 and  thermistor 10 KOhm to Arduino board and make a temperature display. 

Understanding the thermistor

A thermistor is a thermal resistor - a resistor that changes its resistance with temperature. Technically, all resistors are thermistors - their resistance changes slightly with temperature - but the change is usually very very small and difficult to measure. Thermistors are made so that the resistance changes drastically with temperature so that it can be 100 ohms or more of change per degree.

There are two kinds of of thermistors, NTC (negative temperature coefficient) and PTC (positive temperature coefficient). In general, you will see NTC sensors used for temperature measurement. PTC's are often used as resettable fuses - an increase in temperature increases the resistance which means that as more current passes thru them, they heat up and 'choke back' the current, quite handy for protecting circuits!

Thermistors have some benefits over other kinds of temperature sensors such as analog output chips (LM35/TMP36) or digital temperature sensor chips (DS18B20) or thermocouples:

  • First off, they are much much cheaper than all the above! A bare 5% thermistor is only 10 cents in bulk.
  • They are also much easier to waterproof since its just a resistor.
  • They work at any voltage (digital sensors require 3 or 5V logic).
  • Compared to a thermocouple, they don't require an amplifier to read the minute voltages - you can use any microcontroller to read a thermistor.
  • They can also be incredibly accurate for the price. For example, the 10K 1% thermistor in the shop is good for measuring with ±0.25°C accuracy! (Assuming you have an accurate enough analog converter).
  • They are difficult to break or damage - they are much simpler and more reliable

On the other hand, they require a little more work to interpret readings, and they dont work at very high temperatures like thermocouples. Without a digital-to-analog converter on board, you might be better off with a digital temperature sensor.

Their simplicity makes them incredibly popular for basic temperature feedback control. For example, lets say you wanted to have a fan that turns on when the temperature gets high. You could use a microcontroller, a digital sensor, and have that control the relay. Or you could use the thermistor to feed the base of a transistor, as the temperature rises, the resistance goes down, feeding more current into the transistor until it turns on.

Understanding the 4-digit 7-segment display module

The obvious downside to using these relatively inexpensive 4 digit, 7 segment displays is that for full functionality, each pin must be connected to a controlling I/O pin. If you are using an Arduino Uno compatible micro-controller, one of these four digit displays will use from 12 to 16 of your 20 or so available I/O pins.There is a line of 4 digit, 7 segment displays with some additional circuitry that only requires one to three I/O pins to control one or more 4 digit displays. It is a little bit expensive but you pay for the convenience of not having to use almost all of your micro-controller I/O pins to drive a single 4 digit display and from having to manage every LED segment in the display.

The display module has 12 pins, six near the bottom and six on top. The pins are numbered counter-clockwise, starting with pin 1 on the lower left. Each digit consists of 7 segments, labeled A-G in green with a decimal point connected to pin 3. Because the display module 3461BS is a common anode display, to light any combination of segments on any digit, the desired combination of segment I/O pins must be set HIGH, then the corresponding digit select pin, labeled D1-D4, is set LOW. If two or more digit select pins (shown in orange above) are LOW at the same time, they will display identically, which is usually not desired. The same segment on every digit shares an I/O pin. The idea is to only light one digit at a time by setting the appropriate segment pins HIGH then bringing that digit's select pin LOW and then quickly turning the digit off by setting its select pin HIGH again after a few milliseconds before going on to the next digit. This happens so fast that our persistence of vision tricks us into believing all the digits are lit continuously and flicker free. In fact, this four digit refresh can happen faster than the shutter speed of most cameras. Because the segments are only lit briefly, many makers do not use current limiting resistors that can help prevent the LEDs from failing prematurely. 

However, it is better to be a little more conservative and protect each LED segment, including the decimal point with a resistor in the range of 220 to 330 ohms, depending on what’s close at hand.

The basic 4-digit 7-segment display is white in color. It has a common anode. The display features one decimal point per digit, and individually controllable apostrophe and colon points. The LEDs have a forward voltage of approx 3 VDC and a max forward current of 20 mA. The hardware interface is 12 (two rows of 6) through-hole pins. The same display is available in green, blue and red color.

You can find the datasheet of 4-digit 7-segment display module 5641AH here.

You can find the datasheet of 4-digit 7-segment display module 3461BS here.

Understanding the 74HC595

The 74HC595 consists of an 8−bit shift register and a storage register with three - state parallel outputs. It converts serial input into parallel output so you can save IO ports of an MCU.When MR (pin10) is high level and OE (pin13) is low level, data is input in the rising edge of SHcp and goes to the memory register through the rising edge of SHcp. If the two clocks are connected together, the shift register is always one pulse earlier than the memory register. There is a serial shift input pin (Ds), a serial output pin (Q) and an asynchronous reset button (low level) in the memory register. The memory register outputs a Bus with a parallel 8-bit and in three states. When OE is enabled (low level), the data in memory register is output to the bus. 

Signals and connections of the 74HC595

Pins of 74HC595 and their functions:

Q0-Q7: 8-bit parallel data output pins, able to control 8 LEDs or 8 pins of 7-segment display directly.

Q7’: Series output pin, connected to DS of another 74HC595 to connect multiple 74HC595s in series

MR: Reset pin, active at low level; here it is directly connected to 5V.

SHcp: Time sequence input of shift register. On the rising edge, the data in shift register moves successively one bit, i.e. data in Q1 moves to Q2, and so forth. While on the falling edge, the data in shift register remain unchanged.

STcp: Time sequence input of storage register. On the rising edge, data in the shift register moves into memory register.

OE: Output enable pin, active at low level. Here connected to GND.

DS: Serial data input pin

VCC: Positive supply voltage

GND: Ground

You can check the specification of chip 74HC595 here.

Signals and connections of thermistor
The thermistor part of the circuit is set up as a voltage divider. The value of the resistor should be the same order of magnitude as the thermistor. For example, We are using 10KOhm thermistor, so the resistor should be 10KOhm as well. If you use a 100KOhm thermistor, use a 100KOhm resistor.
The thermistor part of the circuit is set up as a voltage divider. The value of the resistor should be the same order of magnitude as the thermistor. For example, We are using 10KOm thermistor, so the resistor should be 10KOm as well. If you use a 100KOm thermistor, use a 100KOm resistor.
If you do use a 100KOm thermistor, you’ll need to change line of the sketch attached to Temp = log(100000.0*((1024.0/RawADC-1)));.
The thermistor part of the circuit is set up as a voltage divider. The value of the resistor should be the same order of magnitude as the thermistor. For example, We are using 10KOm thermistor, so the resistor should be 10KOm as well. If you use a 100KOm thermistor, use a 100KOm resistor.
If you do use a 100KOm thermistor, you’ll need to change line of the sketch attached to Temp = log(100000.0*((1023.0/RawADC-1)));.
Signals and connections of 4-digit 7-segment display modules 5641AH (common cathode) and 3461BS (common anode)

Build the circuit

When a 7-segment display is used, if it is a common anode display, connect the anode pin to power source; if it is a common cathode one, connect the cathode pin to GND. When a 4-digit 7-segment display is used, the common anode or common cathode pin is to control the digit displayed. There is only one digit working. However, based on the principle of Persistence of Vision, we can see four 7-segment displays all displaying numbers. This is because the electronic scanning speed is too fast for us to notice interval.

The following picture shows the needed connections with the Arduino Uno 

1. 4-digit 7-segment display module 5641AH common cathode

2. 4-digit 7-segment display module 3461BS common anode

Step by Step instruction

  1. Plug your Adruino Uno board into your PC and select the correct board and com port
  2. Open up serial monitor and set your baud to 9600 baud
  3. Verify and upload the the sketch to your Adruino Uno board
  4. You can see the temperature displayed on 4 digit 7 segment display module

Summary

We have learnt how to connect 4 digit 7 segment display module 5641AH or 3461BS, 74HC595, thermistor 10 KOhm to Arduino board

Library:

  • No library required for this project

Sketches:

  • See attachments on the begining of this project description. 


Other projects of Acoptex.com
Medium Basics: Project 083w Sipeed Maixduino board - Using PlatformIO IDE of Acoptex.com in Sipeed Maixduino 08-08-2019

« Go back to category
Is this project fake? Report it!   
Recommend to a friend
Published at 19-08-2017
Viewed: 1011 times