Spidey Sense! A Practical Implementation

For R&D discussions that don't fit elsewhere.
LesHall
Posts: 36
Joined: Tue Feb 17, 2015 2:45 am

Spidey Sense! A Practical Implementation

Postby LesHall » Tue Feb 17, 2015 6:20 am

So you want a Superhero hand, be ye fingered or fingerless, palmed or half-palmed, "normal" (whatever THAT is) or uniquely gifted, you want Spidey Senses! Surely most of us know that The Amazing Spider Man, as part of his Spider-like transformation, was gifted with a mysterious sixth "sense" which warned him of trouble and helped him be such an outstanding hero. Well we cannot yet offer this exact ability, however what we can do for our recipients and ourselves is make a little electronic circuit that provides additional "superhuman" senses to the wearer. In this thread I'll outline my plans for just how to do exactly that.

Now, since I am living in a nursing home until September 2015 or thereabouts (It's February 2015 as I write this), I cannot solder and have space or other limitations that may prevent me from fully pursuing this endeavor so I'm hoping some students, hobbyists, and / or researchers will carry the torch and actually build some of this stuff. My architecture is very simple. It's based on a humble little Arduino micro controller called the ATtiny and a handful of sensors and actuators. Let's look at a very simple example: distant thermal and optical measurement.

The electronic architecture of our thermal sensor is very simple: We have one or more sensors, an ATtiny processor, and one or more actuators. There may also be a need for buffer circuits on the sensors and / or driver circuits on the actuators, but we will attempt to avoid such complexities. For simplicity's sake we will work with visible light first and then add infrared imaging after that. Details to follow in the next post.

Les

LesHall
Posts: 36
Joined: Tue Feb 17, 2015 2:45 am

Re: Spidey Sense! A Practical Implementation

Postby LesHall » Tue Feb 17, 2015 6:53 am

Image

Above we see the core of our sensor system, the ATtiny85 processor. It's an 8-pin DIP (Dual In-line Package) chip so it's about as small as it can get and still be breadboard friendly. Regarding the pins, we have the required Power (VCC) and Ground (GND) pins for providing power supply voltage and current to the chip, a Reset line which we will simply tie to the inactive state with an external resistor, and five I/O pins. These five I/O pins have various purposes as outlined below.

All five of the conventionally available I/O pins (2, 3, 5, 6, 7) may be used as digital I/O. These pins can sense levels of zero or one and drive levels of zero or one, hence digital I/O. Two of these pins (5, 6) may also be driven as PWM (Pulse Width Modulated) outputs for driving servos or other DC motor types, or for adjusting the intensity of LEDs or in our case thermal output devices (resistors). Three of the pins may alternatively be used as Analog Inputs (2, 3, 7) for sensing analog inputs such as our optical sensors.

Another thing to know about the ATtiny85 is that it is very low in cost. If you pay $4 USD for one, you paid too much, and in small quantities like ten units you can get prices below $2 USD. The least expensive place i know to buy them is at http://www.jameco.com, where we can get all our other parts, so one stop shopping is a winner here. Other sources include http://www.sparkfun.com, http://www.adafruet.com, http://www.digikey.com, or really almost any other electronics supplier.

As to programming the ATtiny85, you have some choices. You can program in Arduino and use an Arduino UNO R3 board as the programmer or you can get a development kit from Atmel and program in C and / or assembler. If you have a need for speed (and temporal precision), you're better off going with the Atmel dev kit, however most of us including myself will opt for the Arduino approach which is a bit more maker-firendly due to the Arduino tradition in the maker community.

Another thing to know is that if we ever find that we need more I/O pins, the ATtiny84 part is available. It is in a 14 pin DIP package and is identical to the ATtiny85 except it has more I/O, costs more (but still just a few dollars USD), and is available from fewer suppliers (try Digikey).

More to follow...

Les

LesHall
Posts: 36
Joined: Tue Feb 17, 2015 2:45 am

Re: Spidey Sense! A Practical Implementation

Postby LesHall » Tue Feb 17, 2015 7:21 am

Image

Above we see our starter system which will e-NABLE us to get things up and running with the circuitry, the power, the programmer, the wires and bits and pieces and whatnot, etc. Other more interesting sensors and actuators will follow, however for now we will simply use a CdS (Cadmium Sulfide) cell to sense light and an LED to indicate light. I got the illustration above from Google images, so the arduino pins and markings will be different for our purposes, however everything else is the same.

Now, a quick tutorial on CdS cells. They are light sensors in that they vary their resistance depending on the amount of light that is incident on them. Actually the resistance goes down with more light and is around 10k Ohms for most hobbyist-available CdS cells in room lighting. You can get 100k or 1k or really any-k CdS cells, but the most convenient and most readily available is our friendly 10k CdS cell.

To sense this resistance we put the CdS cell into a voltage divider as shown on the left half of the above schematic image. When light strikes the sensor, it's resistance decreases which "pulls up" the divider's output voltage, and in darker conditions the CdS cell's resistance increases which allows the fixed 10k Ohm resistor to "pull down" the output voltage. Due to the large resistance swing of the CdS cell we get a large voltage swing on the divider's output. Big signals are good because they are easy to detect.

Our actuator is the simple industry workhorse, the humble yet amazing LED (Light Emitting Diode). Now, the most important thing to know about an LED is that it emits light and the second most important thing to know is that if you don't put a resistor in series with it, applying a voltage to it will zap the LED into oblivion! That's because the LED has an exponential Current-to-Voltage curve with a "knee" in the curve at about the LED's voltage of around 3V or so (varies by color). If you apply voltage greater than the knee from a source with enough current capability to destroy the LED, guess what will happen? you get a bright flash of light for a very short time and never again any light so you learned your lesson didn't you? Oh, you blew up an LED on purpose just for the sheer destructive pleasure of it and to see that bright flash eh? Just for that I'm skipping to the next paragraph!

Which is our microprocessor! Yay! OK, we won't use A0 on the ATtiny85 since A0 is actually on the Reset pin of all the crazy things, and is unavailable to us under most programming circumstances (you can get it to work but it's a one-time thing and we want to be able to reprogram our processor so we give up the pin to the mundane Reset functionality). Instead, let's hook it up to pin 2, which is ADC3. Similarly our LED is not on D13 because we don't even have a D13 on this here particular variety of Arduino microprocessor, so let's just hook it up to a digital output with PWM capability so we can vary the intensity of the LED, pin 6 (PB1) will do nicely. Hook up power and ground, use a 10k resistor to pull down the Reset pin to GND (ground), and the circuit is complete.

