Introduction: Arduino and Visuino: Connect 4D Systems ViSi Genie Smart Touchscreen Display to Arduino
There comes a time, when you want to have a touchscreen display connected to your Arduino board. There are many different Display options and sizes available, but most of them require considerable amount of code to be controlled, and it is not easy to create cool looking user interface.
4D Systems has found a great solution for the problem. They have designed advanced, smart programmable displays that have their own controller, serial interface, and even built-in GPIO. The folks at 4D Systems have also created an easy to use graphical development environment called 4D Systems Workshop that allows you to design the user interface and program the Displays.
Last year the folks at 4D Systems were nice enough to donate couple of displays and I added support for them in Visuino, making it very easy not only to design the User Interface for the display, but also to program the Arduino to work with the user interface.
In this Instructable, I will show you how easy it is to add touchscreen user interface to your Arduino board, display data from sensors in cool gauges, and control Servo and Relay with the touchscreen Display.
Step 1: Components
- One Arduino board. It is better to use a board with more than one Serial ports - in my case Arduino Mega 2560
- One 4D SystemsSmart Touchscreen Display with connector cable ( I used uLCD-70DT/7.0" DIABLO16 Intelligent Display but most others will also work )
- One DHT11 Sensor Module I got from this cheap 37 sensors set
- One Relay Module I got from this cheap 37 sensors set
- One Small Servo
- 6 Female-Male jumper wires
- 5 Male-Male jumper wires
- One small Breadboard (Any breadboard can be used)
- One MicroSD card (In my case 4GB) (Picture 2)
- Optionally: One 4D Arduino Adaptor Shield (rev 2.0) - you can also connect the Display directly with wires, however the shield makes connecting the display to Arduino easier
- To program the 4D Systems display, you will need a uUSB-PA5 programming adapter (Picture 2)
- If your computer does not have a slot for connecting MicroSD cards, you will also need a MicroSD USB adapter (Picture 3)
Step 2: Install and Connect the 4D Arduino Adaptor Shield
- Remove the Configuration Jumpers from one of the 4D Display channels of the 4D Arduino Adaptor Shield (The top channel on Pictures 1 and 2)
- Plug the 4D Arduino Adaptor Shield on top of the Arduino board (Picture 3)
- Connect with a Female-Male jumper wire (Brown wire) the RX pin (Picture 4) of the channel of the 4D Arduino Adaptor Shield to the RX1 pin of the Arduino Mega board (Picture 5 and 6)
- Connect with a Female-Male jumper wire (Orange wire) the TX pin (Picture 4) of the channel of the 4D Arduino Adaptor Shield to the TX1 pin of the Arduino Mega board (Picture 5 and 6)
- Picture 7 shows where the RX and TX pins are on the Arduino Mega and the 4D Arduino Adaptor Shield
Step 3: Connect the DHT11 Sensor, the Relay and the Servo to the Arduino
- Connect the Female ends of Female-Male jumper wires to Power(Red wire), Ground(Black wire), and Data(Gray wire) of the DHT11 Module (Picture 1 shows 2 different types of DHT11 sensor modules. As you can see the pins may differ, so connect carefully!)
- Connect the Female ends of Female-Male jumper wires to Power(Red wire), Ground(Black wire), and Relay Control(Blue wire) of the Relay Module (Picture 2)
- Connect Male-Male jumper wires to Power(Red wire), Ground(Black wire), and Servo Control(Yellow wire) of the Servo Module (Picture 3 and 4)
- Connect the other end of the DHT11 Data wire(Gray wire) to Digital pin 2 of the Arduino board (Picture 5)
- Connect the other end of the Relay Control wire(Blue wire) to Digital pin 3 of the Arduino board (Picture 5)
- Connect the other end of the Servo Control wire(Yellow wire) to Digital pin 5 of the Arduino board (Picture 5)
- Picture 6 shows In Red where are the Digital 2, Digital 3, and Digital 5 pins of the Arduino Mega. In Blue are shown the connections done in the previous steps
Step 4: Connect the Power and Ground Wires to the Arduino Board
- Connect another Male-Male Ground wire(Black wire) to the Groundpin of the Arduino board (Picture 1)
- Connect another Male-Male Power wire(Red wire) to the 5V Power pin of the Arduino board (Picture 1)
- Connect the Other ends of the 4 Power wires(Red wires) - from the DHT11, the Relay Module, the Servo, and the Arduino together as example with the help of a Breadboard (Picture 2) - In my case I used a small Breadboard (To simplify the Instructable I powered the Servo from the Arduino board. It is recommended however to power it with a dedicated power supply as shown in this Instructable)
- Connect the Other ends of the 4 Ground wires(Black wires) - from the DHT11, the Relay Module, the Servo, and the Arduino together as example with the help of a Breadboard (Picture 2) - In my case I used a small Breadboard
- Picture 3 shows In Red where are the 5V Power, and Ground pins of the Arduino Mega. In Blue are shown the connections done in the previous steps
Step 5: Connect the 4D Systems Display and the MicroSD to the Computer
Before you can use the 4D Systems Smart Display, you need to design the user interface, and program it. To program the display, you need to connect it directly to the computer with a uUSB-PA5 programming adapter . You also will need to upload some automatically generated images to the MicroSD card.
- Connect the Display connector cable to the Display matching the labels on the cable connector to the labels on the pins on the board (Picture 1)
- Connect the other end of the connector cable to the uUSB-PA5 programming adapter (Picture 2 and 3)
- If your computer has slot for MicroSD cards, insert the MicroSD card in it, If not use a MicroSD adapter to connect the MicroSD card to the computer (Picture 4)
Step 6: In 4D Systems Workshop: Select the Display and Start New Project
If you don't have it already, you will need to install the 4D Systems Workshop. You can download it from here.
- Start the 4D Systems Workshop
- On the left select "New" (Picture 1)
- Select your display type - in my case uLCD-70DT/7.0" Diablo 16 Intelligent LCD Module w/Resistive touch (Picture 1)
- Click on the "Next" button (Picture 1)
- Click on the Arrow button of the ViSi Genie option (Picture 2)
Step 7: In 4D Systems Workshop: Add Cool Gauge and Thermometer Components
First we need to add a Gauge and Thermometer to display the data from the DHT11:
- Select the "Gauges" tab on the components toolbar (Picture 1)
- Select the "Cool Gauge" component from the tab (Picture 1) and place it in the display design (Picture 2) - you can resize and arrange the way you want it to appear
- Select the "Thermometer" component from the tab (Picture 2) and place it in the display design (Picture 3) - you can resize and arrange the way you want it to appear
- In the "Object Inspector" on the right, expand the "Scale" property (Picture 4)
- In the "Object Inspector" set the "Min" sub property of the "Scale" to "0" (Picture 4)
- In the "Object Inspector" set the "Max" sub property of the "Scale" to "100" (Picture 4)
- In the "Object Inspector" on the right, expand the "Value" property (Picture 4)
- In the "Object Inspector" set the "Value" sub property of the "Value" to "0" (Picture 4)
Step 8: In 4D Systems Workshop: Add and Configure Button Components
Next we need to add 2 buttons to control the Relay:
- Select the "Buttons" tab on the components toolbar (Picture 1)
- Select the "Button01" component from the tab (Picture 1) and place it in the display design area (Picture 2) - you can resize and arrange the way you want it to appear
- In the "Object Inspector" on the right, click on the "Events" tab (Picture 2)
- In the "Object Inspector" on the right, click on the "..." button next to the value of the "OnChanged" event (Picture 2)
- In the "On event selection" dialog, select "Report message", and click the "OK" button (Picture 3)
- Select again the "Button01" component from the tab (Picture 4) and place it in the display design area (Picture 5) - you can resize and arrange the way you want it to appear
- In the "Object Inspector" on the right, click on the "Events" tab (Picture 5)
- In the "Object Inspector" on the right, click on the "..." button next to the value of the "OnChanged" event (Picture 5)
- In the "On event selection" dialog, select "Report message", and click the "OK" button (Picture 3)
Step 9: In 4D Systems Workshop: Add and Configure Track Bar Component
Finally we need a trackbar to control the Servo:
- Select the "Inputs" tab on the components toolbar (Picture 1)
- Select the "Trackbar" component from the tab (Picture 1) and place it in the display design area (Picture 2) - you can resize and arrange the way you want it to appear
- In the "Object Inspector" on the right, click on the "Events" tab (Picture 2)
- In the "Object Inspector" on the right, click on the "..." button next to the value of the "OnChanged" event (Picture 2)
- In the "On event selection" dialog, select "Report message", and click the "OK" button (Picture 3)
Step 10: In 4D Systems Workshop: Select the Display Com Port, and Save the Project
Once the project is ready, we need to save it and prepare for uploading:
- Select the "Comms" from the Ribbon menu (Picture 1)
- Select the Serial Com port to which the display is connected (Picture 1)
- Select the "Home" from the Ribbon menu (Picture 2)
- Click on the "Save" button (Picture 2)
- In the "Save dialog" save the project (Picture 3)
Step 11: In 4D Systems Workshop: Build and Upload the Project to the 4D Systems Display
Finally we need to build and upload the project to the Display:
- Select the "Home" from the Ribbon menu (Picture 1)
- Click on the "Build Copy/Load" button (Picture 1)
- The Workshop will show the progressing dialog of the files being generated (Picture 2)
- At the end of the processing, the Workshop will offer you to select the MicroSD Flash card where the files will be copied (Pictures 3, and 4)
- After selecting the MicroSD disk, click the "OK" Button (Picture 4)
- Finally, the Workshop will show the copy progress (Picture 5)
Step 12: Connect the 4D Systems Display to the Arduino
The Display is programmed, and the generated images are uploaded into the MicroSD. Now we need to connect the Display to Arduino and install the MicroSD:
- Unplug the MicroSD card from the computer, and plug it into the MicroSD slot of the Display (Pictures 1 and 2)
- Disconnect the Display cable from the uUSB-PA5 programming adapter
- Connect the Display cable to the 4D Arduino Adaptor Shield (Picture 3)
Step 13: 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.
Step 14: In Visuino: Add and Connect ViSi Genie 4D Systems Display Component
First we need a ViSi Genie 4D Systems Display component to control the Display from the Visono code:
- Type "4d" in the Filter box of the Component Toolbox then select the "ViSi Genie 4D Systems Display" component (Picture 1), and drop it in the design area
- Connect the "Out" output pin of the Display4DSystems1 component to the to the "In" input pin of the "Serial[ 1 ]" channel of the Arduino component (Picture 2)
- Connect the "Reset" output pin of the Display4DSystems1 component to the to the "Digital" input pin of the "Digital[ 4 ]" channel of the Arduino component (Picture 3)
Step 15: In Visuino: Add and Configure Elements for the 4D Display Components
Next we need to add the elements of the User Interface of the Display so we can work with them in Visuino:
- Click on the "Tools" button of the Display4DSystems1component (Picture 1)
- In the "Elements" editor select the “4D Button” element, and then click 2 times on the "+" button on the left (Picture 2) to add 2 Button elements (Picture 3)
- In the Object Inspector set the "Index" property of the second Button4D Element to "1" (Picture 3)
- In the "Elements" editor select the “Trackbar” element on the right, and then click on the "+" button on the left to add Trackbar element (Picture 4)
- In the "Elements" editor select the “Cool Gauge” element on the right, and then click on the "+" button on the left to add Cool Gauge element (Picture 5)
- In the "Elements" editor select the “Thermometer” element on the right, and then click on the "+" button on the left to add Thermometer element (Picture 6)
- Close the "Elements" editor
Step 16: In Visuino: Add and Connect DHT11, and Two Analog to Unsigned Components
Next we will add a component to get the values from the DHT11, convert them to Unsigned Integers and send them to the Display Gauge, and Thermometer Elements:
- Type "dht" in the Filter box of the Component Toolbox then select the "Humidity and Thermometer DHT11/21/22/AM2301" component (Picture 1), and drop it in the design area
- Type "analog to" in the Filter box of the Component Toolbox then select the "Analog To Unsigned" component (Picture 2), and drop two of them it in the design area
- Connect the "Sensor" pin of the HumidityThermometer1 component (Picture 3) to the "Digital" input pin of the "Digital[ 2 ]" channel of the Arduino component (Picture 4)
Step 17: In Visuino: Connect the Analog to Unsigned Components
- Connect the "Temperature" output pin of the HumidityThermometer1 to the "In" input pin of the AnalogToUnsigned2 component
- Connect the "Humidity" output pin of the HumidityThermometer1 to the "In" input pin of the AnalogToUnsigned1 component
- Connect the "Out" output pin of the AnalogToUnsigned1 to the "In" input pin of the "Objects.CoolGauge1" element of the Display4DSystems1 component
- Connect the "Out" output pin of the AnalogToUnsigned2 to the "In" input pin of the "Objects.Thermometer1" element of the Display4DSystems1 component
Step 18: In Visuino: Add and Connect S-R Flip-Flop Component
To control the Relay we will use a S-R Flip-Flop, and will control it with the 2 button elements of the Display:
- Type "flip" in the Filter box of the Component Toolbox then select the "SR Flip-Flop" component (Picture 1), and drop it in the design area
- Connect the "Out" output pin of the "Objects.Button4D1" element of the Display4DSystems1 component to the "Set" input pin of the SRFlipFlop1 component (Picture 2)
- Connect the "Out" output pin of the "Objects.Button4D2" element of the Display4DSystems1 component to the "Reset" input pin of the SRFlipFlop1 component (Picture 3)
- Connect the "Out" pin of the SRFlipFlop1 component to the "Digital" input pin of the "Digital[ 3 ]" channel of the Arduino component (Picture 4)
Step 19: In Visuino: Add and Connect Unsigned to Analog and Servo Components
Finally we will add Servo component, and converter to convert the 0 to 100 values of the trackbar to 0.0 to 1.0 values of the Servo:
- Type "to analog" in the Filter box of the Component Toolbox then select the "Unsigned To Analog" component (Picture 1), and drop it in the design area
- In the Object Inspector set the value of the "Scale" property of the UnsignedToAnalog1 component to "0.01" (Picture 2) - this will scale the unsigned integer values from the range of 0 to 100 to the analog range of 0.0 to 1.0 needed for the Servo
- Type "servo" in the Filter box of the Component Toolbox then select the "Servo" component (Picture 3), and drop it in the design area
- Connect the "Out" output pin of the "Objects.Trackbar1" element of the Display4DSystems1 component to the "In" input pin of the UnsignedToAnalog1 component (Picture 4)
- Connect the "Out" output pin of the UnsignedToAnalog1 component to the "In" input pin of the Servo1 component (Picture 5)
- Connect the "Out" pin of the Servo1 component to the "Digital" input pin of the "Digital[ 5 ]" channel of the Arduino component (Picture 6)
Step 20: Generate, Compile, and Upload the Arduino Code
- In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
- In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)
Step 21: And Play...
Congratulations! You have learned how to connect 4D Systems Smart Display to Arduino, display data from sensors, and control Servo and Relay modules with the Display.
Picture 1, and the Video show the connected and powered up project.
If you power Arduino, you will see the Temperature and Humidity shown on the Display. You can use the buttons to control the Relay, and the Track Bar to control the Servo.
On Picture 2 you can see the complete Visuino diagram.
Attached as ViSiGenieInstructable.zip is the 4D Systems Workshop project I creted for the Instructable. You can download the 4D Systems Workshop from the 4D Systems site.
Also attached as ViSiGenieDHT11ServoRelayInstructable.zip is the Visuino project, that I created for this Instructable. You can download and open it in Visuino: https://www.visuino.com

