Skip to main content

Arduino Color Mixer

This tutorial is pretty easy and requires a little Arduino and electronics knowledge, if you're not familiar with Arduino, I'll include links to guide you through the tutorial.

In this tutorial we'll generate all the possible colors that you can see with just a twist. It will also make you see through the RGB color model and understanding how today's displays work.

We'll also use Arduino analog Input / Ouput ( referred to as I/O later in tutorial ) and will learn how to read and write analog voltages on Arduino pins.







Step 1: What You Need?

1 x USB Type-B Cable 
3 x 5k Ohm Potentiometers
3 x 330 Ohm Resistors
1 x RGB LED or RGB Module 
Optional
Cable Cover
Arduino Compatible UNO Ultimate Starter Kit / Learning Kit
USB To Power Jack Cable



Don't have components? Don't worry. Just click the component's name. 


Step 2: Connecting The Pot.

The pot will be our voltage divider circuit, where Vout is the Arduino pin.
Voltage Divider Circuit

In a nutshell, it transforms a adjustable amount of the voltage (changes by twisting the rotor) to the Arduino analog input pin ( Vout ) this link explains the topic even further.


Pot Voltage Divider 


Connect the pot as illustrated in the image, connecting the outer terminals on either 5v or GND doesn't matter at all, the most important connection is the middle terminal, which goes to the analog input pins.

You obtain the 5v and GND from the Arduino pins.

I'm using the Orange for the 5v ( instead of Red ) to make easier to differentiate between power and signal lines.




Repeat this connection for the 3 pots for each color.

I want to keep the connections as tidy as possible so I'll connect the pot for the Red color on A0, Green on A1 and Blue on A2.



Step 3: Connecting The RGB LED.

The RGB LED uses the same concept of the conventional LED (diode) the magic happens because it contains 3 LEDS beside each other, when the light from those LEDs fall on your retina they represent different colors because you view them as a single combined color.


Since we have 256 value for each PWM output and 3 pins that represent Red Green Blue, we have a total of 256 * 256 * 256 colors which is 16,777,216 colors (almost 17 Million).



The RGB Led is connected the same way you'd connect a normal LED but you repeat the work 3 times.

NOTE: Don't forget to connect the 330 Ohm resistor because I made this mistake and got my Red LED burnt out electricity won't do much work to get an LED burnt, so take care.


Step 4: Upload The Code.

 
The code of the Arduino does those simple tasks in a sequential manner.

In the Setup

  • Set the mode of 3 analog input pins to input
  • Set the mode of 3 pwm (analog output) pins to output

In the Loop
  • Read the value of the pot. using analogRead function
  • Map the value from the analog pin to a matching PWM value using the map
  • function
  • Write the PWM value to the analog pin using analogWrite function


Step 5: Test Your Circuit.


Now you have the ultimate color generator with 17M colors! congrats!!


http://news.chivindo.com/676/arduino-color-mixer.html

Comments

Popular posts from this blog

SketchUp Pro 2020 v20.1.235 Full Version

