In this tutorial we will learn how to control the LED brightness with a potentiometer and Display the value on the OLED Display.
Watch a demonstration video.
Step 1: What You Will Need
- Arduino UNO (or any other Arduino)
- LM358 dual operational amplifier
- 4X 4.7K ohm resistor
- 2X 120K ohm resistor
- 300 ohm resistor
- Bipolar Stepper motor (4 wires)
- Jumper wires
- OLED Display
- Visuino program: Download Visuino
Step 2: The Circuit
Step 3: Start Visuino, and Select the Arduino UNO Board Type
To start programming the Arduino, you will need to have the Arduino IDE installed from here: https://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! If you have not done follow the steps in this Instructable to setup the Arduino IDE to program Arduino UNO! The Visuino: https://www.visuino.eu also needs to be installed. Start Visuino as shown in the first picture Click on the “Tools” button on the Arduino component (Picture 1) in Visuino When the dialog appears, select “Arduino UNO” as shown on Picture 2
Step 4: In Visuino ADD & Connect Components
Add “OLED display I2C”
Double click on the DisplayOLED1 component -In the element window expand “Text” and drag “Text Field” to the left side
-Select “Text Field1” on the left side and in the properties window set size to: 2
Add “Counter” component and in the properties window set Min>Value to 0
Add 2X “Detect Edge” component
- Connect Arduino Digital Out to “DetectEdge1” pin[In]
- Connect Arduino Digital Out to “DetectEdge2” pin[In]
- Connect “DetectEdge1” pin[Out] and “DetectEdge2” pin[Out] to “Counter1” pin [In]
- Connect “Counter1” pin [Out] to “DisplayOLED1” > Text Field1 pin[In]
- Connect “DisplayOLED1” pin[Out] to Arduino I2C pin[In]
Step 5: 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 6: Play
If you power the Arduino UNO module the LED will shine, and if you change the stepper motor position the number of steps will be visible on the OLED display.
Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it here and open it in Visuino: https://www.visuino.eu
Read Full tutorial here.