A fairly standard project for electronic beginners is to build a desktop power supply from an old computer power supply. I know some of you are thinking “Huh? Why on Earth would you do that?” When you are playing with a new circuit, you always need a DC power source and it isn’t convenient to keep digging out batteries and a battery case to get the voltage you want. Instead, you would like an easy way to get different voltages that you can use to power different circuits. The answer is a desktop power supply like this one:
A “Real” power supply that costs “Real” money
This one would be great but it costs $331. When you’ve already spent far too much on your new hobby, the quest for continued marital harmony suggests that you forgo spending hundreds of dollars on a new piece of equipment and build one yourself. That’s how I ended up with this:
It isn’t as pretty and doesn’t have as many features but it was far cheaper than a store-bought unit. (To be honest, there are cheaper store-bought power supplies but comparing mine to one that costs $79 would make you wonder why in the heck I made my own.)
To build this, I used an old computer power supply from a computer that I bought back in 2000, a stereo speaker that we got at the Arc for $4.00 and various bits and pieces that *should* have cost me about $20. Of course, I ordered some wrong parts mistakenly and then wasted a board with some ham-fisted soldering but, in theory, I built this for less than the cost of buying one new. I’m happy with the functionality but the craftsmanship isn’t where I want it. One of the LEDs is misaligned with the others and the hole I cut for the digital display is too big on one side. Even though it isn’t pretty, it has features that one wouldn’t find in a cheaper unit:
- 12, 5 and 3.3 volt rails
- Adjustable rail that goes from 1.2 to 10.5 volts
- Digital display of the output voltage
- USB port for devices that use USB power
- Genuine BradLab© construction
Here are pictures from construction:
Tonight’s accomplishment is a working prototype of a desktop power supply that I’m building. It has four channels – 12V, 5V, 3.3V and a variable voltage channel. Now I need to transfer these breadboard circuits to a protoboard and find a suitable box to stuff it all in. When done, the front panel will have an On/Off switch, a adjustment dial, a display LED and banana jacks for the four power rails. I may also add a USB port for powering USB devices.
This is a pretty standard project for electronics beginners but it was fun to put it all together and not smoke, melt or toast anything. It actually worked on my first test, which is not exactly typical for me. 🙂
In this week’s installment, we learn how an I-beam, a squat cage and a freestanding heavy-bag frame down in the basement can cause problems for a robot driving around on the first floor.
After this weekend’s successful test drive of the Escalade rover, I wanted to fine-tune the control system by calibrating the compass and associated steering algorithm. I *thought* that I would be able to do that inside since I only need 15 feet or so to drive in a straight line. Unfortunately, I was getting very inconsistent results. Eventually I realized what was causing the problem.
My basement has some very large steel objects in it. Every time the robot drives over one of them, the internal compass would start getting weird results. Then the steering system would go nuts and the rover would crash into something. At first I was doubtful but then I realized that the straight line distance from the first floor to the ceiling of the basement is less than a foot. Apparently, the “magnetometer on a chip” is sensitive enough that those things throw it off.
It was good to realize what was happening but that slows down my progress if I can’t test inside. The temperature outside right now is -1 F. Sure, I’m a manly man and not scared of a little frostbite but the cold is bad for the batteries. So I think I will turn on an episode of Mythbusters and call it a night.
This 96 second video shows the first outdoor test of a cheap RC car that I converted to an autonomous rover. I took out the remote control circuit board and added:
– An Arduino Uno microcontroller for control of the motors, steering & sensors
– A Raspberry Pi “computer on a board” for higher-level functions like Guidance and communications
– An Inertial Measurement Unit with a compass, accelerometer and gyroscope
– Additional batteries
Once the Raspberry Pi receives the Go signal from the laptop via wireless, the vehicle is completely autonomous. I am able to monitor telemetry remotely and, if necessary, issue a emergency shutdown command but other than that, the on-board electronics do everything.
The goals of this test drive are very simple. Use the compass to determine the current heading, drive 30 seconds in that direction, turn around and drive 30 seconds on the opposite heading.
You will see the vehicle swerve back and forth a lot during the drive. There are several parameters to the control system that control how quickly it reacts to a course deviation and how large and long the steering response should be. Fine tuning these parameters will make it drive in a straighter line with less of the over-correction that you see in this test.
Once I have the steering smoothed out, I’ll add logic to use the other capabilities of the IMU. This will allow me to build more sophisticated capabilities than what you see here. There’s still plenty of work to do but this vehicle has come a long way in the past month. Stay tuned for more developments.
This weekend can best be described as “Partly Cloudy”, when it comes to electronics & robotics . First, the successes:
- The vehicle is completely built with all the components fully assembled, the wires run neatly and everything bolted down in a secure manner. Plus it looks not all together crappy.
- The Arduino and Pi are talking to one another via USB cable. This allows the Pi to send commands to the Arduino and to get status back.
- I can login to the Pi wirelessly from my phone or laptop and get status and send commands from it.
- The Inertial Measurement Unit is installed and working. There’s a lot of coding to do to make it useful but operational hardware is a big step.
- While rummaging through the electronics section at the Arc, I found a Linksys router for $2.00 (two doll hairs). I brought it home and it works great. I’ll use this to build an isolated and (eventually) portable network. BTW… that router takes 12V at 1A. Running it off of batteries may be a challenge.
I was feeling pretty good about all those accomplishments but there was one small detail that put a bit of a damper on things. As I was doing the final assembly on the vehicle, I reversed the power leads for the Arduino as I was hooking it up. There wasn’t any smoke, flames or other drama but the end result was the Arduino was fried. Totally kaput. And it took the attached motor shield with it. That means that I was unable to make the motors spin or even read any of the sensors. Metaphorically speaking, the vehicle is broke down on the side of the road with the drive-shaft hanging loose.
Jiminy. Jeepers. Drats. Dadgummit! And other very harsh words that the Internet Police will frown on me for.
How did such a thing happen? Well, contrary to good design practices, I was not using a polarized plug for power. If I had been, it would have been physically impossible to hook up the power backwards. That has since been corrected.
Fortunately, Radio Shack has the Arduino on the shelf so I was able to replace that readily enough but the motor shield has to come from Adafruit Industries. It will take a few days but hopefully UPS will treat me right and it will get here before the Thanksgiving break. The goal is to take the vehicle to the track at Rampart HS and do a field test with it over the Thanksgiving break. Stay tuned on this same Bat-Channel for further news.
It may not look like much but the circuit board at the bottom of the picture is a key component in the rover I’m building based on a cheap RC car. Not only does it provide power conversion and distribution, it is the mount point for a potentiometer and switch that can be used for controlling the vehicle. More importantly, it holds a 9 degree of freedom IMU that provides a gyroscope, accelerometer and magnetomer (compass). All those things are on the small green board at the top of the protoboard.
Getting involved in robotics and electronics has been a lot of fun but it has also been great for learning patience. First, I had to learn to not get frustrated every time I make a mistake and ruin hours of hard work. Second, I had to learn that a complex project takes time to finish. You can’t just knock it out by staying up until 4:00 AM two and three times a week. All you accomplish that way is to make a lot of mistakes and get bags under your eyes.
I told Teri that Mr. Miyagi tended his bonsai trees as a way to build something slowly and carefully and that I am doing the same thing with the robot. I’m not sure she buys into the Zen/balance aspect of this hobby. I’m pretty sure she just sees it as “playing with expensive toys” rather than a Miyagi-esque “nurturing a state of calm awareness”. (Don’t tell her… but she isn’t entirely wrong)
Listen to the throaty rumble of the supercharged big-block in this robot. You doubt that the rover has a big-block, much less a supercharger? Go ahead and click play and tell me what it sounds like.
Okay… I confess. That noise is just the noise of the servo moving back and forth. It isn’t that loud in real life but for some reason the mic on the phone makes it sound more significant than it really is. The only IC in this robot stands for Integrated Circuit, not Internal Combustion.
What you’re looking at is an upgraded proximity sensor. The original Infrared proximity sensor was simply glued to the front bumper which meant that it couldn’t detect objects on an angle. The new ultrasonic sensor has better range and better accuracy and is mounted on a micro-servo. The servo mount is HDPE and you can probably tell it was handcrafted.
If you have a keen eye, you can see that the servo is being driven by an Arduino Uno sitting on the desk, not the Arduino Micro that is under the hood. This is a better setup for testing. The Micro is considerably smaller and more difficult to use when experimenting.
This weekend I’ll tie the new hardware into the control system and show off some (hopefully) fancy maneuvering. Ideally, these won’t involve any unexpected stairways. 🙂