Showing posts with label touch sensor. Show all posts
Showing posts with label touch sensor. Show all posts

Tuesday, January 4, 2011

Analog Multiplexer for NXT touch sensor by STAAK


STAAK posted on the Polish LUGPOL forum an nice instruction guide in How to build a touch sensor multiplexer.




He describes:" For both multiplexers I used resistors with values 32k, 10k, 68k, and 150k. The NXT touch sensor already have a built-in additional 2.2 k resistor.

By design, the two multiplexers (RCX, NXT) will work with the NXT via a single block in NXT-G. Because the use of the internal resistors (and the same precision resistors), I needed to create a block for the NXT-G that allows the thresholds to be set by the user. Normally when you insert a block to the project can be seen only as the left side of the settings. Select the checkbox will show a window for manually setting the appropriate thresholds.

Block Parameters:
Port: 1 to 4 = the Port connected on the NXT
Limit: 1 to 6
TH1000 for threshold limit of 5 = 520 indicates that this threshold is detected in the range 515 < TH1000 < 525.
Threshold: 0 to 1023

Drop-down box in the left window is used only for viewing a given threshold value.
A threshold value is nothing more than the raw value for the relevant states of the configuration of sensors

TH1011 should be read as TH Sensor1=1 Sensor2=0 Sensor3=1 Sensor4=1 where
Sensor1 = in series with 10k resistor
Sensor2 = in series with 32k resistor
Sensor3 = in series with 68k resistor
Sensor4 = in series with 150k resistor

The output signal from this block is the four outputs (T1-T4), True / False
where True state of the output indicates that the sensor is pressed.

After setting the threshold check block, save the project.
The Copy/Paste option allows you to insert the block into a new project together with the pre-set thresholds.

Click here to download the block.




The cost of the multiplexer elements was less than 2$ for the resistors
The NXT-G block was written in LabView with the overlay LabVIEW Toolkit for LEGO MINDSTORMS NXT available on the National Instruments.

see also his Brickshelf folder.

Well done STAAK!

Saturday, August 29, 2009

NXT 2.0 Hammer Car


This Hammer Car project for NXT 2.0 extends the 3-Motor Chassis design to add a swinging hammer weapon up front, and extends the 2-Button Remote Control program to add wired remote control for the hammer (as well as a fun laughing sound) from the same two buttons that control the driving and steering. In order to squeeze 6 operations (left, right, forward, stop, hammer, laugh) out of only two buttons, timers are used to distinguish the difference between a button being pressed and held down vs. quickly tapped, as shown in this video:



I posted an NXT 1.0 Hammer Car project about a year ago that used only one touch sensor for the remote control. It used a similar timing trick, but was significantly harder to maneuver due to having only one button control.

Thursday, August 27, 2009

NXT 2.0 2-Button Remote Control

The NXT 2.0 kit doesn't come with a handheld remote control (there is a new software one for Bluetooth control from your computer), but it does come with two touch sensors, so you can use them to make some simple wired remote controls. A remote control is useful for several things like prototyping, experimenting, as well as just to have some fun controlling your creations. Also, some creations you build might be partailly autonomous and partially user-interactive, so it is useful to have some remote control programming strategies under your belt.

This NXT 2.0 2-Button Remote Control project is extremely simple mechanically, but the main point is to show some basic strategies for 2-button remote control programming. Two programs are provided, a simple one that just chooses one of four actions depending on the state of the buttons (left, right, both, neither), and a more complex one that adds timers to make driving motions that accelerate smoothly in each direction. More complex or different variations will follow in other projects.

Here is a video of these two programs used to drive the 3-Motor Chassis vehicle:


So what about NXT 1.0? Can you use this stuff too? Yes and No. NXT 1.0 only comes with one touch sensor, but you can easily buy another touch sensor. There is nothing really NXT 2.0-specific about the programs I have posted, but they were created and saved by NXT 2.0. I tried using them on NXT 1.0, and here's what happened. You can open and view them in the 1.X software, but I tried to compile and download to the brick, and I got "Internal Compiler Error". So, you can at least look at them to study how they work, then do something similar in a new 1.X program.