For the program, I don't have a test setup (at the moment) to debug our program, so i will discuss it in a future post and leave the actual programming up to you. After I get a few parts in, install some software, and set this up on my desk, I'll fill you in on the details and share the code. Yes, yes, in the task of writing this info up here I have decided to actually build a Spidey Sense system for my very own selfie! So be patient, it will take up to a week to get all that together and then I'll share every subtle detail with you.

More to follow.

Les

LesHall
Posts: 36
Joined: Tue Feb 17, 2015 2:45 am

Re: Spidey Sense! A Practical Implementation

Postby LesHall » Tue Feb 17, 2015 7:42 am

I just want to finish tonight's set of posts on this topic with a bit of a discussion about where we are going with all this. For starters we have the test circuit of the previous post which does the not-so-amazing task of sensing light intensity and displaying it as (guess what?) light intensity! Hahahaha, seems useless but actually it will help us to do some debugging and some playing around even. By using a simple optical light sensor we can tell with our eyes (those us with sight as not all of us may have sight) about how bright the light incident on the CdS cell is, and again with our eyes we can see the LED output. This means that We won't require any test equipment to debug the whole thing and it allows us to easily understand what is happening. We can also modulate the incident light by covering the sensor up with our hands or shining a light onto the sensor, again with easily observable result.

Then for our first neato thingie we can darken the room and position the CdS cell at the LED light output, creating a feedback loop. If we modify our software so that the signal is inverted rather than non-inverted, then we create an oscillator and we can see how responsive our system is by how fast it oscillates. Will it vary as a sine wave, a square wave, a triangle wave, an exponential, or something really weird? Build yours to find out!

The second cool thing we can do is put a lens on the CdS cell by 3D printing or otherwise finagling a lens holder and CdS cell holder thingie. If we position a reasonably shaped lens (most typical convex lenses will do) at just the right distance, our sensor will receive light only in a narrow cone from a distance. This means we can point the sensor into the next room or down the street or into a beehive or whatever and sense the light at that location! Way cool, yes, and even more cool will be when we add an infrared photodetector with a lens, because we can then measure temperature at a distance. Spidey Senses are beginning to form!

