Worldwide microcontroller link for under $20

 by Dr_Acula
Picture_Rx.jpg
Control your home thermostat from work. Turn on a sprinkler from anywhere in the world by flicking a switch. This Instructable shows how to link two or more $4 microcontrollers using the backbone of the internet and some simple VB.Net code.

This builds on an earlier Instructable which shows how to link a microcontroller to a PC and use a pot to control a servo http://www.instructables.com/id/Control-real-world-devices-with-your-PC/ This time we have a microcontoller talking to a VB.Net program then to an ftp website, back to another VB.Net program and thence a second microcontroller anywhere in the world, with or without human intervention.

How else are the machines in The Matrix ever supposed to take over if they can't talk to each other?
 
Remove these adsRemove these ads by Signing Up

Step 1: Gather the parts

Picture_Tx.jpg
Many of the parts are the same as in the PC Control Instructable http://www.instructables.com/id/Control-real-world-devices-with-your-PC/ and it is suggested that this be completed first before attempting to link two microcontrollers. While it is quite possible to use a pot to control a servo, this time round we are going to go for something simpler - a switch turning on a led. The switch could easily be a tank level sensor and the led could be a pump down near a river but let's get something simple working first.

Parts - Two Picaxe 08M chips - available from many sources including Rev Ed http://www.rev-ed.co.uk/picaxe/ (UK), PH Anderson http://www.phanderson.com/ (USA) and Microzed http://www.microzed.com.au/ (Australia). These chips are under $4US.

Two of: Protoboard, 9V battery and battery clips, 10k resistor, 22k resistor, 33uF 16V capacitor, 0.1uF capacitor, 7805L low power 5V regulator, wires (solid core telephone/data wire eg Cat5/6), LED, 1k resistor.

1 of: D9 female socket and cover and 2 metres of 3 (or 4) core data wire (for download) and a toggle switch.

2 computers with 9 pin serial ports (can be debugged on one computer though) and an internet connection.

For computers with no serial port, a USB to serial device http://www.rev-ed.co.uk/docs/axe027.pdf and a small stereo socket.
techno guy says: Mar 6, 2013. 4:55 PM
I had a similar idea of remote control using an ftp server, I wrote a batch program that could read a file on the server and execute the command I uploaded. Good job.
marc_is_curious says: Jul 17, 2011. 7:54 PM
1st of all:
thanks for this interesting tutorial !

