Introduction: Arduino Nano: Analog 7 Segment MAX7219 Display With Visuino

7 Segment Displays are very popular choice for displaying data. They however consist of a large number of LEDs and controlling each LED with a digital pin from Arduino is not a practical solution. Maxim Integrated offers very convenient chip for controlling large number of LEDs and 7 Segment displays - MAX7219 . There are a lot of cheap readily available 7 Segment modules using this chip.

In this Instructable, I will show you how easy it is to connect such module to Arduino, and control it with Visuino.

Step 1: Components

  1. One Arduino compatible board (I use Arduino Nano, because I have one, but any other will be just fine)
  2. One 8 digits 7 Segment Display module with MAX7219 controller (Picture 2 shows the back side of the module with the MAX7219 controller)
  3. 5 Female-Female jumper wires

Step 2: Connect the LED Module to the Arduino

  1. Connect Power(Red wire), Ground(Black wire), DIN(Green wire), CS(White wire), and CLK(Yellow wire) to the LED Module (Picture 1)
  2. Connect the other end of the Power wire(Red wire) to the 5V power pin of the Arduino board (Picture 2)
  3. Connect the other end of the Ground wire(Black wire) to Ground pin of the Arduino board (Picture 2)
  4. Connect the other end of the DIN wire(Green wire) to the Digital 11 pin of the Arduino board (Picture 3)
  5. Connect the other end of the CS wire(White wire) to the Digital 10 pin of the Arduino board (Picture 3)
  6. Connect the other end of the CLK wire(Yellow wire) to the Digital 13 pin of the Arduino board (Picture 4)
  7. Picture 5 shows where are the Ground, 5V Power, Digital 10, 11, and 13, pins of the Arduino Nano

Step 3: Start Visuino, and Select the Arduino Board Type

To start programming the Arduino, you will need to have the Arduino IDE installed from here: http://www.arduino.cc/ .

Please be aware that there are some critical bugs in Arduino IDE 1.6.6.

Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work!

The Visuino: https://www.visuino.com also needs to be installed.

  1. Start Visuino as shown in the first picture
  2. In Visuino, click on the "Tools" button on the Arduino component (Picture 1)
  3. When the dialog appears, select Arduino Nano as shown in Picture 2

Step 4: In Visuino: Add Maxim MAX7219 LED Component, and Connect It

  1. Type "7219" in the Filter box of the Component Toolbox then select the "Maxim Led Controller SPI MAX7219/MAX7221" component (Picture 1), and drop it in the design area
  2. Connect the "Out" pin of the LedController1 component to the to the "In" pin of the SPI channel of the Arduino component (Picture 2)
  3. Connect the "ChipSelect" pin of the LedController1 component to the "Digital" input of the "Digital[ 10 ]" channel of the Arduino component (Picture 3)

Step 5: In Visuino: Add Analog Display Element to the Maxim LED Controller Component

The LedController1 component can control LEDs in many different ways. How the LEDs are organized and controlled depends on what Elements will be added to the component. Here we will add just one element to control the 7 Segment display with Analog value.

  1. Click on the "Tools" button of the LedController1 component(Picture 1)
  2. In the Elements editor, double-click on the "Analog Display 7 Segments" to add one to the component (Picture 2)
  3. In the Object Inspector, set the value of the "Precision" property of the newly added "Analog Display 7 Segments1" element to 7 (Picture 3)

Step 6: In Visuino: Add Random Value Component, and Connect It

We need to send some Analog values to be displayed. The simplest option is to use a Random generator to generate values for the display. We will set the generator to generate a random number between 0 and 100:

  1. Type "rand" in the Filter box of the Component Toolbox then select the "Random Analog Generator" component (Picture 1), and drop it in the design area
  2. In the Object Inspector, set the value of the "Max" property of the RandomAnalogGenerator1 to 100 (Picture 2)
  3. Connect the "Out" pin of the RandomAnalogGenerator1 component to the to the "In" pin of the LedController1 component(Picture 3)

Step 7: In Visuino: Add Clock Generator Component, and Connect It

We can use the project as designed up to this point, but the Analog value for the Display will change too fast, and it will be difficult to read the display. For this we will add a Clock Generator and set it to clock 5 times a second. The clock generator will clock the Random generator to generate a new value 5 times a second:

  1. Type "clock" in the Filter box of the Component Toolbox then select the "Clock Generator" component (Picture 1), and drop it in the design area
  2. Connect the "Out" pin of the ClockGenerator1 component to the to the "Clock" pin of the RandomAnalogGenerator1 component (Picture 2)
  3. In the Object Inspector, set the value of the "Frequency" property of the ClockGenerator1 to 5 (Picture 3)

Step 8: Generate, Compile, and Upload the Arduino Code

  1. In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
  2. In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)

Step 9: And Play...

Congratulations! You have completed the project.

Picture 1 shows the connected and powered up project. You should see the random analog values being displayed on the 7 Segment display.

You can play with some of the properties we set in the Instructable, to adjust how often the display is refreshed, the minimum, and maximum numbers generated, and the floating point precision.

On Picture 2 you can see the complete Visuino diagram.

Also attached is the Visuino project, that I created for this Instructable. You can download and open it in Visuino: https://www.visuino.com

Comments

author
ahmadhaddad (author)2016-02-29

Hi Boian,

Thanks for the tutorial. What helps at this point is to replace the random analogue generator with a counter (say from 0 to 99,999,999) and then reverse it. This way we learn how to set up the "if" or "loop" logic.

Thanks for the great product!

author
hj-vdberg (author)2016-01-08

It is great, but I struggle to find out how did you know to connect 11 and 10, the Visuino program does not show any connections to them? Can you help me understand?

author
BoianM (author)hj-vdberg2016-01-08

On Arduino Nano, the MOSI pin is pin 11, and SCK is pin 13. You can see it on the Arduino Nano Pinout:

http://pighixxx.tumblr.com/post/42591353009/arduin...

The display uses SPI (as you can see also in the Visuino diagram), and the SPI uses those 2 signals to talk to the display.

author
hj-vdberg (author)BoianM2016-01-09

Thanks BoianM, it helped a lot - where I can find some training for Visuino?

author
BoianM (author)hj-vdberg2016-01-09

Well... the Instructables are good starting point. My youtube channel, the included demos, the Facebook, and the G+ Visuino communities.

I am putting here links to all the resources I can find:

https://www.visuino.com/wiki/index.php?title=Main_Page

author
KurtRoesener made it! (author)2016-01-05

Another one on my desk!

20160105_173928.jpg
author
Erwinv1 (author)KurtRoesener2016-01-06

Building it also. Looks good :-)

author
BoianM (author)Erwinv12016-01-06

Cool! The more the merrier :-)

author
BoianM (author)KurtRoesener2016-01-05

Cool! :-) You are, really in about to get them all done :-)

author
GABRIELED5 (author)2016-01-06

Mine is on the way! :-D

author
BoianM (author)GABRIELED52016-01-06

Can't wait to see it ;-)