Posts with «scanner» label

2D-Scanner Records Surfboard Profiles for Posterity

[Ryan Schenk] had a problem: he built the perfect surfboard. Normally that wouldn’t present a problem, but in this case, it did because [Ryan] had no idea how he carved the gentle curves on the bottom of the board. So he built this homebrew 2D-scanner to make the job of replicating his hand-carved board a bit easier.

Dubbed the Scanbot 69420 – interpretation of the number is left as an exercise for the reader, my dude – the scanner is pretty simple. It’s just an old mouse carrying a digital dial indicator from Harbor Freight. The mouse was gutted, with even the original ball replaced by an RC plane wheel. The optical encoder and buttons were hooked to an Arduino, as was the serial output of the dial indicator. The Arduino consolidates the data from both sensors and sends a stream of X- and Z-axis coordinates up the USB cable as the rig slides across the board on a straightedge. On the PC side, a Node.js program turns the raw data into a vector drawing that represents the profile of the board at that point. Curves are captured at various points along the length of the board, resulting in a series of curves that can be used to replicate the board.

Yes, this could have been done with a straightedge, a ruler, and a pencil and paper – or perhaps with a hacked set of calipers – but that wouldn’t be nearly as much fun. And we can certainly see applications for this far beyond the surfboard shop.

Use an LED matrix as a scanner

Consider that a digital camera uses an array of sensors to capture light from an object. Maker Marcio T, however, decided to turn this idea on its head and instead use an array of lights that are detected by a single sensor.

The way it works is that as each LED in a 32×32 matrix illuminates, a phototransistor picks up light if the path is clear or sees no change if the path is blocked. So when you put an object on the matrix, the sensor is able to get an accurate picture of it, enabling its Arduino Uno controller to then generate its silhouette. 

It’s a simple yet very clever hack, and if you pay close attention in the video below, you can see the lights scanning from the bottom to top before the image is produced.

Ordinary digital cameras work by using a large array of light sensors to capture light as it is reflected from an object. In this experiment, I wanted to see whether I could build a backwards camera: instead of having an array of light sensors, I have just a single sensor; but I control each of 1,024 individual light sources in a 32 x 32 LED matrix.

The way it works is that the Arduino illuminates one LED at a time, while using the analog input to monitor changes in the light sensor. This allows the Arduino to test whether the sensor can “see” a particular LED. This process is repeated for each of the 1,024 individual LEDs rapidly to generate a map of visible pixels.

If an object is placed between the LED matrix and the sensor, the Arduino is able to capture the silhouette of that object, which is lit up as a “shadow” once the capture is complete.

Arduino Blog 01 May 18:55

ESP-13 WiFi Shield Web Server

Description

This tutorial will show you how to setup a simple webserver on your ESP-13 WiFi Shield and display a table of all of the WiFi Access Points within it's range (and refreshed every 5 seconds).
The ESP-13 shield will create it's own WiFi access point, which means that you can take this project anywhere you want to. You do not have to be connected to your home/work WiFi network to see the webpage. The limitation however, is that your device must be within WiFi range of the ESP-13 WiFi shield in order to see the results of the WiFi scan.

Let me show you how to put this project together:
COMING SOON....

ScottC 16 Sep 18:13

Debunking Moon Landing Denial with an Arduino and Science

It’s sad that nearly half a century after the achievements of the Apollo program we’re still arguing with a certain subset of people who insist it never happened. Poring through the historical record looking for evidence that proves the missions couldn’t possibly have occurred has become a sad little cottage industry, and debunking the deniers is a distasteful but necessary ongoing effort.

One particularly desperate denier theory holds that fully spacesuited astronauts could never have exited the tiny hatch of the Lunar Excursion Module (LEM). [AstronomyLive] fought back at this tendentious claim in a clever way — with a DIY LIDAR scanner to measure Apollo artifacts in museums. The hardware is straightforward, with a Garmin LIDAR-Lite V3 scanner mounted on a couple of servos to make a quick pan-tilt head. The rig has a decidedly compliant look to it, with the sensor flopping around a bit as the servos move. But for the purpose, it seems perfectly fine.

[AstronomyLive] took the scanner to two separate museum exhibits, one to scan a LEM hatch and one to scan the suit Gene Cernan, the last man to stand on the Moon so far, wore while training for Apollo 17. With the LEM flying from the rafters, the scanner was somewhat stretching its abilities, so the point clouds he captured were a little on the low-res side. But in the end, a virtual Cernan was able to transition through the virtual LEM hatch, as expected.

