How to attach physical sensors to computers? (infrared, laser) - sensors

I am working on a project where I need to attach a sensor to the computer like laser sensor or an infrared sensor, to use in a foul line detection. Basically the idea is, if someone steps on the foul line, the laser or infrared will be blocked by person's foot, and the laser/infrared won't be received by the receiver, causing the sensor to send a signal to the computer.
The problem is, I don't know where to start something like this. How would I go about attaching a sensor to a normal computer (like a normal PC that we use)? If someone could direct me into a direction or has any inputs, that would be really appreciated. Thanks a lot!

You may want to look at Arduino (http://www.arduino.cc/). It is an open-source microcontroller that can be used along with a computer and is designed to be hooked up to various types of sensors. It also has an extremely helpful, active support community.

There are several approaches to the task of bringing the sensor signal into a PC (to take advantage of PC's computing power, good user interface, connectivity to the web).
Look for integrated sensors that have an interface for attaching to a PC (RS-232, USB, Ethernet). For example, you may find something useful by googling photodetector USB.
There are I/O (input/output) devices for PC. They have analog and digital inputs and outputs. Look up LabJack, National Instruments USB-6008 and dozen other types of commercial USB I/O boxes.
Connect sensors to a microcontroller (uC), then connect uC to the PC through a USB or RS-232 or Bluetooth (the list goes on). This involves more hardware. You'll need to write firmware for the microcontroller too.
Obviously, which approach to choose depends on your skills (or willingness to acquire new ones), timing, budget, team structure (if it's a team effort).

You could use a photo-transistor and a Yocto-Knob. The Yocto-knob is an USB device able to quickly detect resistivity changes, you just have to connect the photo-transistor to it. Here is an application which looks pretty similar to yours: they use a light barrier to detect and photograph a fast object:
http://www.yoctopuce.com/EN/article/how-to-drive-a-camera-shutter-automatically

Related

Bluetooth Low Energy - Connecting to same device

I'm writing a Bluetooth Low Energy library. For now, it will only run on Linux (and with Bluez 5.41+).
I'd like to have tests that can be run on any computer with BLE support and test the entire stack (application, host and controller), without requiring extra hardware (another BLE-capable device). Requiring extra hardware is a great way of making sure the tests won't be run more than once in a blue moon.
For that end, I'd like to use my computer to connect to itself (as both a peripheral and central) during the tests. It seems like this should be possible, since I can be connected at the same time as peripheral and central to other devices. But advertisements from my own computer never show up on (my own computer's) BLE scans.
Is it all possible to have the computer connect to itself in this way?
No, not if you only have one Bluetooth controller.
The reason is that radio peripherals can only transmit OR receive in a given time moment.

HC-06 bluetooth with FPGA

I have to use the HC-06 bluetooth module (the one usually used for arduino projects) with a de0-nano altera fpga kit.
I really have no idea how to go about it. Am I suposed to treat the HC-06 as a simple serial port and just implement the UART communication? I have to develop a verilog design for it.
Apparently the communication with HC-06 and the FPGA must happen over a UART interface. so, go ahead and write some logic to implement UART on FPGA so the communication can take place. In the process of doing so, a lot of things will get clear for you.
Does this look like doYourHomeWork.com? lol I would start here.
They have some examples of connecting hc's to different systems, and it's only 16 pages with loads of pictures.
edit: Additionally this provides some great information about working with your hc chip in the context of arduino. As far as how things are done (enter at mode etc...) It explains nicely.

How to determine the power status of a monitor/TV in Linux

I asked this same question a few months ago, but I've run into another roadblock and I'm hoping someone will have a flash of insight. The is the previous thread: Detecting if the monitor is powered off
I'm trying to figure out the power status of a monitor, in particular a TV that is plugged in via HDMI. I'm running Ubuntu 10.10 with nVidia ION video cards. These PCs will be running some digital signage and I need to make sure the power is on to the TV during business hours. I have a working Python script controlling an IR transmitter to turn the TV off and on. The last piece of the puzzle is to know the current state of the TV.
In my previous thread, I found I could use ddccontrol to get information from the monitor. That worked great for a traditional Asus monitor plugged in via HDMI. However, the Vizio TV says it doesn't support DDC.
I've also tried using get-edid to get live resolution and color information, but that fails to return any information from the TV.
I've tried udevadm monitor but an event only fires on the initial monitor plugin.
I have a feeling that the nVidia drivers are blocking these calls to the monitor, but I can't confirm that.
Ultimately, all I'm looking for is a single byte of information that changes when the monitor turns off.
EDIT: So, I'm coming to the conclusion that this may not be possible. At least not consistently possible across various combinations of video cards and monitors/TVs. The next idea I have is to monitor power usage on an outlet. I first looked at Kill A Watts, but they are completely stand alone. After several hours of searching, I came across Digi and their XBee radios. I ordered one of XBee's Smart Plugs from Digi and a XBee radio and USB adapter from Spark Fun. My current plan is to use a Python script that polls the Smart Plug for power usage.
The plug and radio were kind of expensive. Does anybody know of a power meter that plugs in? Everything I found was wireless. I'd like to be able to connect to it via USB, ethernet, or serial.
EDIT 2:
I could never get the XBee plug to work. It's incredibly difficult to configure the plug unless you buy one of Digi's gateways.
I ended up building my own current sensor. It's Arduino based and cost about $60 in parts. I wrote about it here: http://trafficlightads.net/2011/09/06/an-arduino-current-sensor/
I have a couple of Watts up? .Net models that have USB and Ethernet for monitoring devices and controlling devices. The .Net model adds Ethernet and an internal relay to turn the attached device on and off. This could be used to eliminate the possibility of IR being blocked and not being able to transition the state of the TV.
Watts up? .Net Product Link
They aren't cheap, but they are well-built. I recommend getting the international model if you want the most flexibility in outlet type. This allows you to use your own in and out cords. In the USA model the input cord is hard-wired/integrated.
Good luck.

Simulating a keyboard's output (making a computer pose as another computer's keyboard)

I want to be able to connect a computer A's USB port to computer B's USB port so as to make computer A act as computer B's keyboard.
Any idea how I would go about doing that?
I'm not looking for a ready-made solution (though if one already exists and is open-sources I
would not object), but for a starting point or a good resource.
I imagine I'd need to write a driver that simulates the keyboard's protocol, and I would also need to sort out the entire USB master/slave scenario.
Anyway, any help would be appreciated.
P.S.
I want to do it with the mouse as well, but I imagine it will be a very similar process, and I think (but I might be wildly mistaken) that starting with the keyboard will be easier.
I am really excited to have found something that will do this from Hagstrom Electronics. It take a serial input and sends a USB keyboard output to another PC. If you combine this with a readily available USB to serial adaptor, then you are golden.
http://www.hagstromelectronics.com/products/usbkm232.html
I have been searching for weeks to find this, so I decided to go back to some forums and share the discovery.
Linux has support for USB gadget mode, but I think you need special hardware for that. I.e. the USB port in a normal PC can not do gadget mode.
An alternative is to wire an LPT port to a PS/2 keyboard input, this is technically simpler.
If it wasn't for the USB, I'd connect the two via LAN and have a client/server C# program that emulates a keyboard / mouse (e.g. via DirectInput).
For the USB part as far as I can tell you'll need some hardware adapter. If you're into hardware development or at least unafraid of a soldering iron and some µc programming, have a look at http://www.obdev.at/products/vusb/hidkeys.html where a HID stack for a small atmel chip is available for free. For this solution you'd need two atmega chips which communicate via I²C or SPI or such.
I'd recommend electrical separation of the two pcs, too. You never know if they share the same electrical ground or not.