Participated in the
Make it Move Contest 2016

Participated in the
Robotics Contest 2016

Participated in the
Sensors Contest 2016
20 Comments
4 months ago on Step 21
I followed this project to the tee (connecting and visuino programming). When I run the code with no errors the 4D system screen turns off in 10 second. What could be causing this please provide solutions. Thanks, Bart Hamlett
3 years ago
Hi, Why is it better to use a Arduino board with more than one Serial port ?
Can i connect 4D System display to a Arduino Micro or Arduino Nano?
5 years ago
CAN YOU EMAIL ME THE CODE I AM GETTING SOME ERRORS BART@BCWASTEWATER.COM
6 years ago
Have just received the latest gen4-uLCD-70DT and Arduino adaptor, but forgot to order the programming adaptor. Hope it gets here before the weekend! Looking forward to playing with the display, and connecting it to my LoRa project ... ;-)
Thanks for the Instructable, Boian.
6 years ago
I love this project. I set it up but got some code errors. Can you send me the code too?
6 years ago
Me too! Any chance I can see code too Cheers Steve.
Reply 6 years ago
You can generate the code easily with the latest version of Visuino. You can use it for free to 5 min. every time you run - plenty of time to generate the project or do some changes, and then you can run again ;-) .
7 years ago
hello. i am trying to do that stuff. but i have a problem with controling the relay. could u send me your arduino code? u can send to my email: leminhhuy3337@gmail.com.
thank you so much.
Reply 7 years ago
Finally had chance to generate and send it. Should be in your e-mail.
You will need the Visuino libraries to compile. The best is to install Visuino and it will install the libraries for you, or you can get them from here:
https://bitbucket.org/mitov/visuino-libraries
The code I generated used the current version of the libraries. They will change in the future, so it is recommended to generate the code with Visuino if possible.
Reply 7 years ago
thank you so much :)
7 years ago
Making this stuff look way too easy. Nice write-up!
Reply 7 years ago
Thank you! Enjoy :-)
7 years ago
Look from amateur to professional, Very Very good.
Reply 7 years ago
Thank you! :-) Enjoy!
7 years ago
Definitely a cool project and REALLY tempting to try if it weren't for the price of the 4D gear.
I could see this working well for certain applications, but from my rather novice viewpoint, I have to wonder whether most applications would work better with an HDMI-based touch screen and a Pi. Am I crazy?
Reply 7 years ago
It's a good point. I love the 4D System displays, but yes, they are pricy. They seem to be intended mostly for industrial environment, and even have their own built in GPIO.
I am did this because there are users of Visuino that have the 4D Displays, and I have been asked by them, how to connect and use the Displays, so I decided to make this Instructable ;-)
7 years ago
Aww man... I thought I was just gonna be a couch potato this weekend...
Well... got stuff to order, things to download...
Reply 7 years ago
I know the feeling :-D, and I am cooking more, so strap yourself... ;-)
7 years ago
Ummm, wow! Just - WOW! This is way beyond awesome! My wife will kill me when I tell her I want to play with this!
Reply 7 years ago
Thank you! :-) Yeah... I know the feeling... ;-)