Sunday, December 23, 2012

Frankenstein's (robot) monster.

"IGOR! ze body is finished! We may now begin!"


Those black and white wheels are from a Desk Pets toy called a "TrekBot" I really like the hubless wheel drivetrain setup, and finally got around to making a little rover out of them. So here it is, 2 trekbot wheels [different colors 'cause the other white one broke :( ] hot glued with some hobby sticks to a Project enclosure, with a little caster ball holdung up the rear.. front.. not sure yet which end will be which.
"IGOR!! Bring me ze brains!!"
 
These are "the brains".. well, robot version of brains. After seeing how the remote control of the cheap little toy car I tore apart was, I decided to keep them for other uses.. since the 2 channels transmitted were not in fact some complex variable proportional shenanigans.. but rather a "digital" on/off, in both directions... times two! So the brains on the left is a transmitter with 4 pushbuttons, and the brasin on the right is a receiver with 2 H bridges swapping polarity of the two motor plugs upon command. Here we see them stripped of their battery pack prongs and motor connectors, and also the power switch (which was JUMBO) hardwired to always be on.
"NO! zees vire here, dat one goes Zere! How many times must I tell you; do NOT cross the zappy bits with the squishy bits?!"
 
hookin the power posts up to my power supply, I checked at the "VCC" test point (so nice to have it marked!) to see if the thing has power. "its aliiiive!". I was pretty sure it was fine after I removed it, but wanted to make sure. Also, I needed to power it up to see which plug pin was technically "foreward", with respect to the motor it was powering.

After wiring up the receiver brains to new power source, I had to do the same with the transmitter brains... had a AAA battery pack around, to keep this part mobile. Here, we see me testing the motor out points, and finding the + voltage point when I press FWD on the remote (its upside down). This did a couple of things: prove the receiver brains were still working fine, as well as prove the transmitter brains were as well.
"Ve haff control"   Using the spare black wheel left over, I tested the receiver brains to see if it was able to do a couple of things: A) drive these strange motors from another device with enough power, and B) see if the brains could themselves handle more power... like 9 volts. This was a gamble, but in the end I just told myself "so I will just be out $13.00 if it fries" and went for it. You can totally tell the difference twice the voltage makes... and hey! It wouldnt be a Frankensteins Monster if it didnt have Monster power, right?
And here will be the power for the little monster rover. A 9volt is really more compact than 3 AA that the toy originally required, and fits in the enclosure box nicely... I just wish the brains would as well... oh well. I quickly undid all teh testing jumper wires, and replaced them with the 9volt power supply, and soldered the wheel motors on with the correct polarity. As I couldnt wait... lets test it out!!
Like Frankenstein, its first steps were a little rough. It was confusing!  Now instead of one set up buttons controlling fwd/rev, and the other left/right, now the left/right was fwd/rev of the other wheel! yet the buttons were sideways, and it wasnt very intuitive which way on those sideways ones was foreward... even with some practice. Still, the little monster has some power, poppin wheelies and such. And it certainly turns on a dime (that means I got the wheels positioned just right)... but the controller needs some work... if only they made spring loaded rocker switches, that would go back to center/off when let go...
(... they totally do). Again, the makers of these parts were polite enough to provide test points all over all of them, all the better to help me figure out which parts did what when I pushed a given button. After a bit of experimenting, it was simple- each button had a test point associated with it, that I could solder tiny wires to, to go up to the rocker switches. It wasnt pretty, but should certainly work better.
So lets try a final demonstration. This is what Toy Hacking is all about- taking some little electronics gizmo, using its parts for something else, and hopefully making something a bit better than the originals out of it all!
 
 I plan on using this little guy as a test bed.. to try out new drive/steering/control schemes, from BEAM photovores to Arduino explorers, to whatever. Thus the box design. this remote control setup was just gravy, to let me put the chassis through its paces and see if it would even go in a straight line, or turn in place. It turned out just about perfect. and its certainly cooler than the original mustang toy that needed 5 feet to turn around.

How I got transistors WRONG

So I've built a few things using transistors so far, and I thought I understood them.

I thought NPN meant that its input was "N polarity, so you put "P"ositive voltage to its middle pin, to get power to leave through the other N. Because opposite charges attract::conduct, or something. And for these transisors it was pretty much true.

Similarly, I thought PNP were just the opposite: you put a ground to the middle prong to let its power go through... it worked in breadboard tests with LED lights and such.. but that basic "understanding" was fundamentally wrong! And it turns out I had a LOT of fried PNP transistors sitting around, because guess how my transistor tester "tested" them?

But thats a good thing! As frankly, I was stumped on how to work "connect 0v to base" into any circuit design, and PNP transistors sat in my parts bid collecting dust.

Then I did some book learning... turns out what I was doing by putting a ground to the base of a PNP was simply using that base as the circuit instead of the emitter... or some other esoteric electronics misuse of a transistor I cant claim to understand...

Then I followed a step by step walkthrough of transistors.. from NPN, PNP, and SCR styles, in step by step breadboard demonstrations I could assemble and do as I read it.

This is when I finally learned than a PNP transistor is like a Normally Closed switch.. the opposite of how an NPN is a Normally Open. Each is controlled by Voltage to the base, but the PNP kills the power, the NPN turns on the power, when the base is activated.

The reason I never figured it out on my own is because an NPN was simple; just leave the base empty, put a 1k resistor between power and its base, and "click!" it turned on. A PNP was not so simple. It just didnt work. It was supposed to already conduct with nothing on its base, but it was just dead. Putting power to its base didnt do anything if it didnt do anything to begin with! The secret, I learned, could have been summed up in 3 words... that had anyone mentioned them to me, would have made me instantly figure it all out:  "Pull Down Resistor"!!

