Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need help creating USB interface device

Status
Not open for further replies.

lysedi

New Member
Basically what I am trying to do is create an "alarm" that will text/IM (even better if i could have a web cam snap a photo of my camera monitor and send that as well) me from my computer when the power is triggered. I have a motion light outside that turns on a light inside so I know if someone is in my alley, this works great if I'm here, but not so good if I'm not. So what I want to do is plug a stripped power cord into the same extension cord as the light inside and "hook" that cord up to my computer and have it recognize when the power is on, then send me a message via AIM or whatever. What I really need is a schematic for the power to USB and the basics on how to interact with it and I can probably figure out the rest. Any help will be greatly appreciated!
 
yep, USB I/O Interface. Also in kit form;
**broken link removed**
Andy
 
You want to send a SMS text message to your cell phone or an email or both? You have me curious.

Ron
 
This thread got me to thinking. I had one of these units lying around so I thought I would give it a try just for the heck of it. The same company also offers one of these units for about $29 USD but I used what I had.

Now I am not a programmer type but I have written a few scripts and played around with Visual Basic a little. The unit I used has 6 DIO lines (D0 through D5). So here is what I did. I wrote a script .vbs that looks like this:

Code:
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From = "me@my.com"
objMessage.To = "mycellnumber@vtext.com;myemailaddress"
objMessage.TextBody = "This is some sample message text."
'objMessage.AddAttachment "C:\Users\Ron\Pictures\Biscuit\B3.jpg"
objMessage.Send

It is a pretty common script and I saved it to my desktop as sendmail.vbs. The mycellnumber is my cell phone number and the @vtext is the verizon carrier for sms messages. Additionally after that I have my email in there. The objMessage.AddAttachment is not used but could be used however my carrier strips images from SMS text, which makes sense.

Next I wrote a little program in VB 6.0 to read from the DI148 DIO ports. I only used one port. When the port goes low it triggers the .vbs file and sends a text and email. Granted crude but it actually works pretty well. The use of multiple ports could be used to send multiple different messages depending on the port triggered.

Rather than external hardware and using a USB port the same could be done likely very easily using a parallel port.

Ron
 
Call me tight, but for AU$1.60 (inc. postage) you can have one of these: **broken link removed**. Connect the AC power to an optocoupler through a capacitor, zener, resistor and then connect the opto output to the above serial converter input pin (can connect to any of CTS/DSR/RXD). Open the serial port in your code and have it trigger on state change (or data rx'd) of the appropriate pin and you have a very cheap trigger.

For a simpler (and safer) setup you can plug a lamp into the power board, and have it detected by an LDR connected between the serial port CTS/DSR pin & RTS/DTR. You could also use a relay to trigger the pin on the serial port.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top