Next up we can experiment with different actuators, such as using a simple resistor as a thermal output device. When the sensor detects something cool the resistor stays cool and when it detects heat the resistor heats up. Note that care must be taken to prevent overheating and burning the skin. About 100mW or so is a maximum output power and probably 50mW will suffice. 250mW is very hot to the touch on a 1/4 watt resistor.

Also we can do some software tricks, like amplify the AC component of the infrared signal and sending it out to an audio actuator that pulses into our skin or ears. By doing that, and using plenty of amplification on the AC component of the infrared, we may even be able to detect heartbeats. Lie detector anyone? Emotional response indicator? Maybe....

So there is a lot to do just with this simple system. Note also that we have no buttons to push, no digital readouts, no operating system or icons or anything computery to deal with. This is one form of an "embedded system" which means that there is an underlying thingamajig inside of the thing that we are as humans interacting with that runs the show. Or something like that. Anyway, it's an embedded system.

Aight, ready for some fun? Good! Now go get your breadboards, see whatcha got already in stock if anything, and take a look at http://www.jameco.com or some of the suppliers mentioned earlier to stock up on parts for this fun fun adventure in Spidey Sensing!

More to follow, comments and suggestions welcome!

Les

User avatar
laird
Posts: 53
Joined: Thu Feb 12, 2015 4:27 pm
Location: Fort Lauderdale
Contact:

Re: Spidey Sense! A Practical Implementation

Postby laird » Tue Feb 17, 2015 2:18 pm

There's a variation on this that might be useful - as a visual indicator of touch. Imagine having five LEDs on the back of the palm that light when the fingertips touch something. I think that'd be pretty useful. Not too sure how low power these things are, and thus how long a battery would last, though. Perhaps it could be solar powered, so it'd stay charged? That's be pretty nifty...
- Laird Popkin

LesHall
Posts: 36
Joined: Tue Feb 17, 2015 2:45 am

Re: Spidey Sense! A Practical Implementation

Postby LesHall » Tue Feb 17, 2015 3:04 pm

Laird, we're in luck! Today's ultra bright LEDs use very low power to produce lower light levels. A solar cell charging a super capacitor would do the job if it could be charged for a few hours each day, i.e. normal use should keep the thing charged indefinitely. Not sure what type of touch sensor would work but there are a few choices available. For this project I would use an ATtiny84 processor to get the additional I/O.

Les

User avatar
laird
Posts: 53
Joined: Thu Feb 12, 2015 4:27 pm
Location: Fort Lauderdale
Contact:

Re: Spidey Sense! A Practical Implementation

Postby laird » Tue Feb 17, 2015 4:27 pm

Nice. So what can we use as the fingertip switches?
- Laird Popkin

droomurray
Posts: 69
Joined: Mon Feb 16, 2015 4:04 pm

Re: Spidey Sense! A Practical Implementation

Postby droomurray » Tue Feb 17, 2015 8:05 pm

Maybe look at Piezo Sensor's, they are cheap ?
Might be able to calibrate them to provide a range of pressure to get better feedback ?

Drew.

LesHall
Posts: 36
Joined: Tue Feb 17, 2015 2:45 am

Re: Spidey Sense! A Practical Implementation

Postby LesHall » Wed Feb 18, 2015 5:30 am

I'd say FSR's (Force Sensitive Resistors), as they come in little button-sizes and offer proportional indication, just put them in voltage dividers and hook them up to analog inputs. Probably need to mount them underneath rubber tips and need a way to guide the wires.

Les

droomurray
Posts: 69
Joined: Mon Feb 16, 2015 4:04 pm

Re: Spidey Sense! A Practical Implementation

Postby droomurray » Wed Feb 18, 2015 11:40 pm

Good find Les, I had never heard of them !

Drew.

LesHall
Posts: 36
Joined: Tue Feb 17, 2015 2:45 am

Re: Spidey Sense! A Practical Implementation

Postby LesHall » Sun Feb 22, 2015 1:45 am

Drew,

TY, I occasionally peruse the catalogs of cool suppliers to be aware of stuff like that!

Les

LesHall
Posts: 36
Joined: Tue Feb 17, 2015 2:45 am

Re: Spidey Sense! A Practical Implementation

Postby LesHall » Thu Mar 19, 2015 5:10 am

