MissionDuke Technology, Electronics, Scripting, Internet and Open Source Software!

Arduino Projects

Project Name: Button Press Counter With Serial 7 Segment LED Display
Source Code Link: arduino_button_press_counter.zip
Description: This project will count every time you press a button on a serial LED display.
Difficulty Level: Easy
Video of working project:

——————————————————————————————————————

Project Name: Arduino LED Light Show To Music
Source Code Link: arduino_led_to_music.zip
Description: This project allows a set of LEDs dance to the music.
Difficulty Level: Medium
Video of working project:

——————————————————————————————————————

Project Name: Arduino iTunes LED Status
Source Code Link: ArduinoiTunesLEDStatus.zip
Description: This project allows a set of LEDs to display the status of iTunes. A green LED means playing and a red LED means not playing.
Difficulty Level: Expert
Video of working project:

——————————————————————————————————————

Project Name: Arduino Serial PHP Fix
Source Code Link: N/A
Description: Watch this video for a possible fix to most of the problems with the Arduino Serial PHP projects.
Difficulty Level: Medium
Video of working project:

——————————————————————————————————————

Project Name: Arduino Serial LED Via PHP
Source Code Link: serialcomm.zip
Description: A project for demonstrating the ability to control LEDs via PHP code on an Apache server through serial communications.
Difficulty Level: Medium
Video of working project:

——————————————————————————————————————

Project Name: Arduino Serial Servo Control Via PHP
Source Link: serialservocontrol.zip
Description: A project for demonstrating the ability to control a server via PHP, Apache, and serial communications.
Difficulty Level: Medium to Hard
Video of working project:

——————————————————————————————————————

Check out this Arduino weather balloon project. TheGeekGroup is creating a project using the Arduino to gather data and photos in outer space. If you like the Arduino, you will love TheGeekGroup.

