Aug 23, 2012

Control LEDs with Raspberry Pi


Using an old hard drive cable, I built a GPIO breakout cable then proceed to make an LED blink... a classic 'Hello World' of electronics.  I followed this diagram for the connections.


Plug the wires and follow these steps:
  1. Boot the Raspberry Pi
  2. Login as root (embrace your dark side)
  3. Getting ready to output in GPIO4:
  4. $ echo "4" > /sys/class/gpio/export
    $ echo "out" > /sys/class/gpio/gpio4/direction
  5. Turn GPIO4 on:
    $ echo "1" > /sys/class/gpio/gpio4/value
  6. Turn GPIO4 off:
    $ echo "0" > /sys/class/gpio/gpio4/value


Tada!

I'm now using WiringPI c++ library.  Here's a good reference to get started at Limina.Log. And a good pins reference table.

Aug 12, 2012

A new life for RCX 2.0


My LEGO Mindstorm had been unused for years now especially since I started using micro-controllers like BasicStamp and now Arduino. It had a short revival last winter when I used it to build a Star Wars R2-Unit crane for my twins. It was a real success and they played with it for two weeks straight.

Initially I was happy that my RCX was being used again but very puzzled that, after that playing stint, they had not included this new motorized brick into their regular LEGO play. Why? Maybe the cabling or specially the gears were a bit much for their age (7).

Lately my son made yet another awesome LEGO thingy and I told him he could make one part spin if he used the motors. He suddenly looked defeated and told me that “the pump thing is hard”. I finally knew why he was not using the RCX. He thought that the pneumatic system we used when making the crane, was the only way to make a working machine. Happy to enlighten him, I explained that he could use the motors alone and, at that very moment, I saw that his little brain was about to explode with ideas while he ran back to the LEGO boxes. His first creation was this 4 wheeled vehicle with one motor per wheel.


Then he dug up my old LEGO RCX 2.0 Mindstorm book that came with the kit, went through it one evening, found a line-following robot and built it the next day. I heard the perplexity in his voice when he called me saying “It's not working!”. The robot, going in circle, was missing the right code. I told him that building the physical robot was half the job and that it needed a program to tell him what to do. Of course now he wanted us to put the program in the robot.
I didn't want to disappoint him but the last time I pushed code on an RCX brick was in 2001 with a Windows XP computer. The software CD was probably lost in some storage box and, adding to the problem, loading a program must be done using a LEGO Infrared USB device (LEGO USB Tower) which are probably not supported anymore. Or so I thought.

I recovered my LEGO USB Tower and, ready for some major Internet archeology, Googled about LEGO RCX. I quickly found that Not Quite C (NQC) was still going strong. It was the programming language I used 10 years before. Not only that but I found that the LEGO USB Tower was now directly supported into Linux. So I plugged it in and BAM! /dev/usb/legousbtower0. Minutes later I uploaded a test program on the RCX brick and ran it. Victory is ours!


I coded a very simple program to show my son some basic logic in programing and now he's completely shocked by the fact that he can make a full robot, including the code.

I've created a monster and I like it.

More Geek info after the break

May 30, 2012

Mini RC Car - Part 5 (final)


After weeks of 'other things', here is the 5th and final post on the Mini RC Car project.


It's alive!!!

This final configuration works on a single 9v battery. Yes only one power supply because I found the real source of the noise problem coming from the DC motor. Like any good bug it was a code 12 since I assumed that the motor had a capacitor on it... NOT!  Here you can "see" the result.




Parts:
1x racetrack toy car
1x micro servo
1x 9v battery
1x 5v power regulator
1x pn2222 transistor
1x 1N4001 rectifier diode
4x ceramic 0.1uf capacitors
1x 16MHz crystal
1x 28 pin socket
1x 4 pins female headers
1x 3 pins male headers
1 9v snap connector
1 Atmega328
1 BlueSmirf bluetooth breakout board
1 PCB
1 Wires
scrap metal/wood for structure

Tools:
Dremel
Soldering iron
Hot glue gun
Arduino board (e.g. UNO) for programming the chip
Android device with bluetooth


For the maniacs out there I'll probably add this on Instructables where I'll go over all the geeky details.

To view the whole project go here.

Thanks for reading.

May 29, 2012

1 2 3 2 1


Off the top of my head, here's things that greatly influenced me:






For me this was:

Finding inspiration in formulas

Validation that a company can be both technical and artistic
Exponential advance of technology

The start of my love for reading
Confirmation that I will never have enough information about the history of war
My love for mathematics

A geek making a difference
My first first art influence in Ralph McQuarrie

When music grabbed my attention

Feb 21, 2012

Mini RC Car - Part 4

Back on track with 5v...continuing the Mini RC Car build.

So I couldn't wait on my 3.3v voltage regulator.  I decided to switch the car to 5v and use a good old 9v battery.  This is what it looked like when I tested the new power system:


This has to be the ugliest RC car ever made.

After getting over the look of the beast, I now have to do the following:

  • Test the servo
  • Clean up the electronics (there is still some quick prototyping part or assembly)
  • Make a more permanent stack assembly for the battery, power regulator and circuit board.
  • Programme the Arduino and the Android phone (remote)

This shouldn't be too long.  Here's the car running a test with the new power system:



To view the whole project, go here