OK tonight I am bored and wanting to do something for e-NABLE. I can always work on the HandOMatic refactoring but I just can't bring myself to do it right now. I have told e-NABLE Matcher that I want to make a hand in green and I'd like to put something creative on it. How about a Spidey Sensor?

Sure, that's just the ticket! I'll make a super ear sensor! I'll 3D print a small parabolic dish, a circuit on a small 1/4 breadboard, a microphone with amplifier and a processor chip. I will 3D print a two AAA cell battery holder for power and make a switch that turns the thing on to conserve power. An LED indicating power will help as will signal strength LEDs driven by the processor. Also the processor can feedback AGC to dynamically adjust the signal level.

Let's take a look at the parts in the next post.

Les

LesHall
Posts: 36
Joined: Tue Feb 17, 2015 2:45 am

Re: Spidey Sense! A Practical Implementation

Postby LesHall » Thu Mar 19, 2015 5:20 am

LM7332-pinout.jpg
OPAMP Pinout
LM7332-pinout.jpg (12.8 KiB) Viewed 5594 times


That's our opamp. ground goes on pin 4 in the lower left and power to pin 8 in the upper right. We put the mic in a voltage divider from power to ground and AC couple it into the first opamp stage with a gain of say 20, then the second stage has a gain of 20 also, with AC coupled input and output that goes to the audio jack which has terminal impedance of an electrolytic cap, say 100uF and a 220 Ohm resistor. the negative side of the cap goes to the output and the RC is in series.

I'm going to wire it up now and I'll report back when I'm done.

Les

LesHall
Posts: 36
Joined: Tue Feb 17, 2015 2:45 am

Re: Spidey Sense! A Practical Implementation

Postby LesHall » Thu Mar 19, 2015 8:37 am

Spidey Sense Super Hearing.JPG
Spidey Sense Super Hearing
Spidey Sense Super Hearing.JPG (1.25 MiB) Viewed 5591 times

As I sit here listening via the circuit shown above that I have just constructed since the last post, I am amazed at how loud my keyboard's keyclicks are, haha! I can hear the distant conversations from around the nurse's station way down the hall and all the muffled televisions, some kind of chopping noise now and the boredom sighs of my indigent roommate (though severely disabled, he is very emotionally expressive and that has made him very popular in the facility, heh).

The circuit is USB or battery powered and the power is diode ORed for safety. A 100 Ohm resistor helps reduce a LOT of noise and also safeguards against shorts causing power supply overheating (too much current and the resistor will fail open). The supply caps and virtual ground caps keep things as quiet as possible and the opamp though not a low noise opamp, is capable of directly driving speakers and even low impedance headphones (!). Nice opamp eh?

The circuit is a bit noisy by it's nature being a breadboard circuit, which will improve tomorrow when I move it over to a PermaProtoBoard from Adafruit. I did impedance matching at the microphone and increased the gain as much as possible to 100 V/V at each opamp in the dual package for an overall gain of 10,000 V/V. That's quite a lot of gain so it's very sensitive. When I 3D print a parabolic reflector and put the microphone at the focal point of the dish, there will be even more audio gain.

Now that's some Spidey Sense! Super Hearing for a super kid!

Les

Vince-Heidelberg
Posts: 4
Joined: Sun Mar 22, 2015 3:16 am

Re: Spidey Sense! A Practical Implementation

Postby Vince-Heidelberg » Mon Mar 23, 2015 12:35 am

Hallo

I like the idea of getting the patient a feedback ...
I think when a patient works with an system for a long time he will be able to get a feeling for what the sensor are reading.
In other Words he can feel how much pressure he pulls on objects.
I would not use visual feedbacks like LEDs and stuff like that just because its not a natural way to learn.
Normaly if you grap somthing you can feel how much pressure you put on opjects , so why not moving the point of the feeling away from the hand that not exist. For example put a rubberband on the bizeps that gets tighter depending on the pressure the sensors on the finger tip reads.
That would be a much more natrual way for feedback and maybe by long therm use the patient will be able to actualy feel the pressure without thinking about. It all depends on the System that translate the reading to an feeling on the skin.

I did a quick picture that shows what i mean ....
Image

Its just a basic idea ...
Maybe it will work better if we focus the pressure on a smaler area then the whole bizeps.
We could add something like this one under the rubberband , and again just a quick sketch.
Image

I have some more ideas about it , let me know what you think

LesHall
Posts: 36
Joined: Tue Feb 17, 2015 2:45 am