Sadly, such evidence will only ever be convincing to those who need no convincing; the willfully ignorant will always find ways to justify their position. So let’s just celebrate the achievements of Apollo.

Keytar Made Out Of A Scanner To Make Even the 80s Jealous

Do any of you stay awake at night agonizing over how the keytar could get even cooler? The 80s are over, so we know none of us do. Yet here we are, [James Cochrane] has gone out and turned a HP ScanJet Keytar for no apparent reason other than he thought it’d be cool. Don’t bring the 80’s back [James], the world is still recovering from the last time.

Kidding aside (except for the part of not bringing the 80s back), the keytar build is simple, but pretty cool. [James] took an Arduino, a MIDI interface, and a stepper motor driver and integrated it into some of the scanner’s original features. The travel that used to run the optics back and forth now produce the sound; the case of the scanner provides the resonance. He uses a sensor to detect when he’s at the end of the scanner’s travel and it instantly reverses to avoid collision.

A off-the-shelf MIDI keyboard acts as the input for the instrument. As you can hear in the video after the break; it’s not the worst sounding instrument in this age of digital music. As a bonus, he has an additional tutorial on making any stepper motor a MIDI device at the end of the video.

If you don’t have an HP ScanJet lying around, but you are up to your ears in surplus Commodore 64s, we’ve got another build you should check out.


Filed under: Arduino Hacks, digital audio hacks, musical hacks

Build an Arduino-controlled Larson Scanner

Introduction

For fun and a little bit of learning, let’s make a Larson Scanner. This isn’t a new project, for example we reviewed a kit in the past – however after finding some large LEDs we decided to make our own version. We’ll use an Arduino-compatible circuit to control the LEDs, and explain both the hardware and required Arduino sketch – then build a temporary small and a more permanent large version (and a bonus project).

So what is a Larson Scanner anyway? Named in honour of Glen A. Larson the creator of television shows such as Battlestar Galactica and Knight Rider – as this kit recreates the left and right blinking motion used in props from those television shows. For example:

Making your own is quite simple, it’s just eight LEDs or lamps blinking in a certain order. If you’re not familiar with the Arduino hardware, please have a quick review of this tutorial before continuing.

Small version

If you’re just interested in whipping up a solderless breadboard or small version, it will take less than fifteen minutes. Just get an Arduino Uno or compatible board and construct the following circuit (the resistors are 560Ω):

The sketch is also very simple. There are two ways to address those digital output pins, and to save sanity and clock cycles we’re going to use port manipulation instead of many digitalWrite() functions. So for our circuit above, enter and upload the following sketch:

// Simple Arduno LED back-and-forth effects, similar to "KITT" from "Knight Rider"
// Original idea by Glen A. Larson 
// Arduino sketch - John Boxall 2013

int del=75; // delay between LED movements

void setup()
{
  DDRD = B11111111; // D0~D7 outputs
}

void loop()
{
  PORTD = B00000001; 
  delay(del);
  PORTD = B00000011; 
  delay(del);
  PORTD = B00000111;   
  delay(del);
  PORTD = B00001110; 
  delay(del);  
  PORTD = B00011100; 
  delay(del);  
  PORTD = B00111000; 
  delay(del);  
  PORTD = B01110000; 
  delay(del);  
  PORTD = B11100000; 
  delay(del);  
  PORTD = B11000000; 
  delay(del);  
  PORTD = B10000000; 
  delay(del);  
  PORTD = B11000000; 
  delay(del);  
  PORTD = B11100000; 
  delay(del);  
  PORTD = B01110000;   
  delay(del);  
  PORTD = B00111000;   
  delay(del);  
  PORTD = B00011100;   
  delay(del);  
  PORTD = B00001110;   
  delay(del);  
  PORTD = B00000111;   
  delay(del);  
  PORTD = B00000011;   
  delay(del);  
}

Notice how the ones and zeros in the byte send to PORTD (digital pins 7~0) represent the “movement” of the scanner? You’d have to agree this is a better method of addressing the LEDs. Have some fun and experiment with the patterns you can generate and also the delay. In the following video we’ve quickly demonstrated the circuit on a solderless breadboard using different delay periods:

Large Version

Now to make something more permanent, and much larger. There are many ways of completing this project, so the following version will be a design narrative that you can follow to help with planning your own. The first consideration will be the LEDs you want to use. For our example we used some Kingbright DLC2-6SRD 20mm bright red versions we had in stock:

However you can use what you have available. The key to success will be driving the LEDs at their maximum brightness without damage. So you need to find out the best forward voltage and current for the LEDs, then do some basic mathematics. From our example LEDs’ data sheet, the maximum brightness is from 60 mA of current, at just under 6 V. A quick connection to a variable power supply shows the LEDs at this setting:

We can’t get this kind of brightness from our Arduino 5V circuit, so instead we’ll increase the circuit supply voltage to 9V and use resistors to reduce the current for the LEDs. To find the resistor value, use the following:

… where Vs is the supply voltage (9), VLED is the forward voltage for the LED (5.6), and ILED is the forward current (60 mA). The value for R is 56.66 Ω – however you can’t get that value, so 68 Ω will be the closest value from the supplier. Finally, the power of the resistor required (in watts) is calculated by W = VA. So W = 3.4 (voltage drop over resistor) * 0.06 = 0.204 W. So we’ll need 68 Ω 0.25 W resistors for our LEDs. Thus instead of running the LED straight off a digital output, it will be switched on and off via a simple BC548 transistor – shown in the following schematic example:

The digital output for each LED is connected to the 1k Ω resistor and thus switches the transistor on to allow the current to flow through the LED when required. This is repeated for each LED we intend to use – which for the case of our large scanner project is six. (Why six? Someone bought a board which was too narrow for eight…) Next is the Arduino-compatible circuit. Timing isn’t critical so we’ll save components by using a ceramic resonator instead of a crystal and two capacitors. And as shown below (note that although the image on the microcontroller says ATmega168, we’ll use an ATmega328P):

(If you’re not up for making your own Arduino-compatible circuit, there’s plenty of alternative small boards you can use such as the Nano or LeoStick). Although the symbol for Y1 (the resonator) looks complex, it’s just a resonator – for example:

the centre pin goes to GND and the outside pins go to XTAL1 and XTAL2 on the microcontroller. It isn’t polarised so either direction is fine.

At this point you may also want to consider how you’ll upload and update sketches on the project. One method is to mount the microcontroller in a socket, and just yank it between an Arduino board to upload the sketch, and then put it back in the project board. If you use this method then you’ll need a microcontroller with the Arduino bootloader.  However a more civilised method is to add ICSP header pins – they’re the 2 x 3 pins you see on most boards, for example:

With which you can use a USBASP programmer to connect your board directly to a computer just like a normal Arduino. Just use Ctrl-Shift-U to upload your sketch via the programmer. Furthermore you can use bare microcontrollers without the bootloader, as all the necessary code is included with the direct upload. So if this method interests you, add the following to your circuit:

The RESET pin is connected to pin 1 of the microcontroller. Speaking of which, if you’re unsure about which pins on the ATmega328P are which, a variety of suppliers have handy labels you can stick on top, for example:

At this point it’s time to put it all together. We’re using a random piece of prototyping PCB, and your final plan will depend on your board. As an aside, check out the Lochmaster stripboard planning software if you use stripboard a lot. As mentioned earlier your final schematic will vary depending on the number of LEDs, their requirements with respect to current and your choice of Arduino platform. By now you have the knowledge to plan the circuit yourself. After some work here’s our final board:

… and the scanner in action. We used the same sketch as for the temporary version – however reduce it to six outputs (D0~5) to match the LEDs.

 Bonus project – Electronic Die

What else can you do with six LEDs? Make an electronic die! Here’s a simple sketch that simply picks a random number every five seconds. The random number generator is seeded from unused an analogue input pin.

// Simple Arduno LED die using Larson Scanner hardware described in http://wp.me/p3LK05-36m 
// John Boxall 2013

int del=5000; // delay between new rolls
int num;

byte  digits[] = { B00000001, 
                   B00000010, 
                   B00000100, 
                   B00001000,
                   B00010000,
                   B00100000 };

void setup()
{
  randomSeed(analogRead(0)); // reseed the random number generator with some noise
  DDRD = B11111111; // D0~D7 outputs
}

void rollDie()
{
  for (int i = 0; i< 20; i++)
  {
    num = random(0,6);
    PORTD = digits[num];
    delay(50);
  }
}

void pickNumber()
{
  num = random(0,5);
  PORTD = digits[num];
  delay(1000);
}

void loop()
{
  rollDie();
  pickNumber();
}

And a quick video of our die in action:

Conclusion

We hope you found this interesting and at least made a temporary scanner on a breadboard – or at least learned something. Kudos if you went ahead and made a larger one. If you made a video, share it with us in the comments. And if you made it this far – check out my new book “Arduino Workshop” from No Starch Press.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

The post Build an Arduino-controlled Larson Scanner appeared first on tronixstuff.

Tronixstuff 22 Aug 01:13