Bluetooth UUID discovery

Does anyone know how a bluetooth device could pick up the discoverable devices' device IDs in range?
I am ideally looking for the simplest solution that involves the smallest implimentation of the bluetooth protocols.
A starting point would be good, I just wish to create a device that can store all the device ids of nearby bluetooth devices with minimal power consumption, preferably just using radio frequencies and not SDP and whatever else.
If you can't help me with this, please can you help me find good reading material for low level bluetooth (step by step) communication. The reading online is so high level that I cant work out what is actually sent, when.
Laalto nailed the answer from the Bluetooth spec/stack POV, but your question implies your looking for a stand-alone Bluetooth device - not just a laptop app scanning surrounding devices.
I can only speak for the BT chips that the company I work for manufactures (Cambridge Silicon Radio - CSR) but our chips can do that pretty much out of the box. Our chips have an on-board Virtual Machine sandbox that allows access to the firmware functions and Bluetooth stack of the chip. You can easily write a C code app to run in the virtual machine sandbox, on chip, that periodically scans for discoverable devices around, grab their ids and then download them when connected via USB or Serial, or maybe over BT when a device connects to the listener directly.
www.csr.com and www.csrsupport.com for chips, dev-kits, design references, etc.. etc...
You probably want a module with the extra HW (UARTs, USB etc...) as well as just the chip but you could implement this with something the size of a BlueTooth USB or probably smaller.
It would really help to know more about what your trying to achieve, why you want something that just scans the surrounding bluetooth devices and how big the device needs to be.
Sorry if this sounds like advertising. For balance: Broadcom make BT chips too!
The Bluetooth specs from http://www.bluetooth.org are a good starting place for low-level information. You need an account to access the specs, but you can create one for free.
Basically what you need to do is to go into Inquiry mode periodically and grab the response packets as they arrive. The more time you spend in Inquiry mode, the more likely you will discover devices in range: discoverable devices enter the Inquiry Scan mode only relatively rarely; it takes some time (10.24s at least with older Bluetooth versions) to scan all the possible frequencies in the Inquiry/Inquiry Scan frequency hopping schemes. And even then you can have suboptimal radio conditions.
For implementation I suggest you at least start with existing Bluetooth libraries such as BlueZ and do not attempt to create your own from scratch.

Resources