Be Sociable, Share!
Comments (51) Trackbacks (1)
  1. I was wondering if you had an idea for doing a arduino music light show with Christmas lights I see a lot of videos on YouTube of the dancing lights decorating and I’m tempted to try and do one

  2. Hi Duke,

    I’m new to Arduino and I’m trying to do a project that will probably use one of your codes. Controlling servos from the web using apache, php and serial port. I somehow still dont get how to use the files. Which one do you load on Arduino? Do you have a bit more instructions on what to do with the files? Would really appreciate the help. Thanks!

    Mike

  3. hello, do you know how to do this? http://www.youtube.com/watch?NR=1&feature=endscreen&v=80s3-UOhqGs…i mean the controller…so instead of using an ipod for input, lights will flash with music or voice…thanks

    • I actually have not tackled a project like this yet but I have been looking into similar things. I will be working on a project to make custom VU meter towers for audio. I almost purchased a system similar to the one in the video but it didn’t have the effect i was looking for. I think using an Arduino with the electret mic and a preamp would work. I just don’t know what code to use. Sorry about that. If you do end up finding how to do it be sure to make a video and let me know. I would like very much to see your project. -Jeremiah

  4. thanks…also,with the arduino will the leds reactive to sound without an audio source like the tip31 projects? is this correct? will they reactive to sound from like any speakers or sound system?

  5. dude, i’m new to arduino stuff, but i know some of electronics… for the Arduino LED Light Show To Music project, which arduino should i buy? like i said, i’m new, i’ve checked the arduino website and i know there are different ones. thanks

  6. Hi, I have working with your arduino php led control code. My machine runs Mac OS X 10.6.8 with Apache2 as my server program and every time I click the link in your code to turn anything on or off, it says this:
    “Not Found

    The requested URL /PHP Code/< was not found on this server.

    I looked at the URL and it said “http://localhost/PHP%20Code/%3C?=$_SERVER['PHP_SELF']%20.”
    I imagine it would have something like “http://localhost/PHP%20Code/%3C?=$_SERVER['PHP_SELF']%20.action=redon”, but it doesn’t. I don’t think my server is reading the code completely. Any ideas on how to fix this?

    • I am having the same issue!!!! Each time I click on or off I get:

      http://localhost/~Feroze/%3C?=$_SERVER'PHP_SELF'%20.

      Why would one get this error, anyone please help?

      • I am using Mac OSX and I did set the correct serial port /dev/cu.usbmodemfd1421

        Still page not found error. It’s not recognizing the php command

        • The problem is <a href="”>

          This line is supposed to recall the php script inserting greenoff as the action but it is not working. Does it have to do with how my Apache server is configured?

          • I figured it out! use <?php echo instead of <?=

            Arduino Project 1: Serial LED Control
            <a href="”>
            Click here to turn the GREEN LED on.
            <a href="”>
            Click here to turn the GREEN LED off.
            <a href="”>
            Click here to turn the RED LED on.
            <a href="”>
            Click here to turn the RED LED off.

            Just like that

          • /* Arduino Project 1: Serial LED Control
            <a href="”>
            Click here to turn the GREEN LED on.
            <a href="”>
            Click here to turn the GREEN LED off.
            <a href="”>
            Click here to turn the RED LED on.
            <a href="”>
            Click here to turn the RED LED off.

            */

  7. Hi there,

    I want to know how make comunication two arduinos ,

    Rx Arduino1 connect to Tx Arduino2
    Tx Arduino1 connect to Rx Arduino2

    the scenario :
    If Push button1 (arduino1) pressed , Led1 (arduino1) and Led2 (arduino2) is ON
    If push button2 (arduino2) pressed , Led1 (arduino1) and Led2 (arduino2) is OFF

    Can you tell me how to make the program ???
    thank you,

    Edward

  8. For those who can’t connect due to permission issues, and are using wamp, try to click on the icon on the taskbar, and put it Online…

    Hope it helps

  9. Hi! Thanks for your code. I’ve tried to make your example, but with no success :(
    If I click to one of the links to turn on or off the leds nothing happens.

    The apache works perfect on localhost.

    If I send echo “0″ > /dev/ttyACM0 directly to my arduino it turns on the red led, so it works.

    I’ve set up a ttylog program to monitor if the php send the 0-3 to the serial port but it does it not. :( I have no idea what to do. If you can help me pls write a couple words. THANKS!!

  10. im tryin to send an ENTER, ESC, CONTROL + Z, key for a serial comm with a GSM modem. i need to send a sms with a php code.
    if u can help me… ill b very grateful…

  11. YOU ROCKS!
    greetings from brazil!

  12. Hi, how are you doing? I have one question for you, just wondering if you knew how to troubleshoot this. I have a project using the Arduino Uno sending serially through the php_serial class and it keeps giving me an error saying “Unable to open the device…”. I’m sure I put the right com number. I also checked if my computer is receiving data through Tera Term and the Arduino Serial monitor, and it is receiving the data. It’s just that when I run the PHP code that it gets stuck opening the port. Help :|

    Thank you!

    • I’m doing good. I have heard of some similar issues with the ports not opening. What version of PHP do you have? From what I can figure out the code requires the newest version (or at least 5.0 I think). Try that and if you still have problems, let me know. Also, try keeping the Arduino App open with the Serial Monitor open and connected while running the code. I found that this works sometimes although it should not be required. Also sometimes the auto reset on the Arduino gets triggered on serial data. There is a way to disable it but I don’t know how on the Uno. Sorry about taking so long to get back to you. Its been a crazy month at work. :)

  13. Hi JDUKE.

    it works for me with linux ubuntu , apache2 php5, i made some changes, and it works just fine, i got a arduino giopen ( atmega 168 20-pu ), but when i turn off my computer, and i use again the browser the arduino does not have serial comunication then i have to reload the program with the ARDUINO ID, i think i have to use the eeprom, what do you think?

  14. Hey,
    is this a suitable display for : Button Press Counter With Serial 7 Segment LED Display. I’ll wait a while with the order.
    http://www.watterott.com/en/7-Segment-Serial-Display
    Greetings from Flanders.(Belgium)
    Marc

  15. I am having issues to run the “Arduino serial servo via php”. Here is the warnings given below when i try to run it. I have no idea how to fix them. I tried a lot, but bad luck. Can you help me in fixing that warnings.

    Warning: Specified serial port is not valid in C:\xampp\htdocs\php_serial.class.php on line 140

    Warning: Unable to set the baud rate : the device is either not set or opened in C:\xampp\htdocs\php_serial.class.php on line 233

    Warning: The device must be set before to be open in C:\xampp\htdocs\php_serial.class.php on line 166

    Warning: Device must be opened in C:\xampp\htdocs\php_serial.class.php on line 577

  16. Hi JDuke,

    Thanks to you I just managed to resolve PHP serial communication I had with my Arduino. It was resetting each time that’s why it could not do what I wanted it to do. Now when I have communication to the Arduino, do you know how to get the communication from Arduino via the same serial connection? Do you have any link I could look up?

    Many thanks again for great work and great tip. I red so many forums about how to get PHP to work with the Arduino but no one seems to mention the resetting issue.

    All the best,
    Mike

    • Glad I could help. I was having the same problem trying to find the solution to the resetting issue. Took me a long time to find out what to do. As far as the Arduino communicating back to the PHP code, I have not seen anything for that. I would think that the serial port would need to stay active and the webpage be suspended until it received data and then load the page. That boggles my mind. I’m sure it is possible though. I haven’t found anything on it though. When I do I will most likely post it on my Arduino Projects page.

      • Hi JDuke

        I am a newbie to Arduino so far I have not been able to get the very basic “Blink” to load. I have viewed several vids went to the Arduino, Adafruit, Sparkfun sites and I appear to have everything connected properly. I have been working on this for a month and still can not resolve the problem. Can you help?

        Thanks
        Mike

  17. Hi
    Thank you for the good work, I wonder if I can get the cods.
    Regards

  18. Hi there. First of all thank you for this amazing piece of software!
    I am very interested in getting this to work however i am having exactly the same problem as the person below. “Forbidden
    You don’t have permission to access /< on this server."

    I am using XAMPP on windows 7. I am assuming this problem is on all windows based machines. Have you tested the PHP on Linux or PC before?

    Regards

    • You are definitely welcome and thank you for reading. I can’t take 100% of the credit for the scripts but I have made a few changes for this specific project. I have one possible solution that I have been looking at. It has to do with Apache and could also have something to do with the PHP code. From what I have read from the link below, it may not be finding a file that is being asked for. Is this a brand new install of XAMMP or a previously configured install? Unless the configuration is setup differently the PHP script should work fine. Have you tried other PHP Arduino projects to see if they work? I would try that. I have not tested the PHP scripts in Windows or Linux yet. I have only tried it on my Mac. But it is configured to work on all of them. The only real difference is the way that the script calls up the serial port. For instance on a Mac it might be /dev/tty.usbserial and in Windows it might be COM1 or COM2 etc. Here is the link, I hope it helps a little. Sorry I couldn’t help much but I am trying to find a solution. It seems like this is happening to a lot of people and it tends to be in Windows. http://tinyurl.com/6kz2e6e – Sorry I updated the link. It was way too long.

      • Thank you for the quick reply. Its a brand new install of XAMPP for this project. I think you are right, i was going to mention that the function call for the port will be different on mac and pc. I will try and have another play tonight and let you know how it goes. I have a very interesting project on the go which i think you will be keen to see when complete :)

  19. Hi

    “Forbidden
    You don’t have permission to access /< on this server."

    when I click on links in "serialservocontrol" gives me this error.

    I use xampp or wamp with apache and php.

    can you help me?

    congratulations on your site very useful

    • Actually I have not run across any similar issues. I would guess that the web server may not be setup correctly. Do you have the latest version of PHP installed? Its also possible there is a coding error in the PHP files. Have you made any changes to your PHP code and maybe removed code on accident? try it with a fresh copy of the scripts and see if it is still happening. If so it could be the permission settings on the files as well.

  20. Hi Jerimiah,
    First off thanks for the code! I got the LED arduino PHP working with my PIC microcontroller on my Mac! The only thing is that I got it working on my localhost and I’m not sure how to publish it to the internet so that I can access it from anywhere! I tried uploading to my free php host, but because serialled control.php calls the serial class file, I think it’s having issues. Do you have any info on this topic? I know it’s not too related to your project but I think others could learn from the answer to this!
    Thanks
    DS.

    • @DS – Hello, I am glad you were able to get it to work. As far as I know, the only way to allow outside users to access the Arduino and the PHP code is to allow your local web server to have access to the internet/outside world. You would need a static IP from your ISP if you wanted to keep this going as a 24/7 un-interupted service. If its just a hobby, its no big deal. You could also use an Arduino ethernet shield but you would need to change the code significantly or even re-writing all of the code. There are some risks involved with allowing access to your computer by anyone on the internet. This is why it is a good idea to use a dedicated server machine and not the same machine you use for personal use. If you upload the php scripts to your paid/free host, they wont be able to communicate with your Arduino because the Arduino must be connected to the same machine that is hosting the php scripts…Unless you went the route of the ethernet shield which would allow you to run the Arduino as a tiny server. Hope I was able to help. Let me know if you have any more questions. -JDuke

    • To make your site work on the Internet, you do not really need a static IP from your Internet provider.

      Basically you need to do 5 steps:
      1) Get your thing working locally
      2) OPEN your web port on your router (port forwarding)
      3) Look up your WAN or Internet IP (check your router’s Status page, or visit a IP checking site like http://mywanip.com
      4) Ask someone OUTSIDE your network to TEST your port forwarding (can they reach http://your-wan-ip:your-port, ex http://24.166.17.119:81/ If this FAILS, revisit steps 2 + 3 + 4…
      5) Once you know your local network allows outside users in, go ahead and get a TZO acount (http://www.tzo.com). There’s a free trial. After this people just need to type http://your.tzo.net:81 or http://www.your.tzo.net/

      There’s some TZO tutorials here. http://www.tzo.com/MainPageSupport/TutorialsPage.html I didn’t see one for Apache, but I imagine it’s identical steps to setting up Microsoft IIS.,,

  21. Hey, I’m having similar issues. Not sure whats going on but whenever I click one the links I’m getting the “you don’t have permissions”. Not sure what I’m missing or overlooked.

  22. I’m having a strange issue when trying to run the “Arduino Serial LED Via PHP” project. If if have the sketch open in arduino and I open the serial monitor everything works perfectly. However if I try clicking on any of the links when the serial monitor is closed I get an error. The page will continue trying to load until I unplug the arduino.

    From the apache error log:

    PHP Warning: Unable to set the baud rate : the device is either not set or opened in /Users/ed/Sites/testing/php_serial.class.php on line 235, referer: http://testing.dev/serialledcontrol.php?action=greenoff
    The device must be set before to be open in /Users/ed/Sites/testing/php_serial.class.php on line 168, referer: http://testing.dev/serialledcontrol.php?action=greenoff
    PHP Warning: Device must be opened in /Users/ed/Sites/testing/php_serial.class.php on line 579, referer: http://testing.dev/serialledcontrol.php?action=greenoff

    It seems to hang on the fopen call in phpSerial::deviceOpen()

    Im running OS X 10.6.2, arduino 18, apache 2.2.13, and PHP 5.3.0

    I can’t tell from the videos whether you leave the arduino serial monitor open or not. Is this just a limitation, or is there something weird going on for me?

    Thanks for the insight

    • @Ed – I am having the same problem. I need to have the connection continuous in order to communicate. I have heard that the Arduino resets after receiving serial data in some cases. This might be the problem. They have a work around but it involves scratching a solder pad off of your Arduino if I remember correctly.

    • Yeah same problem here. PHP code works great with serial monitor open. When I close it, I get the same errors. Seems to be a common problem. I’m investigating serial proxies but I don’t know if that it is the answer. Let me know if anybody solves this.

  23. I couldn’t have said it better myself.

  24. Hey, I found this site through yahoo. Your blog is awesome. Will be back really soon!

  25. Thank you for your help!

  26. Hello, first I want to say great blog. I don’t always agree with your posts but it’s always a nice read.
    Keep up the nice work.

  27. Ok, I changed:
    <a href="<?=$_SERVER['PHP_SELF'] //I got error message, I think that is a problem with php.ini configuration.
    <a href="deviceSet(“COM1″)
    or when I close com1
    $serial->deviceClose();
    I know, it shouldn’t blink in this moment.

    There is no reaction for any other instruction like
    $serial->sendMessage(“0\r”);
    $serial->sendMessage(“0″);
    but serial monitor (“device monitoring studio”) show me this bytes, it should work but i haven’t seen any blink :/

    everything it’s ok when I use hyper terminal in my windows XP sp3, 12/13 pin working good.

  28. Is the serial port rs232 working on windows (php web/apache)? I got the message “You don’t have permission to access /serialcomm/< on this server."

    of course rs232 working with arduino and console, however not in the web :/

    Do You have any idea?

    Thanks

    • Thats strange. What version of Windows are you using. My best guess would be a security issue with Windows. Hmm… I might have to look into that more. I have not heard anyone mention anything about the serial connection not working with this Arduino project or the PHP code.


Leave a comment