I guess the base of a PNP with power sitting in it sort of hovers around its own shutoff levels if left to its own devices. Putting power to it then, only reinforces its OFF state. A pull down resistor- it doesnt matter if it was 10M ohm- would force that base to be ZERO, and the PNP would function as normal. Adding +V to the base now would shift that "floating but pulled toward zero" value to a real, +V power, and turn it off, or regulate it, or whatever. Now I get it.

And now that opens up a whole new world of solid state switching to me, as now I can puzzle out a solid state DPDT relay, or a self latching power-on hold circuit, or a Coil Gun trigger mechanism that will turn on/OFF at nearly the speed of light... stuff I was just scratching my head about last week!

TOY HACKING- making a robot chassis from a cheap toy.

In my robotics hobby, I need chassis..'ese. Not something I have to engineer and design, line up and balance myself... but something that already has had that whole "frame and wheels" thing setup for me. This is where "Toy Hacking" comes in. To get an idea what this means, lets go find a cheap toy that I can "hack" apart to suit other needs/uses.
Heres one. not too bad for $13.00. radio remote control, fwd/rev, steering, etc. I played with it the requisite amount before getting out my teardown tools... and honestly, its about a $13.00 toy. Not very fast, not very responsive turning, etc.

But the point was: a wheeled chassis with steering mechanism already built! That plus any electronics parts I can salvage/repurpose.. another aspect of "hacking".

So, I started with the remote... seeing those two control sticks, I figured at least I would get some potentiometers out of it....
... nope. wow! really? This is how simple the controls were, little micro switches- on/off control sent to the car. I was a little bummed. then I got to thinking: here was a radio remote, with 4 buttons, controlling 2 motors with simple fwd/reverse polarity...!!! This could do anything! keep the remote intact and powered, and the receiver hooked up to any motor, this little thing could do anything from turn the lights on, to opening the garage door. So I kept them all intact. This was actually much better than some RC servo control scheme.. this was simple "this way- that way" radio control... and that could be useful!
 
So, I carefully took the "brains" out of the car, and kept everything still intact. The two motors had convenient plugs to disconnect them, and left the car nice and "ready" for anything else I may plug into it.
 
So the motors are still there, with nice connector jacks for future use. Nice. lets have a closer look at the steering of this thing.
Yeah, this was simple. no servo here, just a motor with a "knocker" on its axle, that would spin this war or that.. until it hit the linkage arm post underneath, that would throw the wheels left or right, depending on the spin of the motor. The travel of the tires wasnt very high, and the linkages were sping loaded to return to center... but the important thing is that the front wheel axles and turn linkages are already built. Trust me, those mechanisms are rather difficult to build yourself from the ground up... and to be this small/lightweight. Plus, I could always just put a servo in place of the motor, its arm tied directly to the linkage, to get full and controlled turns, if need be.
 
