Getting Status Through Serial Monitor




 I just got my Arduino starter kit hours ago and i began experimenting with it. This instructable is a good beginner tutorial that will teach you how to:

a. light up an LED
b. light up a RGB LED and use it's three colors
c. get information about what's happening in your arduino through the serial monitor

Of course, lighting up an LED is easy. There's the blink tutorial on how to blink an LED, but I modified it a little bit and jumped to lighting up your RBG LED and get the status of the Arduino through the serial monitor. Well, the arduino won't really tell you anything, but we'll tell it what to tell to us about what we told it to do. Basically, tell us what is the current color of the RBG LED.

This should help you:

a. be able to create status messages on your arduino to be view on the serial monitor so that you know what's happening
b. help you understand why sometimes we need to know what's happening

In this instructable, all you need is available in your Arduino Starter kit from But here's a list:

2. 4 wires, preferably 1 black, 1 red, 1 blue, and 1 green
3. a 10kOhm resistor (optional)
4. an Arduino board, the one I used is the Arduino Duemilanove board with ATMEGA328
5. breadboard, or similar

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Wiring

 Ok let's setup our circuit. It's just a simple circuit so I don't think it will be that hard. I've included really macro/close-up pictures so that you can properly wire them. Oh, and I've used Red wire for the red leg which connects to pin 6, green wire for the green leg which connects to pin 3, blue wire for the blue leg which connects to pin 5, and a black wire which connects to the GND leg and pin of the LED and board, respectively.

I've added a 10kOhm resistor so that I can dim the LED a little bit because without that, the LED shines really bright. I mean, REALLY bright. Although, if you choose not to put a resistor, that's fine. It will still work.

Step 2: Code and Serial Monitor

 Now, upload this code into your arduino, then open the serial monitor to see the magic!

The code is attached, but you can copy paste it from this page

Step 3: Final Remarks

 After uploading the code to your Arduino, it should then be starting to work. Now, you can open the Serial Monitor and see the status. Also, every time you open the serial monitor, it resets the board.

Where do you go from here:

- you can now use other sensors and you can display status using the serial monitor. Check the reference on the Arduino website on how to display values form sensors
- build your own circuit and get status messages from the arduino so that you know what's happening and to know of something is going wrong.
- you might probably want to try out other methods you can use information you get from the serial connection.

Here's a sample run of mine:

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    6 Discussions


    8 years ago on Step 2

    Nicely done mate!

    I'll have to go grab all the bits and bobs to put it together, i'll post in the next week or so (or when i can find time) and let you know how i go!

    The thought is using this value to alter a colour scheme on a flash based (only idea at the moment) frontend, and alter the value from the frontend to reflect on the LED's... I'm kinda hobbling together pieces of tutorials from left right and centre, so i'll keep ya posted mate!

    Thanks again for your help, and prompt reply!

    2 replies

    Reply 8 years ago on Step 2

    nice, update me when you put it up! I'm very interested in setting up a flash front end for arduino, it's just that I failed to do so... haha, can't figure out what I did wrong, or if I was actually doing it right... lol

    wish you all the best! good luck!


    Reply 8 years ago on Step 2

    Stumbled across this earlier, might help a bit mate!

    Have a browse through the list of episodes, there's also a bit about wireless control. I haven't tried them yet but the clip seems pretty well thought through and concise, may be handy!


    8 years ago on Step 2

    I was wondering if you could report back... Do you know of any way I may be able to retrieve RGB (or hex) values rather then just the solid light?

    I am using a analog control to adjust the RGB values and would like to find a way to reflect that value in an application?

    At a guess it might have something to do with trying to reflect the PW modulations, turning it from a percentage value back to a range from 255?

    I haven't had much of a dabble with all this yet, just browsing about and doing some learning, so if I'm off track please correct me! Any thoughts would be appreciated.

    2 replies

    Reply 8 years ago on Introduction

    ok got it, yup, you can create a percent situation, I wrote a sketch for this, hope it helps...
    --- code start ---
    int RPin = 11;
    int GPin = 10;
    int BPin = 9;
    int activePin;
    int PWMvalue;
    double PWMpercent;

    void setup() {


    void loop() {
    activePin = RPin;
    PWMpercent = 0.50;
    analogWrite(activePin, PWMvalue);

    activePin = GPin;
    PWMpercent = 0.50;
    analogWrite(activePin, PWMvalue);

    void getPWM(){
    PWMvalue = PWMpercent * 255; // PWMpercent in decimal value e.g. .25 for 25 percent or 1.00 for 100 percent
    --- code end --

    make sure you add resistors to avoid burning your LED...
    my sample basically lights up the red and green at 50% of 255


    Reply 8 years ago on Step 2

    I haven't really tried... hahaha, lemme check it out for a moment and I'll get back at you in a few minutes...