John asked a question about how to control motors from an MSP430, so I thought I’d make a post about it. This is a post-in-progress, since I’m at home looking after my baby boy and he won’t let me write much continuously. If you have suggestions to where it should be improved, let me know and I’ll add stuff.
First choose motor type. If you use modified servos, you can just connect them to your microcontroller (MCU) and upload the right code. If you use plain DC motors you need a motor driver chip or board, such as the L298. You probably want geared DC motors, since they aren’t as fast as non-geared ones. Connect the driver to your MCU and upload the right code. The speed of the motors is controlled using pulse-width-modulation.
Software-wise you can either choose Arduino (or the MSP430-equivalent called Energia) or go for the C-approach. C is more difficult, but maybe more powerful. Arduino/Energia works great for many robots and I used this for several years before I moved to C as a programming platform.
Read on if you’re interested. More details and instructions below.
I’m trying to make a garage door opener using some cheap CC2500 boards bought through a group-buy at 43oh.com and a great breakout board designed by RobG. I’ve made a prototype first, and it seems to work, but is not very pretty. I need to maybe make it more compact and make a case for it. Here’s a picture:
The code is definitely not finished, but you can download it here if you want to look at it.
Here is a laser cut rover I’ve made, using the LCD-button-board as the controller. The motors are cheap, modified Hobbyking servos. It’s a very simple build, and it is programmable using the keys on the LCD-board. The LCD-board has connectors for two servos and one sensor, giving access to two IO (one of which is P1.6, an analog input, required for the IR sensor).
The software is programmed using Energia, which is an Arduino-clone for MSP430.
The firmware used on the video is here and you also need the LCD library for the board, which is here. If you think this is interesting you may also want to look at one of my other, even simpler builds, which requires less components.
If you’d like to make one yourself, you can do it without the laser-cut kit also. You can just get a 3-cell battery box as on the picture and use double-sided tape to glue the servos on top of it, and the board on top of the servos. Use something round (CDs?) as the wheels. Will work fine. But make sure you use 3 NiMH batteries (1.2 V each, 3.6 V in total), since this will give a good voltage you can feed directly to the servos and to the MSP430/LCD without breaking anything. If you use 3 Alkaline batteries, you need a regulator for the MSP430/LCD.
If you want a laser-cut kit, I can make one for you. Send me a message and I’ll add it to the store.
I’m trying to make a low-cost robot kit, and part of this should really be a low cost Infrared Proximity sensor. Here’s the schematics. Ignore the photo-sensors on the right. They are for if you don’t want an IR sensor and you just want to sense the difference between light/dark on two sides of the bot.
It works, but not for very long distances. I’m using it for sensing for example 10 cm, which is fine for a robot.
OK, sorry to repeat myself, but I made another iteration of the box design. This one looks better. The top is now glued on, and the side-walls are thin and fit outside the top. Well, it is best described by a picture. The design is on thingiverse.
Here’s another attempt of making a case for the MSP43o Launchpad, with room for the LCD board I’ve made and touch sensors. The black side is 3d-printed, while the top and bottom is laser-cut. In this model I’ve used screws to fasten the top and bottom plate, but it may have been prettier to glue the top plate on. I could have chosen a less transparent plexiglass/acrylic, but I did it this way in the prototype to show the inside. It would probably be nicer with a less transparent one, but I would have had to cut a hole for the LCD display. I wonder if I could maybe cut a square hole for the lcd display and cut a similar square in transparent plexi, and glue it inside the whole. I might try that out.
There is a room in the side for the USB contact.
There is space between the capacitive sensors on the board and the top plate, and it turns out that air is a bad material to ‘conduct capacitive touch’, while silicone apparently is pretty good. So I filled the room with transparent flexible silicone glue from a tube. The type you use on the bathroom to waterproof stuff. I had to turn up the sensitivity in the firmware, from 1000 with nothing there to 50 (so the effect on capacitance is still pretty big). The acrylic is about 1.5 mm thick, so the total is about 3-4 mm of silicone plus 1.5 mm of acrylic.
So every cool platform needs a laser cut acrylic box (apparently). I’ve now designed one for Launchpad, and here’s a picture.
The design is still a bit work-in-progress, but here are the files anyway. Expect some changes. The screws don’t quite fit for example, but I might change it so that the top is glued on, making the top slighly nicer looking with no screws.
I have made three LCD boosterpacks for the MSP430 Launchpad or other 3V microcontrollers. These are based on the Powertip PE9665WRF display with the ST7579 controller. The screen is small (28x19mm viewable area) and requires little power (0.2mA). It is SPI-based, has backlight and has 96×65 dots. It’s a perfect display if you need a cheap, small and low-power display for your next project. If you want to make your own boosterpack, I can also sell the display itself. I have bought a bunch of 250 displays, so need to get rid of them. I won’t be making any money on these boosterpack. I’m doing it for fun and learning. A first batch will soon be available in the 43oh.com store.
The boosterpacks are currently in their first version, and may evolve and be improved from this description. The packs are:
LCD Touch Boosterpack – a classic boosterpack with the LCD and 4 capacitive touch button areas (the display isn’t touch-enabled, in case you were wondering, just the 4 areas below the screen).
LCD Button Boosterpack – can be a classic boosterpack to mount onto a Launchpad or it has a place to put a DIP MSP430 onto it, so you can use the Boosterpack without a Launchpad. Also has room to solder on a regulator in case you want to run it off a battery.
LCD Watch – not really a boosterpack, as it won’t fit onto the Launchpad. It’s smaller in size and is meant to be part of a wrist-watch kit.
There is more info about the boosterpacks on a permanent page here on my blog, including a link to a video.
I’ve made some MSP430 code for a high-temperature capable thermometer, by adapting the code from Reprap. The code uses the B57560G104F thermistor that can measure temperatures up to 300 Degrees C. As a display I suggest you buy the display I’m showing below (will soon be available to buy) or for example this character-display from Farnell.
The picture shows the temperature in a display and in front the Thermistor. These are really tiny glass beads that can handle high temperatures, but be careful with how you mount it.
The circuit is basically
Vcc — 10K resistor — P1.2 — Thermistor — 0V
It’s also good to place a 1uF capacitor across the thermistor to remove noise.
IAR MSP430 code is below. It can easily be adapted to CCS or MSPGCC.