unfortunately (on this tutorial's behalf)
i am a macintosh user ....
i managed to rebuild the visual basic part via word
(via "tool/macro/visual basic editor")
but
receive the message "invalid outside procedure"
when running the script.

dioes anyone know how to translate
the visual basic part into "mac-able" code
or
use an alternative way to handle the
internet connection?
shaunak says: May 5, 2011. 3:10 PM
Thanks for the inspiring instructable. This FTP communication link opens up whole new avenues in communication with a micro. :)
verdastel says: Sep 11, 2010. 12:43 AM
Oh this is just a cool instructable, it inspires me to jump into microcontroler....it's the future...
parparcheese says: Apr 8, 2010. 2:00 PM
can you buy these chips on Digi-key?
wee_man says: Apr 3, 2009. 1:38 AM
Hmm wouldn't it be cool if a master pic sends its code up and then all the salves connected to to reprogram them selves to the master. is this even possible?
Dr_Acula (author) in reply to wee_manApr 14, 2009. 6:04 AM
I asked that question myself about a year ago. Finally got an answer! No, it can't be done with picaxe, you need something with a proper operating system. I'm working with 4 CP/M boards at the moment (N8VEM) connected by wireless. Yes, they can auto find each other, and yes, they can auto update new software and transfer it using wireless (xmodem). Working on getting a link between the wireless network and the internet - that is almost working now.
supra_2009 in reply to Dr_AculaNov 3, 2009. 11:05 AM
How do u complied hex files from vb2008?
ASAP!
wee_man in reply to Dr_AculaApr 14, 2009. 1:33 PM
Hey that sounds real cool you should keep us posted on that or maybe even write an instructable?
wee_man says: Jun 12, 2009. 2:44 AM
hi everyone i recently posted a instructable on how to program a picaxe automaticly from a bas file on an ftp server heres a link if your interested
http://www.instructables.com/id/Setting-up-to-program-a-picaxe-via-shell-scriptli/
brewbug says: Dec 5, 2008. 1:38 PM
What a great instructable! I thought with all that s/w there would be a problem or 2, but none. Everything worked great. I have Vista on one machine and XP on another. The Vista PC was short on com ports and an USB adaptor that is Prolific type was used on port 13. I will keep article and s/w for referance. Thanks for sharing this information. Bruce
plane phanatic says: Nov 14, 2008. 4:44 PM
Would this be possible to do with a Picaxe 28x chip?
Dr_Acula (author) in reply to plane phanaticNov 15, 2008. 12:37 AM
Of course. And I don't think you would need to change the code either. Just pick which pin is going to be the input and which will be the output.
plane phanatic in reply to Dr_AculaNov 15, 2008. 8:51 AM
Thanks!
astrozombies138 says: Oct 25, 2007. 9:27 AM
sigh* mac compatable?
conrad2468 in reply to astrozombies138Jul 8, 2008. 12:08 AM
actually the basic stamp is mac compatable as long as you dont get the DAME SERIAL TO USB CABLE FROM RADIO SHACK!!!!!!!!!!!
Dr_Acula (author) in reply to astrozombies138Oct 26, 2007. 12:07 AM
I'm not an expert on Macs, do they have a real world interface (USB?). If not, maybe get an old PC (can I say that?). My kids have the fast computers in my house but much of my development is done on an old 300Mhz machine. Anything under 800Mhz is a giveaway item at computer stores (the pile is out the back mate, take what you want as we are taking it to the tip next week).
supra_2009 in reply to Dr_AculaNov 3, 2008. 5:41 AM
Can vb.net such as vb2008 will burned to pic16F628?
ratmandu in reply to Dr_AculaNov 26, 2007. 2:48 AM
Macs do have USB (If I remember correctly, apple is even part of the USB-IF) and are able to use just about any USB-RS232 adaptor, As well as USB-Parallel adaptors. It is also very easy to create a program with the same (or better) functionality with the free, full version of Apple XCode (which comes on all OSX Discs, and you can download free at http://developer.apple.com )

I've been using XCode 2.4 on tiger, and now 3.0 on leopard with a USB-RS232 adaptor, and OSX-AVR to do stuff with AVR microcontr
arniew1965 says: Oct 29, 2007. 3:56 PM
Fabulous instructable Dr Acula. I've long dreamt of a remote control for my picaxe controlled brewing machine! (http://hermanmachine.spaces.live.com/) Thanks for giving me the steps to put that together.
Dr_Acula (author) in reply to arniew1965Oct 29, 2007. 4:36 PM
That's a good idea. You can have the brewing kit at home and at work you could have a digital temp display and a manual override if it gets too hot or cold. Strobe lights could go off if the temp is out of range. And if the data link is broken because some nefarious individual breaks into the beer brewing shed and tries to steal the beer, you can rush home and catch them! Or at the very least the temp will stay in range and you won't end up with a toxic homebrew like my neighbour used to make.
arniew1965 in reply to Dr_AculaOct 29, 2007. 10:57 PM
Hmmm, I can see a case for a streaming web cam for shed security ;-) And with this great idea you could pump brewing water out of the stream and make the nectar in one of your remote sheds, only needing to walk up the hill when it is time to pull that pint. Cheers
FamilyGuy2006 says: Oct 26, 2007. 7:39 PM
Absolutely Amazing! I'll be shopping for parts right after Halloween. The hard ware is cheap, the software is done for me (Thanks). Have you thought of any practical applications? Or impractical for that matter? I see so much potential, but I'm not seeing the killer app. Anyone have useful or silly ideas on how to use this?
Dr_Acula (author) in reply to FamilyGuy2006Oct 27, 2007. 9:35 PM
This may not have many practical applications exactly as it is because two computers need to be on to send messages. By the time a computer has been booted and the program started it probably would be easier to turn the thermostat on manually. But there are two things I think that are useful. The first is vb.net ftp code. With a few simple changes the file being sent can be index.htm which is the default home page for most websites. I have a vb6 program uploading pictures round my house to a website every 30 minutes and this can be easily ported to vb.net. The second application is to leave out the computer. There are a number of embedded web server chips available (eg Simplelan) which ought to be able to make direct chip-to-chip comms possible without needing the computer. Eg when away on holidays it could be possible to turn on sprinklers and lights at home. I'm sure there are devices available already that do this - the trick is to do it as cheaply as possible. I'll try to think of some more ideas...
alcurb says: Oct 25, 2007. 12:39 PM
Nice project! Don't know if it the fault of the poster or the posting software, but the code could be a lot easier to read if it had the structured indents.
Dr_Acula (author) in reply to alcurbOct 25, 2007. 4:00 PM
VB.net will automatically put the indents and the colors back in when you paste in the text. One of the nifty new features of the newer versions of VB.
alcurb in reply to Dr_AculaOct 25, 2007. 4:30 PM
I'm aware of that feature of VB, but it is not the sort of thing one can easily do from an internet cafe if all one wants to do for now is read and follow the code. Nice project!
Dr_Acula (author) in reply to alcurbOct 25, 2007. 7:16 PM
I have added 6 more steps with screenshots of the vb.net code. It is a bit hard to read due to the jpg compression but probably easier than the raw text. Hope this helps.
trebuchet03 in reply to Dr_AculaOct 25, 2007. 7:47 PM
Clicking the "i" button will bring you to higher resolution version of the image ;)
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!