Looking the frame of the car over, I noticed some tabs... like sping levered latches molded out of the frame itself.. so I carefully pried them open to see what they were for.
OMG! this thing was modular! The steering section, drive section, and battery box section were clip together subassemblies... THIS was a neat surprise. with this I could bolt the steering and drive to another frame, to other kitbashed toys.. even to each other directly (6 wheeled tank made of 3 of these? Seriously neat!.
But at this point I was noticing the frame/chassis of the car was a bit bulkier than it needed to be- either to look more like a mustang, or just to hold the top on. It was a lot of extra material, and I thought I could do without a lot of it-- mostly on the front section.
After some rather messy work with my dremel cutting tool, I got a lot of that junk off of the fram up front... yet still keeping the steering mechanism OK.
 

And here we have it; formerly cheap toy, now prebuilt robot rover chassis, with some decent rims and a nice mustang "stance". And that is the basic premise of Toy Hacking. I could put pretty much anything on it, from an Arduino to some BEAM style rover... I dont exaclty know what just yet... but its ready!
 
Oh, I only cut away parts on the front section of the frame, because I learned the hard way NOT to start cutting into gearbox cases.. especially if you are unsure just whats inside...
... or this might happen. :( This is TankBot. and his gears are all loose, because I didnt know that the gear axels were held in that way when I tried trimming him down to its bare essentials. But THIS is a seriously cool toy to hack! so teeny, so useful, two motor independant tread drive, *sniff*.. I had high hopes for this little guy.
 
 


Friday, December 14, 2012

A bit on IC chips, and a Dragon Headbot

At first in my self teaching of electronics.. I was completely unfamiliar of the IC chips available at Radio Shack, as well as Fry's Electronics, Willie's Electronics, and other stores in my home town. I knew the 555 timer ship was some sort of universally versatile little gizmo.. but had no idea how to wire it up. Similarly, when I read the package of "Octal inverter" I thought it was some sort of code generating chip for computers... something that used some sort of 8-bit (octo) ASCII code or something else completely over my head.

The Junkbots, Bugbots, Bots on wheels Book helped me out immensely! While I still at this time struggle to get a 555 timer to do what I want (I want it to do a short millisecond pulse of power each time I push a button.. but NOT stay on for the length of time it takes my slow Human speed finger to let go of it which is apparently hundreds of milliseconds even at my fastest), now I am an avid fan of the octal inverter. Lets talk about it a bit.
This is one of my favorite chips. Its SO useful! It can do so many things; from powering a motor that can reverse its power automatically, to switching things on and off, to other BEAM robotics related stuff like "Neural Nets" of a limited degree. Lets explain how.

Notice on the sketch there are up arrows and down arrows at the pin points. These are "data channels" symbols, which is a fancy way to say "either 1 or 0 goes in here or out here"; 1 being 5v, 0 being 0 volts. So yes, doing one to an input causes the connected output to do something as well, and they are in pairs 8 pairs, thus Octo.

Its called an Inverter because what it does is outputs the opposite of what was its input was! So you input in 5v, it puts out 0. You link one output to its neighboring input, and you can see more complicated things going on: 5V to channel 1= 0 volts at output, that 0 v gets sent to input of channel 2, it sends 5v at its output. Thus; a motor controller! Have one channel power 1 wire, another power the other wire, simply link them together, and one provides power, the other ground.. all from a single input of 5v (triggered by anything-- mechanical switch, etc)

Whats really neat is how it reverses... put 0 volts at the wire going to channel one, and now the wire that was power is ground, and the other channel is power!! and the motor is running the opposite direction.  Neat, huh? with just 1 wire and a jumper, you now have the equivalent of a DPDT relay wired to do the same thing... only there are 3 more pairs on the chip!

One thing to note though, is that the power output of these channels is not very high. Its more for data that driving motors, and this one in particuar is not a style designed for high milliamp loads (all that is locally available though). So, to make it a motor controller, you have to "gang up" multiple channels in parallel to have enough "push" to actually get it to go. To make the Headbot from the Junkbots book, it uses 3 pairs tied together to drive the motor, and the last pair as the "brains"

Remember how I said the more advanced robotics techniques can make these inverters "neurons"? This is how; take two linked together channels, and you have a loop of alternating on-off states. Wired directly, the voltage just zips back and forth too fast to mean anything... but add a resistor/capacitor to each side, and now there is a controlled delay (the time it takes the capacitor to fill up: stop hogging all the power, for the 5v to actually reach the input). Have each RC group of different values, and the two neurons can cycle like "bip-beeeep-bip-beeeep". How to make this into a 2 neuron  bug brain is rather ingenious: have the resistor of the RC groups be variable to external stimuli.. like a photo resistor that changes its resistance with light levels! NOW, if wired this way, the "beeep" will be "no light" cycle time, the "bip" will be "light hitting this one". Cross wire them so the left sensor makes the motor spin to the right, and what do you have?

A Headbot, that tracks LIGHT! it will scan left right left right, but time between the scan directions differing so that it drifts more and more towards a light. Then, when both sensors are full of light its just a rapid "bipbipbipbipbipbipbipbipbip" cycle, that keeps the eyes pointed at the light source. Move the light, and the head turns to track it. Wire the motor the other way, and now the headbot avoids light! Shift a light nearby it, it will flinch and look for the darkest spot (wear a black t-shirt, and it may be staring at you!). A brain. Of sorts.

Check out my Headbot, since we're talking about them:
This little critter is called, roughly "The blue Eyed Dragon. It uses a solarbotics geared motor, mounted in its wheel as a base, and all of the "brains" are literally in the head. It behaves with surprising amount of behavior for something so simple, as seen in a video below.

Here you can better see why its called Blue eyed, and a Dragon. heh. I was in kind of an odd mood late at night when I finished this, and I noticed the InstaMorph holding the underside of the chip all nice and stable (don't want those jumpers bending and touching each other), once trimmed, looked a bit like an alligator/dragon head. so I went with it when it came time to place all the parts.  ...My only regret is putting the power switch in such an awkward spot.
Anyways, video time. I uploaded this on Youtube as well, as I plan to add some notations as it is acting up a bit.
I like how he can spot lights from across the room (the dim light was my computer monitor), and gets a little squeal going on when really close to the light (The motor is still cycling left/right very rapidly when it looks like its staring.. and the squeal is the motor oscillating at audible frequencies)
 
So, back to IC chips. The Octal inverter is the one I tinker around with most, as the 555 timer, even after reading up on a bit, is still a bit beyond my current level of understanding- in order to get it to actually behave like a timer. Another chip I tried out was the Audio Amp- which can also power a motor, or even a pair of motors dynamically- alternating the amounts of power to each motor as it tries to "equalize" the signal as it varies with the photoelectronic eyes. This is how the "Herbie" bots chase a light around on Youtube. But I cant really claim to understand how the amp does this.. at this time.
 
One of the IC chips I want to get to mess around with is a Clock.. or Shift Register type of chip. These are like the inverter, but cascade down the list of channels whenever something happens. I'll admit I mostly want this chip just so I can make my own knight rider Kitt light bar... or a cylon scanner... no really- a scanner- an array or LED's light up cylon like, sweeping left and right, and another array of light sensors watch for reflections, to know when something is too close... either to avoid it, ram it, or reach out and shove it away... that kind of thing.
 
Well, I'm apparently off into daydream land now, so lets end this before I gt TOO loopy.

Sunday, December 9, 2012

Coil Gun test firing.

 

Maybe I didn't shoot very far, nor punch any holes in tin cans.. but still pretty good for first attempt I think!

Using the scavenged Back EMF really added some kick to the firing! It may be a strange use of a relay, but its a new trick in my toolbox. :) But first lets get some Hero shots of the coilgun in all its glory.
Still brings a smile to my face. I'm glad the failed symet spinner capacitors found a new home. The rings were kept from the old design, and added a nice "raygun" look to the little cannon. I suspended the coilgun in the middle on the rigid solid core wires, hoping for a recoil effect as it shoots (not enough power yet for that). The barrel is a brass tube, so it wont mess up with the magnetics of it all, and the outer ring is + and the inner ring - of the capacitor bank.






The Capacitors were angled forward a bit, and the rear ring was bent back some, to give it a bit more of a tripod look, as well as some more interesting angles to look at. And of course it HAD to appeal to my sense of aesthetics... like a Corvette, if the coilgun LOOKS like its shooting even when it isn't, well then it MUST be cool!
 
Here is the new fangled power booster, fresh from the Back EMF experiments. Reading back, you could see how it is truly a booster, in that I put 7v in, and the back EMF it generates trickle charges up the capacitor bank... to 23volts!  The white sleeved leads are the EMF, the unmarked are the power. The only real drawback is the whine the clacking contactors do on it as it cycles.. at about a 400 hz whine. (one I recognize from my Air Force days)
After trying to get a 555 timer to monopulse to make a quick fire of the capacitors through the coil, to looking into using a camera flash trigger to do the job, I instead went old school: relay logic (!!), as something I could wrap my head around, and had past experience with, as well as something I could build right then with parts at hand.
So here it is. 2 double contactor relays, and 2 pushbuttons. The function is straightforward, if a little interconnected: the left relay is the arming relay, the right one is the fire/disarm relay. The top left contacts act as a holding circuit, that keep that relay on once I press the button. The bottom left contact is the Enable, sending power to be available at relay #2. Relay2 wont energize until I complete the ground with the other pushbutton, the fire button. When the relay energizes, two things happen: the bottom right contact switches the contacts, moving the connection of the capacitors from the power source to the coil for as long as the relay is on. That wont be very long, however, as the top right contact breaks the ground to Relay #1... which you may remember, was supplying power to relay2 so long as IT was on. So, what happens is the firing relay turns on-OFF really fast, but long enough for the bullet to be fired.
 
Here's the wiring schematic, for anyone whose interested. This is a simple way to have a pulse of capacitor dump that is only a fraction of a fraction of a second. Maybe 100ms or so. A quick on-OFF is important to shoot something with a coil, as if the power stays flowing too long, the coil will just be a magnet, sucking the bullet to the center of the coil, and keeping it there. The Capacitor bank I had held enough power that the discharge time would have been too long for them to just dump their charge, so I had to engineer a rapid switching pulse... thingy.
I could adjust the "on time" by simply adding a capacitor across relay2's coil taps.. when relay1 kills its power, the capacitor will leave it on a little bit longer... but just like this seemed to work the best. 
 
 
 

Saturday, December 8, 2012

Back EMF demonstration (and a peek at a coilgun)

Picture is worth 1000 words, as they say:
So, going counter clockwise from the blue lit power supply: it is producing 7 volts, shown on the gauge at top. the relay at left takes that 7V- the minimum to energize it, and mechanically oscillates on and off very rapidly due to how it is wired. The schottky diodes, wired reverse to the input polarity, deliver the Back EMF spike power to the bottom power rail of the breadboard, where it charges a 630v capacitor. A meter on that capacitor, shows its level of charge.

48 volts! So 7v in, 48 out.
Here's the wiring 'under the hood' of the car relay. The white marked wires are the Back EMF, the unmarked are the power and grnd leads. Notice that the power in doesnt go right to the coil, but to the Common contactor tap. The + side of the coil is jumpered to the NC contact.. meaning that the relay is energized as long as its OFF... see the trick? on then off then on then off then on then off... as fast as this little relay contactor can physically switch.. whicih turns out to be pretty darn fast. The Schottky diodes are wired in reverse, because the back EMF pulse is reversed polarity as well.. we dont want the power supply to add its power to the meter at the end! The giant diodes were 100v schottky ones.. because I didnt know how high voltage the EMF was going to be, and schottky diodes drop less voltage across them than normal diodes do. (.2 instead of .7 V drop)
 

This just amazes me. Why don't we use this power?! 7 piddly volts- less than a full amp of supply out of that little hobby power supply chip, and 50 volts pouring into the capacitor!! Sure its pulses, but even the way I've set it up in the video is so rapidly pulsing it might as well be steady.

This gets me thinking! See, I was building a mini coilgun that would shoot paperclip clippings, and it shoots pretty well with a 9volt powering it. but after some failed experiments to build a 555 chip voltage double to try to boost the power, THIS idea came along!

In fact, while this video is uploading, I'm going to go kitbash it right now!

Hmm didn't work for some reason. Maybe he 650v capacitor didn't have enough power capacity to fully energize the gun barrel coil I set up. Or something. bummer. Good news though: it DOES make an effective voltage tripler!! Those giant 10v 4700 Caps I tried to make my first symet out of were the original battery bank for the coilgun, Arranged in a neat circular frame that the coilgun could be suspended in the middle of in a sort of "raygun" configuration that I liked.
See? Isn't that awesome looking?! I don't bother making something unless it makes the inner child in me giggle with joy a bit.

 Together their capacity was 14100uf.. which.. I don't know, may equal 1.41 Full Farad. But in my initial build, all I could pump into those Capacitors was the maximum voltage my little hobby power supply could provide: 10V. this was the upper limit of the pulse I could send through the coilgun... meaning the 1.4" clip of paperclip only shot about 3 feet straight up.. pretty good for no moving parts and all, but not really a GUN. My goal for this coilgun is to have it punch a hole in a piece of paper in front of it... here's hoping!

Oh (lost track) so anyway, this Back EMF rig I have didn't work as a power bank, so, I tried it on my coilgun power bank seen here, to see if the EMF pulses could pump higher voltages into them. It DID. Sure the buildup was slow, so I guess the EMF spikes were infinitesimal (high voltage)spikes, but nevertheless, the volt gauge I had clipped onto them showed the charge rising, and rising, and rising, the meter slowing down its charge around 23V (remember the starting voltage was 7). I didn't have the patience to let it climb up to 50, to see if it could actually reach that charge, and anyway, the caps were only 10v, so if I pushed them too far, they go POOF- so I've heard.
 
So, if I can start with 7v and end up with 25v+ in a capacitor bank, then the back EMF rig is something I have a real use for; a way to double, triple, even septuple voltage, without any complicated electronics nor timing circuits.. nor reall any other parts at all! And thats cool enough to keep.

Finished the Leave Me ALONE! box, p2

Where was I? oh yeah, the wiring it all up:

And there it is.. all done! Little bit of hotglue to secure the freeform "brains" in place for all the shaking in its future, and using the red wired purposely soldered in a "too high" arch (so that the wires would pin the brains in place when the baseplate was screwed down.. sneaky, huh?!)
 
All that was left to do for now was to put a fresh battery in, bolt it all up tight, and add a little red ink to the silver paint I put in the writing on top.. and it was finished!
 
 
I'm taking a break on the LeaveMeALONE! box for a while, let it sit in glory for a while on my "neat stuff" shelf. But there ARE plans for further additions! After the relay mod, the DPDT switch is really not being fully used anymore.. and I have ideas for what to do with the "off" position set of posts. Things it can do when its technically "off"... like punish people who peek. But you know the saying: a pic is worth 1000 words, so lets save some space:

From Top to Bottom: micro piezo buzzer, mercury tilt switch, submicro pager vibrator motor. Oh.. that thing on the right? Just a little something I yanked out of an old CD-Rom player.... thats mah LAYZOR diode!!
Basically; if its "off" but the tilt switch on underside of door gets closed, all hell breaks loose on the cover itself- the buzzer is piercing at 9v, the pager motor is insane buzzing (feels like getting shocked, actually) at 9v.. and the laser.. well.. I'm not an EVIL guy, who wants to blind anyone or anything, so I was thinking more for internal effects.. a laser "tripwire" spotted when you open the lid for a peek... or a servo mounted cylon scan sweep inside.. something. I dunno. but nothing EVIL ( maybe I'll save it for mounting on frickin' sharks heads!!)

Finished the Leave Me ALONE! box

For those who may not know yet, the "Leave Me ALONE!" box is like a "most useless machine" found everywhere... only angrier. It builds up a bit of rage, then turns itself off.This started as an electronics self test to see if I could make an electronics circuit from scratch that could do what I wanted it to do: slowly build up the speed and power of a vibrating pager motor in a building ramp up of "rage", and then activate the arm to cycle the whole machine back off, and put the arm away.

It took a lot of on the breadboard experimenting to get it to work just right. Turns out it takes 3 transistors and a voltage trigger to allow all of the different things to happen. Here is the final schematic:


So you see, now the switch does not directly power the arm motor (far right).To the left is the vibrating motor controls, to the right is the relay arm control, and in the center is the heart of it all: a Big 'ol resistor capacitor RC "thing", that does all of the slowly building up voltages that the rest of the circuits works off of.

 
 
I learned a lot about RC style systems, mostly from a ration of failures in trying to get this to work. See; the resistor slows the charge up of the capacitor (to about 3-5 seconds), meaning that that 4 way intersection in the center will go from 0 to 9 volts in a slow climb. At first, I just tried to have the vibrating motor powered directly at that intersection- it didn't work; the motor was a "path of least resistance" for the power to escape through after passing the resistor. similarly, the intersection would not turn on the relay at around 5v as I planned, because its coil acted the same way as the coil in the motor... so a RC wont ramp up a charge with a 'load' present, and in the end, Neither will do anything. Check! If I had gone to some electronics class or something, I might have been told that at some point... and not known what it meant, exactly. BUT with this practical experience, now I get it!
 
So both the vibrator motor and the relay needed a "buffer" in between. Like a transistor base. The rising voltage will turn on a transistor more and more as it climbs, meaning the thing the transistor is powering (from another route of power)- so, in dumbdum terms: the RC intersection cannot power a thing directly, but can power a knob to adjust the power.
 
The vibrator motor worked with the intersection powering the base of a single NPN.. but the motor peter'ed out (poor Peter.. what did he ever do to get that term named after him?!) at around 4v.. oscillating the circuit.. like the transistor was "floored" already, and couldn't push any more power. So I doubled it up- a "darlington transistor pair" apparently- two NPN's stacked up. At first I thought they would both just drive the motor "in parallel", but apparently this "in series" arrangement works better- not sure why if the first NPN was floored in the first place...? But anyway, 2 NPNs and the motor will power itself right up to 9v and self destruction... if need be.
 
That's where the relay comes in. I had to add a special little hard to find chip: a 1381U voltage trigger (salvaged from some solar engine parts I bought- the U was unusable for those, as it triggers around 4.5v) to keep the NPN from just turning on the relay as soon as possible (which turned out to be MUCH too soon!) So now, with the voltage trigger waiting until it reaches its trigger levels before enabling the NPN, the vibrating motor gets more time to ramp up to a really alarming level. The diode was a little trick I learned to stall the trigger even longer; as the diode "keeps" about .7v as power goes through it, meaning the voltage reaching the trigger is lower than the actual voltage in the capacitor: an extra little delay.
 
I drew this sketch AFTER I had moved this here and there all over the breadboard to get it right, so lets look at the breadboard, wired to control the box externally:
What you see is the relay, the NPN by the relay, and the trigger in the foreground, powering the NPN. The Black and Red jumpers leading to the box went to the motor, the red and green in the background came from the battery/switch. The RC and vibrating motor NPNs are tucked under the Cap (built up previously), and the pager motor is the white blob tucked behind.  Lets see if it works!
 
Looks good from here! (the diode was missing, so the shutoff is rather quick at this stage)
 
Well, with that all said, all that's left to talk about is the neat little arrangement of the relay and motor wiring. You may note that there is no polarity reversing taps, nor a back stop switch to pull the arm back.. yet it pulls back anyway! This is where I start getting DEEP:
 
Its all about Back EMF. Or, more specifically, "Motor Kickback". As a motor is spun, it is also generating its own little power, because the coils are spinning near a magnet. This is the Back EMF (electromagnetic force) that is normally found in all running motors. If the power to the motor is suddenly severed, the Back EMF, which was generating power in the opposite polarity discharges as the motor coasts to a stop. Motor Kickback is a BAD thing in normal electrical engineering (causing belts and such to snap, or motors to lurch in their mounts with the violence), and is usually eliminated with a shunting diode to let the back emf drain away to ground (its just a reversed spike of power that lasts only a moment), found as a diode reverse wired between the motor leads.
 
So Motor Kickback = BAD. Unless you want the motor to kickback! And that's what the motor does in my Leave me ALONE! box. This is why the relay uses both contacts to connect and sever both the ground and the power of the motor simultaneously; with both wires suddenly disconnected, the back EMF has no where to go.. but to drive the motor backwards for as long as it lasts. Which turns out to be just enough! I learned all about this in some other experimental research I was doing, involving scavenging back EMF for usable power... but that's for another time. Whew! {/break DeepMoment;}
 
So, how to pack all of this circuitry in this little 4" x 6" box? printed circuit board? Psh! the Junkbots book taught me about "freeforming" components together.. and I really LIKE the way it looks!
 
So, there it is: all the stuff that was on the breadboard. just SEEING that makes me go "oh, cooool!". If it was going to essentially be the brains of this little box, it might as well look like some brains.. robot brains, of course!
Go ahead! zoom in on the intricate interweavings of all those prongs, each doing its own little thing. To the left is the original RC/vibrating motor driver, in the middle is the newer Trigger/NPN driver for the relay, and the relay itself. The little bits of salvaged wire insulation over some of the prongs helped me remember which ones were switched power and ground. but in the end, I thinks its a bit of a work of art, if I do say so myself.
It was Freeformed into this particular shape to sit neatly in an open spot within the box, as seen here. And thats the neat thing about freeforming: no way a printed circuitboard would fit in there! Plus, it leaves all the stuff inside out of sight from the peeking door, AND leaves me more room for more goodies if I decide to add them later.
All that was left was to wire the power and the two motors in... hmm looks Like I've reached the end of my photo uploads for one post. To be continued!
 
 
 

Tuesday, December 4, 2012

IR Photoelectronics Learning

You remember the robot Eye I made earlier, right? This was after figuring out how a photo resistor works- varying the resistance it provides to a circuit, and, if balanced against another resistor going to ground, creates a variable voltage divider, meaning that the point in between the resistors will have varying voltage depending on the light hitting the Eye- making the Eye a simple and direct motor controller to make a "photovore" that chases a flashlight around.

Anyway, there are several other types of light sensing devices, and since I wanted to learn robotics and electronics, light sensors seem to be a very important thing to learn about.

After salvaging some photodiodes from an old mouse (the kind with a track ball in the bottom), and other photoelectronics I could recognize in other various old electronics (old TV remotes were an obvious choice), and buying some from radio shack now and then over the months, I now have a rather full assortment of gizmo's.. which I never really figured out how to work.

I followed instructions in the Junkbots book (the book that let me know where to find free goodies in "broken" stuff lying in closets and garages everywhere), I had made a "headbot" that spins in place following a light around, using some exotic "bicore" method that made the pulses of the motor going left-right-left vary according to the light hitting the two "eyes". Pretty cool, and worked just fine.. but I had no real idea how it worked. Not really.

So, tonight I dumped the photoelectronics drawer of my little tackle box shelves, and got to work... getting them to work. heh. I noticed that most of the parts were IR (infrared), so, obviously I needed an IR LED to trigger the sensors, right? I tried a TV remote, but I guess the pulses were very rapid or something, nothing seemed to work, so the first step was to build my very first IR remote control, to test these things and see how to make them work.

And here it is, in all its scratch built, "still trying to look cool" glory. I read on the data card for the IRLED's that the voltage to put to them was "1.7v MAX", so a single AA would do just fine. A momentary push button meant I now had my very own IR flashlight... that I couldn't see any light coming out of...
 




...but my camera could see it! Turns out that digital cameras use some kind of CCD light sensor to see and record the image, and this CCD was able to see slightly beyond Human visual spectrum... obviously! This rather bright LED was completely dark as I shot this pic.. Pretty neat!
 
So, with that done, I got to making a breadboard thing that I could aim the IRLED at to make it do something. So, I set up the board with a 5v relay, wired to show a red LED when it was off, and a green one when it got turned on. It was going to get turned on by the photo diode I chose getting hit by IR light.
 
It didn't work, all by itself. You can see the faint purple of the IRLED coming from the light, and bouncing off of the detector I was using, but the relay wasn't energizing. THIS was the "problems" I was dealing with previously in ever trying to put these neat little sensors to work. But today, I vowed to dig in and tinker with it!


I tried having the power the photo diode let through when light hit it power the base of an NPN transistor. Still nothing. Then I got my meters out. With the 6 volts coming from the blue power supply, and the .7 or so Voltage drop expected from the diode, there should be enough to energize the 5v relay, yet not enough was "getting through". In this picture, you can see that the power the diode is letting through is 3.5v or so, so its already about as high as it can go, but the transistor wasn't "turning on enough" to let the relay click on.


So I began thinking... maybe the relay is too power hungry for the diode or transistor to energize it? I knew the transistor was strong enough, as it had done it before on previous tests with other things, so I knew it was the photo diode not giving enough "oomph" as it were.
 
If the diode was doing all it could do, then the problem was to make it do what >>I<< wanted it to do, by somehow taking the power it was leaking though, and have it be enough to turn on the relay. So, I got a bit unoriginal, and had the diode enable the first transistor, which would enable a second transistor, hopefully making that small change at the beginning bigger and bigger each time I used the transistor to "amplify" the "signal" (Junkbots book taught me that a little "push" at the base means a BIG push through the transistor:: amplify)
 
So, with it all rewired, with a double chain of transistors, I wired up my meter to the final power output of the last transistor, leading off to the relay, far right. This pic shows, even with the ambient desk light, the feeble push from the photo diode was already resulting in 3v waiting at the relay. With more direct IR light hitting it, it should easily trip the relay on now.
 
 
Same light as before, but now with the IRLED adding to the punch, Success! I will admit to a little giggle of delight seeing that green light come on (and almost blow out with too much voltage going through it!!). Weird thing is, the voltage at the meter probe didn't really change much.. but the relay clicked... hrmm. Current maybe?
So far I have only been using variances in voltage to make transistors do things, and thought that the transistors let out more voltage as well.. but now think there may be more going on in there than that. Oh well, that's some learnin' for another time. Now its time to show off!
It may not look like much, but I love that it is all home made, self taught, and actually working! Not shown, but what I did later was add even more transistors the the amplify chain, to see if it would increase the actual range of the sensor's "sight" beyond the roughly 2 foot range it shows above. YUP! each transistor seems to add about a foot! This particular IR sensor is the best I played around with so far- its "view" being all around, as opposed to the other types that had to be a dead on hit with the light to do anything.
 
So this is another Queue card sketch on my file, and another gizmo I'm going to take off the breadboard and make into a purpose built device: "a wheeled Robot tester"; something I can just stick to the motors of a chassis/toy/home built Frankenstein creation, or whatever, put it on the ground, and use my remote to see if the motors are going the right way, the wheels are straight, if it pulls to the left or not, etc.


Monday, December 3, 2012

LEAVE ME ALONE BOX- Vibration add on project.

I really love Instamorph! The stuff is just amazingly useful, and has an additional feature I plan on using from now on, now that I have discovered it: its "refusal" to bond putty state IM against cooled plastic state IM! Why is this cool?! Well, let me show you:

Here is the new vibrator install. It is placed center line, on the heavy end of the box- to make the mass of the box jitter around more (in theory). To the left of the motor is a big new section of IM, thats just a holding frame for the 9V battery, seen socketed in it. I figured this was needed due to the violent vibrations the box would now undergo, plus, the battery kept slipping loose anyway. Added bonus, my thumbprints are now a part of the box for posterity!
 I was originally planning on stuffing the large Cap in the square void left available, but found the vibrator motor fit just fine. So, I got a big glob of Instamorph all warm and clear and playdough-like, and squished the motor into it, then squished the still malleable putty (now more like modeling clay consistency as it cools) into that hole. Since the warm newly installed glob was warm, yet the white stuff to either side of were cold, they didn't interact with each other. Why is this cool?
Because if you notice, the bottom picture glob around the vibrator is already molded to fit in that socket, and YES, it is still removable! Notice the grooves on the bottom, that match the bump lines at the rear of the box. That means this motor is now socketed into a custom molded plug, to fit snugly in its place, yet still be removable! Don't believe me? well, watch:

Its a nice solid click, due to the shape of the plug and socket, when it clicks in, it holds it solidly in place (notice that when trying to remove it again it picked up the whole box). no glue, screws, etc required! how many other mounting methods can claim the same features?! NONE! this stuff is future technology material at its best.

After mounting the motor, and seeing that nothing more was needed to secure it inside the box, it was time to permanently wire the little RC engine that would drive it.




I was trying to go for compact and small, and wound up getting Super Cool looking as well! Bonus! Like my 1wing Solar engine, all of the electronic components fit between the Capacitor prongs, so if I can find room for the Cap, all that's left is to wire the additional wires up.
 
I cant decide if it looks High Tech? or Vacuum Tube Retro? Regardless, its super neat looking (IMHO), and I get a little beam of pride knowing no circuit board was required.
With the intricacies all done, it was now time to test it! lets set it up, place the camera, and see what happens when I (electrician term) "Turn on the Juice, and see what shakes loose!"
 
Yup! I'd say its working OK. and there seems to be enough power- electrical, transistor supplied, motive mass, whichever power you may have thought I was talking about!


Sunday, December 2, 2012

PAGER VIBRATOR RAMP UP CIRCUIT

Success! After maybe 5-6 different tries, I have a circuit that works the way I wanted it to!

This is a big achievement for me, as this is the first time had an idea of what I wanted to do first, then successfully designed a series of electronic components that would make it do it correctly! Up to this point, I was either following circuit drawings, or mimicking other circuits, like the solar engines.

This also taught me some more details about capacitors. I already knew how to trickle charge a large Cap up in voltage slowly, either with a trickle coming from a solar cell, or through a high ohm resistor... BUT I never had any practical idea of how to USE that, other than to voltage trigger it to dump it through a motor... making the cap merely a second hand battery.

Now, I know how to make it a timer as well! This is an RC style electronics trick, which most electronics guys would already know about, but I learned it the hard way... as RC to me meant "Radio Controlled" :)

Anyway, here's the circuit, drawn on an index card and definitely going into my "don't forget this trick!" index card box.
So, it took me a few tries; The Cap here, the Cap there, across the motor leads, etc etc.. and it never worked. The Cap wouldn't charge up if there was a motor there to hog all the power, apparently. So, I eventually tried an NPN Transistor between the Cap and motor, hoping that the Base wouldn't "hog" the power from the Cap, and that Base, as it rose in voltage along with the capacitor, would "throttle" the power waiting at the transistor Collector (not sure on the terms yet). Turns out, that was the trick! The capacitor was now "separated" from the motor, the motor getting its power from the transistor. Simple. Sorta. The transistor seemed to peter out with the motor around 5v, and there was 9v there.. so maybe I had reached the limit of what that tiny transistor could "throttle".
SO... hearing about this trick called a "darlington transistor pair", where you simply double up the transistors to get them to supply more working power. THAT was the final problem solved!
 
So, right now that resistor is 1k ohm.. and the ramp up of the pager motor is pretty quick... oh, wait, I didn't show the video of that yet!

Heh.. you cant see it, but the soldering iron resting in those mechanical fingers was vibrated almost out of its holder! Wow that vibrator is strong (when forced with much more power than it was ever designed to take.. hehe). Its out of focus, but I got the gauge in the background showing the voltage rising in the capacitor... It peters out around 7v.. meaning the other 2 is probably what the transistor pair is "stealing" but anyway, it perfectly meets the power requirements to energize the 5v relay after a few seconds delay-  that I plan on adding to my LeaveMeAlone box to give it more "activity"

As I was saying, the resistor causing the delay is 1k Ohm, which is a little too fast I think, but when I tried a 10k ohm, it took too long. So I'm guessing 5k Ohm or so will let the box sit inert for maybe 3 seconds before the first rumblings... then its On like Donkey Kong!! as they say... at least as those as old as I am used to say. heh.

So that's it for today. learning stuff. taking notes. almost vibrating a hot soldering iron into my lap. The usual.
THE MOST USELESS MACHINE


I call mine the "Leave Me ALONE" box, because of what it does, and also because it knows what the rest of the world calls it. Basically, this is a simple device that will make you smile, simply because its only purpose is to turn itself back off if anyone hits the switch.

I got the Idea from Instructables, MakeMagazine, Solarbotics and YouTube stories/ads/videos about it. Its really sort of a "Meme"- like a Viral Idea that spreads like a Virus everywhere rapidly, as in all the articles listed above.

It is a really simple thing, both to build and to wire, yet it behaves like there is more in there going on than there actually is. All that's inside is a double pole, double throw switch, a motor, and a push button switch than can be wired Normally Closed.

Most of the Useless Machines you see online are rather big.. like cigar box sized.. which didn't appeal to me very much. I figured I could make one out of a little radio shack Project box, with a micro DPDT switch, and a mini geared motor I got from solarbotics.

The hardest part was cutting the door away with a hacksaw... carefully slicing a section of the top off, yet leaving it intact enough to replace and hinge with some ubiquitous HotGlue. It makes a really nice spring loaded hinge- that keeps the door flap closed and slammed shut. No springs/screws required!
Seen here painted Silver... I don't know why, to match the painted writing in the channels made with a hot soldering iron (used) tip on the top I guess.
 
After getting it all built and wired up, I was surprised to find this box.. roughly the size of a 5 x 8" index card, had plenty of room inside still!
 


Hrmm Its a little hard to see, but lets try to give a Tour: The 9Volt battery is the 9 volt battery ( :P ), the red thing is the underside of the DPDT switch, the big white Square blob is the mini "Geared Motor"- a motor with a built in gearbox for more torque, the blinding white arm thing is the arm, made of that Instamorph stuff, and hiding under the axle of the arm, is the black contact switch. The paperclip coming off of the right of the arm is what hits the contact switch, and what can be easily bent to adjust the stop portion just right.

If you look closely in the top right corner, you'll see another white blob... that's some more instamorph, using that corners screw mounting posts as a "grip", and wrapping around the back end of the motor case of the gear motor to make... an instant BRACKET. MAN that stuff is handy.. I don't know HOW I lived without it. I guess I would have hot glued it before.
 
So there it is, the silly Leave me ALONE box. I brought it to work, left it on my desk, and everyone couldn't resist but to NOT leave it alone. They all loved it. Oh! I almost forgot the other goofy detail. Notice how all the internals are off to the side, not visible from the door, well, since I knew everyone was going to look inside and not see anything. I figured Id give anyone curious something to look at:
 
 
With all that extra room inside, I feel tempted to add some more "things it does" to it. One of the first ones will be a hidden on/off switch- sometimes it chatters a bit like a ticking time bomb if it gets slammed around a bit, and the arm starts bouncing on the contact switch sping.
 
Other ideas are:
- A vibrating pager motor wired so that when the switch is in the "left alone" position, but the door gets opened (tilt switch on its underside?) the box will vibrate angrily!!  :) (hmm but then I would have to make the box more drop-proof)
 