Thursday, January 29, 2009

PF IR Receiver as Wireless Touch Sensor


Here are the details on the trick that I used in my Battle Tank project to get the NXT to read sensor input from the Power Functions remote control. See the "Method 1". This allows the NXT to see the IR receiver as a single touch sensor, which is actually quite easy to do if you have the two wires needed (PF Extension Wire and RCX Conversion Cable). The "Method 2" was an earlier and much more complex way to get full control from both levers (9 states).

You only get one touch sensor out of this, but with a little timing trick in the NXT program, I made the single PF lever control two NXT-triggered functions on the Battle Tank. A quick press and release of one lever triggers the scissor stabber with one NXT motor, and a press and hold of the same lever triggers the dart gun with another NXT motor. This leaves the other lever on the same channel open to run a PF M-motor in both directions to implement the unfolding saw blade (same M-motor folds/unfolds via a worm gear while also spinning the blade by up-gearing). Then the other IR receiver is attached to the two PF XL-motors to do the driving on another channel.

It looks like you could extend this trick to get two touch sensors by connecting the other half of the IR receiver to a second sensor port on the NXT, but this doesn't work. Pressing either lever ends up triggering both touch sensors. Wondering what was going on here, I consulted Philo, who kindly explained that the whole setup is electrically questionable to begin with because the PF and NXT sides don't share a common ground, but it ends up working and being safe with one sensor, but attaching two creates a strange current flow and also results in a short circuit condition if the levers are pushed in opposite directions. So don't bother trying that...

Thursday, January 15, 2009

New Products From HiTechnic

There were several very nice surprises in the new LEGO Education catalog. Besides WeDo, there are three gems from HiTechnic. The first is a simple touch sensor multiplexer for the NXT. The idea is that by combining multiple touch sensor on one input port (but giving each a slightly different resistance), you can detect not only when one is pressed but which one is pressed. This was something that was commonly done with the RCX, but there hadn't been a commercial product to do it as yet for the NXT: it appears HiTechnic has stepped up and filled that gap. Four touch sensors can share a single input port on the NXT, greatly expanding the number of touch sensors you could use (at least 16; enough to build a simple keyboard, perhaps). The square "bumps" on the housing are spaced so that a studless beam nestles neatly between them, allowing you to "clamp" or "bracket" the housing in place (without going to the trouble of LEGO-certified pinholes etc.). The NXT-G block (downloadable from HiTechnic) is also well-designed, with a lot of careful thought into how to make using this sort of system as easy as possible, while still allowing the user a huge range of combinations. At $29 (without the extra touch sensors), it's not a bad price either, and you can buy it from LEGO Ed as a package with extra touch sensors for $98. One caution: this will only multiplex touch sensors, not other types.

The other interesting thing is the Tetrix system, designed to be used in FTC and based on the NXT brick. Tetrix uses metal pieces in place of some LEGO elements, but more interesting for many of us is that it uses true servos. It turns out both the servo controller and the DC motor controller are built by HiTechnic, and can be bought individually from LEGO Ed. At $80 each (either version), these aren't cheap, but they are at least now available... and very tempting. The catalog says you can daisy-chain up to four units off a sensor port (not a motor port), and they have their own battery connections so the power driving the DC motors and servos is not coming from the NXT, but from supplementary battery systems. Ideal for powerful motors, and this can greatly expand the number of motors potentially under control (I might end up with something like this for HALE-style, light-weight missions that still need a lot of actuators, for example). These elements do not have (to my knowledge) any NXT-G blocks for them (and they are currently sold only through LEGO Ed), but that makes sense in that FTC generally uses ROBOTC or LabVIEW or similar... and I'd be surprised if it wasn't at least possible to interface them down to NXT-G (it's all the same hardware, so at most it might be a firmware issue). Other interesting robotics products are DC motors, motor encoders, servos, LEGO "hardpoint" connectors (allowing the LEGO elements to interface with the Tetrix metal pieces), as well as lots of other hardware). Take a look.

--
Brian Davis