Controlling a railroad with an mbed

rr

The word hacking got its start with model railway clubs, and the state of the art belies the current advancements in computer control and very, very small microcontrollers. [Jim] put together a great tutorial for driving model locomotives with a microcontroller, in this case an ARM-powered mbed.

Low-end model locomotives are controlled with DC, so an H-bridge and a PWM out on the mbed makes sense to drive these trains. [Jim] wired up a Pololu H-bridge driver, connected it to his mbed, and everything ran great.

Rail switches are another matter entirely. These allow trains to move from one track to another, but having them go to the left or right requires powering a fairly high current solenoid with 15 to 24 volts. For this, [Jim] used a MOSFET power control board to switch the rails and came up with a pretty neat demo that shows a small locomotive going back and forth over a single rail switch.

There is another class of model locomotive – ones with Digital Command Control. This setup is just a small decoder chip that fits inside an engine and tells the locomotive to turn on a lamp or run a motor digitally, allowing the conductor to control multiple trains on the same track.

[Jim] goes through the basics of DCC using the mbed, allowing two trains to switch positions in a rail yard using computer control. It’s really cool stuff that leaves us wanting a little more room in the basement to start building a huge computer controlled model railway.

[Read more...]

Hardware store goods and an mbed combine help solar panels track the sun

sun-tracking-solar-panels

If you have the space, and can build a tracking rig cheaply you’ll be able to get a lot more out of your solar panels. That’s because they work best when the sun’s rays are hitting them perpendicular to the surface and not at an angle. [Michael Davis] hit both of those stipulations with this mbed powered solar tracker.

At a garage sale he picked up an antenna motor for just $15. The thing was very old, but still wrapped in the original plastic. It’s beefy enough to move his panels, but he first needed a way to mount everything. After checking his angles he built a base out of wood and used galvanized water pipe as an axle. Cable clamps mate his aluminum angle bracket frame to the pipe. This frame holds the panels securely.

To track the sun he used two smaller cells which aren’t easy to pick out in this image. They are monitored by the mbed microcontroller which measures their output in order to point the assembly in the direction which has the most intense light. A couple of limit switches are included to stop the assembly when it reaches either side.

This technique of using small solar cells as the tracking sensors seems to work well. Here’s another project that took that approach.

[Read more...]

Gas, Water, and Electricity monitoring

???????????????????????????????

From the look of this you can tell that [Jasper Sikken] has some pretty interesting stuff going on to monitor the utilities in his home. But it’s important to note that this is a rental home. So adding sensors to the gas, water, and electric meters had to be done without making any type of permanent changes.

The module above is his own base PCB which accepts an mbed board to harvest and report on usage. His electric meter has an LED that will flash for every Watt hour that is used. He monitors that with a light dependent resistor, crafting a clever way to fasten it to the meter using four magnets. The water meter has a disc that makes one revolution for each liter of water that passes through it. Half of the disc is reflective so he uses a photoreflective sensor to keep track of that. And finally the gas meter has a reflective digit on one of the wheels. The sensor tracks each time this digit passes by, signifying 10 liters of gas used. He also monitors temperature which we’re sure comes in handy when trying to make sense of the data.

[Thanks Stephen]

 

Text editor running on your ARM project

bare-metal-elua-text-editor

Tired of flashing your embedded project over and over just to tweak a few values? So was [Karl], so he wrote a text editor that runs on his ARM dev board.

Having trouble wrapping your mind around the need for this kind of thing? He’s actually playing around with eLua, the embedded version of the Lua programming language. In this case the program files are being stored on an SD card. But still, moving that back and forth between computer and embedded project gets old quickly. So he invested the time to write a rudimentary text editor that he interfaces through this terminal window. Above you can see the help screen which lays out all of the applications features. Right now it sounds like the only gotcha for this is the amount of RAM it needs to run. As it stands, the editor will now work an mbed board, but it works just fine on an STM Discovery.

Bringing eLua to the mbed

lua

[Karl] loved his mbed – a tiny little ARM-powered microcontroller platform – but he wanted an interactive programming environment. BASIC just wasn’t cutting it, so he decided to bring eLua to his mbed.

When choosing an interactive development environment for microcontrollers, you generally have two choices: old or huge. Sure, there is a middle ground with Python on an ARM, but why not use something explicitly designed for microcontrollers?

To get eLua running on his mbed, [Karl] downloaded the latest version and plopped it on his mbed. The current version, 0.9, doesn’t have support for an SD card, severely limiting its usefulness. [Karl] got around this by wiring up an SD card to the mbed, giving him gigabytes of space for all his development work.

While the AVRs and PICs of the world are stuck with languages like C or worse, the new ARM boards available are more than capable of running a complete eLua development environment, with everything accessible through a terminal. [Karl] even wrote his own editor for the mbed and he’ll shortly be working on a few dozen embedded projects he has in mind.

Building a blink based input device

OLYMPUS DIGITAL CAMERA

Fans of the AMC show Breaking Bad will remember the Original Gangsta [Hector Salamanca]. When first introduced to the story he communicates by ringing a bell. But after being moved to a nursing home he communicates by spelling out messages with the assistance of a nurse who holds up a card with columns and rows of letters. This hack automates that task, trading the human assistant for a blink-based input system.

[Bob Stone] calls the project BlinkTalk. The user wears a Neurosky Mindwave Mobile headset. This measures brainwaves using EEG. He connects the headset to an mBed microcontroller using a BlueSMiRF Bluetooth board. The microcontroller processes the EEG data to establish when the user blinks their eyes.

The LCD screen first scrolls down each row of the displayed letters and numbers. When the appropriate row is highlighted a blink will start scrolling through the columns until a second blink selects the appropriate character. Once the message has been spelled out the “SAY!” menu item causes the Emic2 module to turn the text into speech.

If you think you could build something like this to help the disabled, you should check out thecontrollerproject.com where builders are connected with people in need.

[Read more...]

Python frontend is a GUI for different microcontrollers

python-frontend-gui-for-microcontrollers

[Navin] has been hard at work producing a GUI which works with different micocontrollers. The idea is to make it even easier to develop projects by simplifying the feedback and control you can get from the prototyping hardware. The best part about it is that he designed the software to interface with any hardware which can be programmed in C++.

The screenshot above shows the program communicating with an mbed board which has an ARM microcontroller. But the Arduino board (which uses an ATmega chip) is supported as well. Support for additional architectures can be added by writing your own configuration file for the chip. The Python program then asks for the com port it should be using for this session.

The source package, including the code which runs on the microcontrollers, can be found at the project repository. The functions used in the sketches are quite simple and should be a snap to drop into your own code projects.

Follow

Get every new post delivered to your Inbox.

Join 92,295 other followers