- A Large cap acting as a time delay, and ramp up for when the switch is engaged- the switch wont directly move the motor, but rather start to ramp up power in the Cap- slowed by a resistor to take a bit of time, the rising power making the pager motor vibrate more and more violently as it gets up to about 5v: the voltage to make the mini relay inside energize- initiating the whole arm thing- rather than the Switch. (this will take some experimenting, learning how to make a capacitor charge up, and at the same time drive the motor for the vibrator under the varying voltage levels).. sort of a "b.b.b.bb.bb.bbbbbbBBBBBBBRRRRRRRRWOOOOOAAAAAOOOOOWWW!!!!*click!*-arm smacks switch, arm retracts, everything stops. vibrations slow down and stop (as CAP drains away the remainder energy)
 
-toothbrush heads chopped off, and holes hut into metal base plate so the bristles stick out on each side of the base as feet- one angled one way, the other the opposite way. IF its not too heavy, as the vibrating motor gets going, the box should spin in place as a "bristlebot" on whatever its sitting on! Placing the weight of the vibrator will be key to this one, but its just a dream at this point.
 
 
So you see, its these ideas that keep me interested in continuing to tinker- if I didn't have these crazy ideas I wanted to try, I wouldn't be quite so mad scientist enthusiastic about it all!!
 
I'm going to go work on that "getting more violent" vibrator circuit. Be back soon with results, if any.