About this site

This is a collection of code samples for physical computing, on a variety of different platforms. More thorough introductions to the platforms involved can be found on my main physical computing site. The examples here assume you know the basics, and are ready to program and/or build. You’ll also find links to other code samples here as well.

If you’re looking for an introduction to electronics or physical computing, check out the pages on electronics, microcontrollers, input & output, and others for my class notes on those subjects.  You’l find links in the menu to your left.

I’ll also post resources for building things and buying things here; in other words, things that used to be on my resources blog.

If you don’t find what you’re looking for, you might also check my general blog which needs a name, where I put more recent links, topical links that are likely to be irrelevant in time, and things that don’t fit into the categories here.

Creative Commons License
Code, Circuits, & Construction blog by Tom Igoe is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

-Tom Igoe
31 August 2007

32 Responses to About this site

  1. Pingback: links for 2010-03-01 « Caronresearch’s Blog

  2. Tiago Martinho says:

    I like very much your project Arduino-based RFID reader, I have a question can I use and modify your code on a school project? I will of course show the source on presentation.

  3. tigoe says:

    You can use code from this site, as long as you provide attribution and release your modifications. It’s all released under a cc license, see the bottom of the page.

  4. John Baumer says:

    Hi Tom,
    I do not understand much of what is on your site. I would like to build a bank of 48 led and 48 uv lights and pulse them at frequencies up to 10,000 per second. I found a frequency generator at resonantlight.com called the Pro Gen ll but the output is only 100mA and the engineer says I need a high current transistor switching circuit to produce the desired power. Any ideas about how I can build one or buy one?

  5. kyle says:

    Hey tigoe, very nice site you have here! I’m starting a project using a Lantronix Xport to web enable my microcontroller (not arduino). Is there a way that you know of that using DHCP, my microcontroller can print the IP address to an LCD or something by obtaining it from the Xport? I’m trying to find a way where I can just plug into any network and see what IP it gets assigned without having to run DeviceInstaller or any other sniffer to find the IP from another network device on the segment. It’s my first project with network devices so any advice would be appreciated. Thanks.

  6. tigoe says:

    I haven’t used the Lantronix devices in a couple years, but at that time they could do DHCP. You just set the IP address to and let the network self-assign. However, you have no way of knowing the device’s address remotely without it contacting you. I have an example somewhere on this site that sniffs out Lantronix devices via UDP though.

  7. tigoe says:

    I’m afraid I can’t help you with that,sorry. You might want to start with a good electronics text book, to get a sense of how it’s all done. I have some recommendations for books here: https://tigoe.com/blog/topics/books/

  8. Ron says:

    Hi Tom, nice work on the site. I’m running your DHT11 pachube sketch that you put together. After a bit of a learning curve on my part since the Arduino is so new to me, I got things configured and am now streaming 4 data streams via 2 separate UNO’s and Ethernet Shields. Unfortunately after x number of hours (it varies) they will inevitably stop pushing data to pachube. They’re not locked up, and if I fire up the serial monitor they will configure the IP via DHCP and start sending data again, no reset needed or anything like that. Any thought on why this is happening? I know there were some issues with these Ethernet shields but these are pretty new. Anyway, thought I’d ask before I really start digging in to this!

  9. tigoe says:

    Most likely it’s resetting because the counter for the millis() is overflowing. Check this post from Rob Faludi for a solution to that: http://www.faludi.com/2007/12/18/arduino-millis-rollover-handling/

  10. Beat Graf says:

    Hi Tom
    Im using the telnet client code where for arduino. Did you use it in a project.
    In my project I want to connect to a music system for control, but it takes about 2 minutes until the client connects. Controlling the music system with putty works great.

    Beat Graf

  11. mostafa says:

    Thank you very much ,your explination is great very thanks to you for all of that wanderfull topics

  12. Mark Schulz says:

    Hi Tom

    Love your work here.

    I might be mistaken, but when working in RESTful designs, I thought that the URL is used only to identify the resource, and the values passed in and out should be passed in the body of the HTTP message. I know that there are lots of cases of this not being the case, but that this is then not really the RESTful way.

    So, to use one of your examples,: to get the price of item 3045 one would form up the URL http://www.mystore.com/item/3045/price and then issue a GET request; the price (if valid) comes back in the body of response with a 400 response code, else one gets an error response code with an error message indicating the issue. Similarly, to set the price of item 3045, one forms up the same URL http://www.mystore.com/item/3045/price and issues a PUT (or a POST) request with the price in the body of the request; the response should be a 400 code if successful, or an error code indicating the issue along with an error message. Have I missed something, or am I being too pedantic?


  13. tigoe says:

    You’re probably correct, though I’ve not heard that particular explanation before (I assumed a 200 response code was fine). I use the term loosely, which is why I linked to more detailed sources. My aim was to show how to think about a URL as something other than a filepath, and to show how to take the useful bits and pass them on to attached devices.

  14. PéOO says:

    Hi tigoe,

    During the last 2 days, I followed your tutorial on the communication over serial between arduino and a web browser using node.js with serialport. Superbe work and everything worked nearly as expected. I just dont get the CSS formating from the second tutoriel (Serial to JSON in Node.js and Arduino) when I visit the localhost. Where the CSS coming from? I only have the index.html and serialtoJSON.js in the projet folder…
    I’m sorry for the question since it’s probably obvious!

  15. Kaveri Kale says:

    I like your site very much. It is very good for bigginers those who want to start working in embedded system.It is very helpfull atleast for me.

  16. senator odeh says:

    hi.. let me start by thanking you for this website ,, its really helpful.
    i need your advice. im doing a project for my school.
    We are building an automatic irrigation system using a microcontroller. We as the designer will provide data entry for the microcontroller( our program) which will be connected to a relay. A relay will work as a switch ON/OFF.
    We would like to use a C or C++ language, our budget for the microcontroller is between 30-80$ dollars..
    Do you have any suggestion of a microcontroller, and how we safely connected in the circuit so it won’t burn?
    Thank you so much for your time and effort

  17. tigoe says:

    You could do it with an Arduino, which is at the low end of your budget, and with a relay or H-bridge circuit. See the motors pages on this site for more detail.

  18. tigoe says:

    You don’t need the CSS. It can come from anywhere though, just put in the full URL of the style sheet you want to use.

  19. tigoe says:

    Sometimes it can take awhile to connect, because the Arduino needs to get an IP address from the router on reset. Once the connection’s made though, it should be pretty instantaneous throughput.

  20. Jim says:

    Hi, Tom. Commenting doesn’t appear to be enabled on your post about MIDI communication. I have a quick question. The inverter is only necessary to undo the inversion from the serial link, yes? If you were to build a switcher that directly connects a MIDI output to a MIDI input, this wouldn’t be required?

  21. Michael says:

    You said in one of your posts, that it be nice if there was c/c++ compiler for PRU so we didn’t have to program in assembly language. TI has one to download at this address http://www.ti.com/tool/pru-swpkg. Hope I am the first find this. I use Notepad++ as an editor.
    Hope this helps others.

  22. Because of changes in your GitHub directory structure, links break on your page: http://www.tigoe.com/pcomp/code/arduinowiring/1096/

    Two broken links are found in this section:

    “Here’s the index page. It opens a webSocket back to the server, and listens for events from the server, labeled “serialEvent”. Whatever data it gets from the event, it prints to a DIV inside itself. See the inline comments for more details. Save this in /nodeSerialServer.

    Here’s the server. It starts a web server and listens for HTTP requests for /index.html, and serves it out when asked. It also listens for incoming webSocket requests, and opens them. When it does so, it start listening for serial events. If it gets a carriage return and newline in the serial port, it sends what it got out to the websocket. Save this in /nodeSerialServer too.”

    Thanks for sharing your work.

    Sadly I have been unable to replicate your Serial to Browser work.

    The server simply responds: “Cannot GET /”.


  23. Arwed says:

    Hi, I’m very interested in your code example with websocket and serial connection. But unfortunately obviously the Git page is not reachable anymore. Could you, please, send me an updated link and/or make a little update on the WordPress page?

    Thanks a lot!

  24. tigoe says:

    Updated. This should no longer be an issue.

  25. Carlo says:

    Hi there,
    just wanted to know where to find the server js mentioned in this post:

    …as the link is no more valid.
    Thank you!

  26. tigoe says:

    That post has been fixed, and updated. Nowadays I prefer ws.js over socket.io, and the code now reflects that.

  27. tigoe says:

    I’ve updated the links, though pachube, later xively, is now part of the Google IoT Cloud platform, so I can’t guarantee any of the pachube code still works. I haven’t used the Google IoT Cloud platform, so you’re on your own there.

  28. Pete C says:

    Tom, I want to thank you for posting your Pre-flight for MKR GSM 1400. i’ve been utterly lost for a week until I stumbled upon it. I feel like i’m finally up and pedaling a bike for the first time, after fumbling around for days, thanks to you. Seriously appreciate it!

  29. tigoe says:

    Happy to be helpful!

Leave a Reply