Re: Spidey Sense! A Practical Implementation

Postby LesHall » Wed Mar 25, 2015 5:14 am

123D Circuit.jpg
TnT circuit
123D Circuit.jpg (602.46 KiB) Viewed 5575 times


This circuit is a simplified diagram of the circuit to be used for the TnT (Touch and Temperature) Spidey Sensor feature of e-NABLE hands. I have written an initial processor code and I will be constructing the circuit tonight. More to follow...

Les

LesHall
Posts: 36
Joined: Tue Feb 17, 2015 2:45 am

Re: Spidey Sense! A Practical Implementation

Postby LesHall » Tue Apr 07, 2015 5:06 pm

SS TnT Schematic.png
TnT Circuit
SS TnT Schematic.png (126.52 KiB) Viewed 5553 times


Shown above is the schematic for the TnT feature of the Spidey Sense enhancements. To the left, not shown, are the sensors themselves. They are two-wire devices that act as resistors with the property that their resistance lowers with increase in the sensed parameter (negative coefficient). These are placed in parallel with each other and grounded on one side for reference, then put into a voltage divider on the board. This way, if any one of the sensors fires the whole assembly will fire. Also if more sensors fire or one fires strongly we get a strong dip in the measured voltage. So more gets you more effect, as desired. For this reason the paralleled configuration should be a valid simplification that greatly reduces processor I/O requirements.

The voltage dividers are sensed by analog to digital converter inputs on the ATtiny85 processor, selected for it's low pin count and therefore small size. The software in the processor then converts each of these two values to Pulse Width Modulated output signals that are applied to the motor drivers at the right. LEDs are PWMed into showing the signal value as an optical intensity, and the motors are driven in this way also though the transistors whose current is set by their base resistors (Iout=50*(Vcc-0.7)/Rin).

This simple circuit performs the desired functionality at low cost and in a small space. In fact, the batteries are the biggest part of the circuit.

Les

LesHall
Posts: 36
Joined: Tue Feb 17, 2015 2:45 am

Re: Spidey Sense! A Practical Implementation

Postby LesHall » Fri Apr 10, 2015 7:14 pm

It's time for an update since I have done some actual experimentation and have results to report.

Touch Sensor.JPG
Touch Sensor (too delicate)
Touch Sensor.JPG (880.64 KiB) Viewed 5549 times


As you can see the sensor is quite small to fit in the tip of a finger of a 100% sized hand. Even at 125% it would be quite small. Also the sensor is delicate because the leads exiting the sensor are metal foil and quite thin. This renders the sensor unusable in a child's environment (think dirt, rain, dropping, rough fun, etc.). So I am concluding that these sensors are too delicate for our purposes. I did measure a resistance of open down to 3Meg Ohms when I pressed on the sensor, indicating that even at that small size it would work electrically. Also it may be possible to "toughen up" the sensor by putting the wire leads inside of the ssensor during the assembly process, however even that measure will not make the sensor durable in a child's environment.

Also I found that putting a thermistor in the tip of the finger in combination with the touch sensor will not work due to the size of the epoxy coated thermistor. It is listed as being 3.5mm in diameter, however it would not fit in a 3.5mm hole and is more like 4.5mm in diameter.

So, what to do?

Well the thermistor need not be located in the fingertip, which will GREATLY simplify the whole finger, what with leads running back and all that. The sensor can, however, be located at the place where the fingers meet the palm, perhaps between the middle finger and the ring finger or perhaps between the index finger and the thumb. This lowers cost because only one sensor is required, not five and simplifies the circuit.

As for the touch sensor, I am thinking of using carbon fiber filament due to it's electrical conductivity feature.I happen to have purchased a full roll of this material for the purpose of experimenting with it's electrical properties The filament I am using for the hand is PLAdium by Taulman3D which is an electrical insulator. So if I make some kind of sliding potentiometer out of the fingertip using two carbon fiber parts attached to one PLAdium part, then we should have a potentiometer driven by force. This innovation could be cleaned by conventional means such as 409 and soapy water and the like, and rinsed clean then allowed to dry. Nothing we can buy except some of the grapheme filaments emerging is tougher than carbon fiber filament and PLAdium is tough also, so the hand will be kid-proof (we hope!).

I'll get to designing this now. Thanks for reading, and your comments are welcome as is your encouragement.

Les


Return to “General R&D”

Who is online

Users browsing this forum: No registered users and 1 guest