BAGAS31 – SketchUp Pro 2020 v20.1.235 Full Version  merupakan software yang dirancang untuk membantu sobat membuat dan mengedit model 3D. Dengan desain tampilan yang ‘clean’ dan simple, menjadikan software ini mudah untuk digunakan. Software ini hadir dengan editor bawaan yang memungkinkan sobat mendesain objek 3D dari awal, Layout designer untuk menggabungkan model 3D serta Style Builder untuk menyesuaikan model dengan gaya yang berbeda. Software ini juga memiliki fitur untuk mengimpor data dari format lain, seperti 3DS, DWG, KMZ, JPG, PNG, PSD, TIF, TGA dan sebagainya. Tanpa berpanjang lebar, silakan download  Sketch Up Pro  versi terbaru 2020 v20.1.235 Full Version   melalui link yang disediakan. SketchUp Pro 2020 v20.1.235 Full Version Screenshots : Download : SketchUp Pro 2020 v20.1.235 Installer | Size: 128 MB [ FileUp ] | [ up4ever ] JAMU SketchUp Pro 2020 v20.1.235 Full Version | Size: 14.5 MB [ FileUp ] | [ ...

SCADA

SCADA merupakan singkatan dari Supervisory Control and Data Acquisitio n. SCADA merupakan sebuah sistem yang mengumpulkan informasi atau data-data dari lapangan dan kemudian mengirimkan-nya ke sebuah komputer pusat yang akan mengatur dan mengontrol data-data tersbut. Sistem SCADA tidak hanya digunakan dalam proses-proses industri, misalnya, pabrik baja, pembangkit dan pendistribusian tenaga listrik (konvensional maupun nuklir), pabrik kimia, tetapi juga pada beberapa fasilitas eksperimen seperti fusi nuklir. Dari sudut pandang SCADA, ukuran pabrik atau sistem proses mulai dar 1.000an hingga 10.000an I/O (luara/masukan), namun saat ini sistem SCADA sudah bisa menangani hingga ratusan ribu I/O. Ada banyak bagian dalam sebuah sistem SCADA. Sebuah sistem SCADA biasanya memiliki perangkat keras sinyal untuk memperoleh dan mengirimkan I/O, kontroler, jaringan, antarmuka pengguna dalam bentuk HMI (Human Machine Interface), piranti komunikasi dan beberapa perangkat lunak pendukung. Semua itu...

Persoalan Pokok pada Pembangkit Tenaga Listrik

Pembangkit listrik yang biasa digunakan pada suatu Sistem Tenaga Listrik (STL) terdiri dari pembangkit listrik tenaga air (Hydro plant atau PLTA) dan unit-unit thermal.Pembangkit-pembangkit itu sekarang ini umumnya sudah berhubungan satu dengan yang lainnya, atau yang sering disebut dengan interkoneksi. Setelah beroperasi dalam waktu tertentu, maka dari pembangkit-pembangkit itu ada yang keluar dari sistem interkoneksi dan hal ini disebabkan karena ada unit pembangkit yang rusak dan tentunya perlu diganti atau diperbaiki, kedua karena ada pembangkit yang istirahat untuk keperluan pemeliharaan. Salah satu contoh rencana pemeliharaan unit pembangkit adalah dengan menggunakan metode Levelized Resh dari Gaever . Namun dalam aplikasinya harus dibagi dalam dua kriteria, yaitu pertama unit pembangkit bisa dikeluarkan tanpa adanya penyesuaian. Kedua unit pembangkit yang dikeluarkan harus diatur dalam kurun waktu yang terbatas. Dengan demikian berarti pada waktu tertentu ada unit pembangkit y...

Jenis-jenis Plug dan Socket Listrik

Setelah pada artikel sebelumnya di sini yang membahas mengenai peralatan listrik rumah tinggal, maka artikel kali ini akan membahas lebih detail lagi mengenai satu peralatan instalasi listrik yang digunakan, yaitu plug dan socket. Plug dan socket listrik (dalam bahasa sehari-hari dikenal dengan colokan dan stop-kontak) 2 pin awalnya diciptakan oleh Harvey Hubbell dan dipatenkan pada tahun 1904. Karya Hubbell ini pun menjadi rujukan pembuatan plug dan socket setelahnya dan menjelang tahun 1915 penggunaannya semakin meluas, walaupun pada tahun-tahun 1920an peralatan rumah serta komersial masih menggunakan socket lampu jenis screw-base Edison. Kemudian plug 3 pin diciptakan oleh Albert Büttner pada tahun 1926 dan mendapatkan hak paten dari badan paten jerman (DE 370538), karyanya tersebut dikenal dengan nama "schuko" . Namun ada juga pencipta plug 3 pin ini, yaitu Philip F. Labre, semasa beliau masih menuntut ilmu di Sekolah Kejuruan Milwaukee (MSOE) dan mendapatkan hak paten d...

Autodesk SketchBook Pro 2021 Full Version

BAGAS31 – Sesuai dengan namanya, Autodesk SketchBook Pro 2021 Full Version ini merupakan software digital sketching atau drawing terbaik yang bisa kamu gunakan. Pada versi terbaru kali ini, ada beberapa penambahan fitur yang sangat efektif. Dengan fitur baru tersebut, diharapkan mampu meningkatkan proses sketching maupun drawing kamu. Autodesk SketchBook sendiri sudah bisa kamu dapatkan secara gratis melalui website resminya. Namun untuk kamu yang mau download versi Autodesk Sketchbook Pro, maka bisa langsung download melalui link yang sudah saya sediakan di bawah ini. Download Autodesk SketchBook Pro 2021 Full Version Screenshot: System Requirements: Windows 10 2.5 – 2.9 GHz of Intel or AMD CPU 4 GB of Memory 256 MB Graphics card with OpenGL 2.0 support We recommend that you use a pressure-sensitive tablet and pen for basic features Download: Autodesk SketchBook Pro 2021 Full Version [ FileUp ][ Uptobox ][ UsersDrive ] Jamu Only [ File...