Category: Making
General Solutions
There have been two things that I have done several times over the last couple of years. The first one is having a bit of code control an inductive load of about an amp, be it a DC motor, stepper motor, or solenoid. My ToyBrain boards are a general solution to that problem, so I can just drop one in and write the code, instead of reinventing the wheel (or at least the controller for the wheel).
The other problem that I end up solving a lot is having a microcontroller drive an RGB led to make color fades and washes. This shows up in different forms in a bunch of my projects, and is not hard to do. However, I keep doing it, so I might as well have a PCB to make it easy. My goal is to have something that can drive up to about 30A, for three channels, with PWM. I usually use an ATTiny85 for this, along with current-regulated MOSFET drivers operating as current sinks. That actually leaves me with two pins left over for other purposes, so I’ll have some GPIO lines on the board as well.
The point of having general solutions like this is that it saves me from doing the boring parts of a job and lets me get directly to the interesting parts. These sort of programmable widgets are becoming so cheap and simple that they are effectively the dust that real things are made of. There is actually a term for this process: Ephemeralization. AM and FM radios are effectively ephemeral at this point. You can buy a single IC that does everything needed to receive AM/FM audio signals, or get the radios pre-made in units of a great gross from somewhere in China for pennies each. The case it is in no longer needs to look “like a radio” (whatever that means) because the parts are so small and flexible that you can put any sort of case around them and have a radio. Cameras (of a certain quality level, at least) have pretty much gone that way, cell phones and computers are going next.
What kind of world do you get when everything has a computer in it because it was cheaper and easier to build the thing around a general-purpose computing device instead of designing a single-use custom solution?
ToyBrain Boards Arrived
The ToyBrain boards arrived. I have populated four of them with programming headers and microcontrollers. Two have ATMega8 chips, the other two have ATMega48 chips that I salvaged from some thermostats that I found.
I haven’t bothered fully populating the boards because I want to check that the ICSP headers are working by burning the Arduino bootloader to the chips, and that the serial headers are working by loading a program from the Arduino IDE.
Assuming that I haven’t miss-designed the circuit boards or baked the chips while soldering them, this will provide a smoke-test for the computer side of the boards. I still need to get a bunch of SN754410NE quad half-H-Bridge motor driver chips to handle the output side.
So far, I’ve come up with quite a few applications for the little boards:
- Re-animating gutted toys with new programming
- Controlling a single stepper motor with step/direction signals and limit switches
- Driving up to 4 channels of medium-current LED lights (RGB plus white?)
- Making loud noises by using the quad half H-bridges as push-pull speaker drivers
- Solenoid drivers and control hardware for chimes
I’m very eager to get a few of the boards out to beta testers and see what other people come up with.
ToyBrain boards on the way!
The PCBs for my programmable toy controllers are on their way to me. That means that I didn’t mess up the layout in some way that makes it impossible to make the boards, but doesn’t preclude me possibly getting something wrong in the design. I’m going to assemble a few when they arrive and shake them down for layout defects. I also have a beta tester who wants to use one.
One thing I’m considering for the next version is adding an on-board voltage regulator, but that usually calls for caps as well, and starts to drive the board size and price up. I should also add mounting holes, but again, those take board real estate. I may neaten up the connector layout, and make sure everything is on 0.1″ centers for ease of mounting with normal pin headers. If I get all the through-hole connections moved to the edges of the board, or add edge connectors that make good wire lands and good header connections, I may be able to shrink the board more and not have many pins sticking through it. That would mean it would have a smooth bottom, and so be easy to mount with double-sided tape.
Stepper Drivers
I have three head-positioning assemblies from CD-ROM drives. In the drive, they would move the optical components around to read the various parts of the disk. Removed from the drive, I’m planning to use them to make very small CNC machines. The head positioning assemblies use bipolar stepper motors, which turn a threaded rod, which draws the optics along.
Normally, I use the electronics from floppy drives to control stepper motors. The floppy drive interface has step and direction pins that directly control the motor used to position the head of the floppy disk drive.
Unfortunately, all of the floppy drive motors I have around used unipolar stepper motors. This makes driving them slightly easier, as power is supplied to the motor on one wire, and all the other windings are driven with current sink drivers. As a result, each winding is either on or off, but the current always flows through it in the same direction when it is powered.
All the stepper motors I have are bipolar stepper motors. Instead of current sink drivers, they are driven by a driver that can reverse the direction of the current flow through the motor windings. I can think of ways to drive a unipolar motor from a bipolar driver, but I’m not seeing any good way to drive a bipolar motor from a unipolar driver.
I may end up just building my own drivers, and running them with an Arduino or other microcontroller. I have all the parts, and it’s certainly cheaper than buying a bunch of drivers.
Brain Transplants for Toys
I have a bunch of old toy skeletons sitting around. They are not toy versions of the bones of animals, but the frameworks and some of the motors from things like a toy tracked robot, an RC truck, a few toy robot insects, some tiny RC cars, a robot base with continuous-rotation servos, and so forth. All of these things have motors or servos in them. All of them need some form of controller to make them into autonomous robots to do my bidding (or wander around banging into things).
To that end, I’ve developed a little embeddable controller around the ATMega8, ATMega48/88/168, and other pin-compatible microcontrollers. That is the same chip used in the Arduino, so my board will be software-compatible with the Arduino as well.
My controller, which I’m calling ToyBrain, has a pair of 1A (stackable for more current) H-Bridge motor drivers, so it can control up to four motors in one direction, two motors bidirectionally, or one stepper motor. It also provides two headers for servo motors. For inputs, it has four analog or digital inputs and two digital inputs that are connected to interrupt lines, so it can do things like handle bumper switches in an interrupt service routine.
I’ve ordered 10 boards. When they arrive, I’m going to populate them with whatever chips I have around and try to get a few of my old toys running. Assuming everything goes well and I get a polished device together over the winter, this may end up being something I sell at the MIT flea regularly. I’ll hook up a bunch of toys with the same controller, to show off its versatility, and offer the controller as a kit people can buy.
Reactive Inflatables
I’m working on a project to make inflatable sculptures that react to contact. The inflatable shapes are sewn together out of materials like umbrella fabric and ripstop nylon. Those fabrics block air well, and so a shape made of them can be inflated by a fan.
I am planning to have them react to contact by monitoring the speed of the fans that inflate them. If the inflated shape is pushed, the air pressure in it will increase, and escaping air will try to turn the fan backwards. This should show up as a decrease in fan speed, which I can detect with a microcontroller. The fans are computer cooling fans, so they already have speed sensors built into them. The speed sensors were originally intended to allow the computer that the fans cooled to detect fan failure and shut down gracefully.
I have a couple of inflatable shapes together, but I need a beefier 12V benchtop supply to run them. each fan draws 1.1A at 12V. That is a lot more than a normal computer fan, but these are high-volume server cooling fans, so they move a lot more air.
Seizuredome light construction photos
The Seizuredome light is an icosahedron made out of aluminum. Each face is 5.5 inches on a side, so the whole thing ends up being about the size of a soccer ball. Each face has three 1″ aluminum spikes sticking out of it, so that when it is not hanging, it does not rest on any of the LEDs.
The light started life as a sheet of aluminum, 24″ on a side. I plotted the net of the icosahedron by constructing a bunch of equilateral triangles with a compass and straightedge. Geometry class is only useless if you’re not planning to make anything interesting in your life.
After that was all plotted out, I cut it out with tin snips and cut arcs out of the corners with a nibbler. The arcs will make the finished shape have a hole at each vertex. Those holes are where I will run the wires for the LEDs, but they also let me more or less ignore the thickness of the material, which would otherwise possibly make the corners look bad.
Then I drilled holes in all the pieces. The holes in the faces are for LED and spike mounting. The ones in the tabs are for rivets that hold the shapes together.
I bent the flat shapes in an improvised metal brake to get them 3-D, and then riveted them together to hold the shape.
The finished shape seems to fit together pretty well.
I added more holes for sheet metal screws. I also added a flat plastic platform inside, so that the electronics have something to rest on, and screwed the spikes to the outside. The spikes are intended to be ornaments for punk clothing, but they mount with screws, so you can stick them on anything you can drill a hole in.
The electronics are also mostly together. I just have to finish up the code, and then mount the control circuit inside, the LEDs outside, and add a power switch.
Rave in a Briefcase
As part of preparations for a local party, I am building a sound system to fit in a small suitcase and run on 12V DC. The system consists of a small DJ mixing deck and a car audio amplifier. Powering the car amp is easy, as it was designed to take 12V DC power. Powering the mixing deck is not so easy.
Mixers are audio gear, so they tend to have audio signals that are AC, and have components above and below 0V. As a result, they have double-ended power supplies. For the mixer I have, there is an 18V AC power brick, which gets rectified, filtered, and put through a +15V regulator and a -15v regulator. 15, being higher than 12, is an inconvenient number of volts to get out of a 12V battery. Since it’s double-ended, I really need a voltage spread of 30V, with a 0V rail in the middle.
The simple, stupid way to do this is to power the rig with two 12V batteries and two 6V batteries. Across each set of one 6V and one 12V, I would have 18V, and if each of the pairs of batteries shared a common ground, that would be my 0V rail. Unfortunately, I’d also have to manage charging, connecting, and monitoring charge on all of those batteries, not to mention carrying them to wherever I was using the audio. Lead-acid batteries are heavy. Since this is inelegant, heavy, and requires lots of fiddling, I’m going to call it “Plan C” and only do it if everything else fails.
Another simple solution is to use a 12V DC to 120V AC inverter. That takes up a lot of space, and isn’t all that efficient, but it means I don’t have to build a replacement power supply for the amplifier. I have all the parts for it, and it requires less hauling and fiddling than Plan C, but it is still inefficient, so this is “Plan B”.
Since the AC wall wart is rated for 300mA, I have an upper bound on what the mixer can draw. That means I can start looking into DC/DC converters. Vicor makes a 12V to 15V converter, but it costs $99 dollars and I would need two of them. Since I don’t need a lot of current, I can probably make a pair of step-up converters that have a 15-18V output. This site has a simple schematic, and more importantly, the equation for the output voltage, given the current and frequency of a switching circuit in the converter. The control IC takes care of monitoring the output voltage and varying the frequency, but I may be able to use a simpler circuit and change the frequency by splitting off part of the output voltage and feeding it back to the RC timer circuit.The whole circuit would be small, and probably more efficient than using an inverter and the power supply of the mixer.
What is going on
I started this blog to keep a sort of running list of what projects I have going on and my progress on each of them. Instead of doing that, I’ve been working on the projects and ignoring the blog.
My main project right now is the Seizuredome. The “dome” part is an icosahedron made out of electrical conduit. Five of the faces of the icosahedron are left off, and it rests on the ground on that side, forming a sort of dome. I used the construction techniques from Desert Domes to build the frame, but the process is essentially flattening the ends of the pieces of pipe and drilling holes in them so they can be held together with bolts. There is a picture of the completed dome frame in a previous post. That frame will be covered with mylar “space blankets” to provide a reflective surface.
The “seizure” part of the dome is a little more complicated. If you close your eyes and look at a bright light, you can still sort-of see the light, as a red glow through your eyelids. If that light pulses in the 5-20Hz range, you would expect to see the blinking through your eyelids. Instead, most people end up seeing colorful patterns, like swirling fractals, tye-die designs, spiderwebs, and such. What happens is that the blinking signal is close enough to the patterns of electrical activity in the brain that it can drive the dominant frequencies of neural activity to synchronize with it, resulting in hallucinations and mildly altered states of consciousness. You can buy goggles with blinking lights in them, or make your own devices, which will allow one person to do this. I’m building a photic driver for multiple users.
The Seizuredome will have a bright red strobing light in its center. This light is made of 20 1-watt red LEDs mounted on the surface of an aluminum icosahedron. Each LED is driven by a constant-current driver, which is controlled by a TLC5940 LED driver chip. The TLC5940 chips are controlled by an Arduino. Power for the whole thing is supplied by a LM7805 supply with a beefy pass transistor. That light will be hung inside the reflective dome, illuminating the inside. Since the light is suspended inside a reflective dome, there will probably be no place inside the dome that isn’t strobing red, so users inside the dome will be able to see the psychedelic show by entering the dome and closing their eyes.
That still doesn’t really answer why I called it the Seizuredome, though. I turns out that some people are photosensitive epileptics, but don’t know it. Strobing lights of the frequencies most likely to cause seizures by interfering with neural electrical activity are rare, and don’t usually last long enough to trigger seizures. As a result, it’s possible for someone to grow up without ever seeing a blinking light that is intense enough for a long enough time to cause a seizure.
Until now.
Seizuredome!
This is the framework for a geodesic dome. It will be wrapped in mylar blankets to make the interior reflective and lit with a very powerful red LED strobe. Anyone inside it will be able to get brain-machine-like effects by sitting and looking at the strobe.
Of course, it could also cause seizures in previously undiagnosed photosensitive epileptics, so there will have to be warning signs.
Recent Comments