Dec 23, 2012

LEGOtiny

After my last Mini RC Car project I knew I wanted to make a smaller better one.  Some months later and this is the result:


The reason why this one is in a LEGO body is because of this question on LEGO Stack Exchange where it was asked if it was possible to power the small LEGO City wheels.  At that point I had already started playing with micro DC motors and I also started using the ATtiny chip.  This was a perfect storm.  I had to build a super small LEGO vehicle.

Here are all the parts needed to make this build:


  • Set of gears from a race track car
  • LEGO wheels set
  • LEGO brick 2x2
  • Micro motor
  • 0.1uf capacitor
  • Transistor
  • Diode
  • ATtiny
  • Socket
  • Power adaptor
I'll go over the small details in an Instructables ASAP.  For now here's shot from the inside:


Here's a video where I show the final result:





Dec 18, 2012

Jumping on board

Here his a 'how-to' for running two low voltage (3.3V) micro controllers on a breadboard.

The first one is the chip(s) used with the TI LaunchPad. I've tested this setup with the MSP430G2211 and the MSP430G2231. The chip will run at 3.3V and is rated up to 3.6V.


This setup needs a 100nf capacitor between pins 1 and 14, then pin 10 needs to be connected to positive using a 47k resistor.  I use the LaunchPad board to program the chip before transferring it to the breadboard and this is pure laziness since there must be a way to program it in place.




The second one is the ATtiny (in this case the Attiny13) which can run the same code as the Arduino (ATmega328) and can be programmed using the Arduino IDE and uploaded using the Arduino board as an ISP for ATtiny.  You will find all kind  of help online for using the ATtiny13, ATtiny45, ATtiny85, ATtiny44 or ATtiny84.


The chip will run at 3.3V or 5V.  As you can see by this diagram, this is the most simple one to use.  No crystal and no resistor are necessary for running it.


Oct 16, 2012

His First Robot


We just finished this project so a created a page just for it.


This is a 5 hours project with my son Gérémy (7 years old at the time) who showed interest in doing some robotic using our old LEGO Mindstorm by building an RC car and wanted to build the RCX line following robot described in the Mindstorm books[...]


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

Feb 15, 2012

NASA != Marketing (rant)

In case you didn't know NASA is still there.  Thanks to our Russian partners we can still go to the Space Station where there was, today, an amazing display of supper high-tech showmanship from NASA.  A man shook a robot hand.


Yes you read it right.  A man (take the time to let it sink in) shook the hand (I know you think I'm going to say man but wait) of a robot.  Wow.

I'm personally a big fan of space exploration and robotic and I think that Robonaut2 will do great things.  It will at least pave the way for this kind of technology. But seriously NASA, can you make anything look cool for the average Joe?  If you can't picture the moment, here the scenario: Without the camera even moving, two guys (astronaut) float behind the Robot (which is not moving) and, after what seams to be a endless speech,  proceed to shake the hand of the robot who, for that special 3 seconds, moved 8 inches (toward the astronaut knee instead of the hand). There's a thing about good presentation: it's called practice.  Or you can you can do it live if what you're doing is so incredibly amazing that fumbling doesn't matter.

How about rock paper scissors? Even better, how about rock paper scissors lizard Spock?  If an Apollo astronaut would have been  at the control of the robot, I bet he would have done something cool.

Oh Internet, help me compile a list of  'The thing that NASA should have done as the first Robot-Human interaction'. Not a joke list but something that's worth showing the kids, something memorable.  And um... let's  try to stay politically correct please. (Comment here or use the hash tag #rb2firstmove on twitter)

I'll compile the list here:
  •  Rock paper scissors lizard Spock
  •  Thumb War
  •  Brake-dancing robot moves and arms wave
  • (your idea goes here)

Feb 14, 2012

Mini RC Car - Part 3

A few bumps in the road...continuing the Mini RC Car build.


First I decided to get rid of the variable voltage regulator.  It was causing all kinds of problems mostly because I'm using a 3.7v power source.  Anyway the Arduino runs fine for now and I have some 3.3v regulators coming through mail pretty soon.

A glitch never comes alone but I'm lucky since the next problem was simple. The DC motor is creating noise feedbacks that are confusing the servo.  That one is an easy fix by adding a 0.1uf capacitor on the motor.

The third one is a show stopper. Or maybe I should say 'a show slower'.  The cellphone battery I'm using is not strong enough for this whole operation.  It's a 3.7v 850ma LiPo cell.  I have to power the Arduino, the BlueSmirf Bluetooth board, the servo and the DC motor which is done using a transistor.  I guess I should have done some calculations first.

Soooo, I'll get to that and I'll order the right battery.  Until then, PAUSE on this project.   Mmmmm, that gives me an opportunity to start another thing.  Muha ha ha ha ha

To view the whole project, go here

Feb 11, 2012

Mini RC Car - Part 2

...continuing the Mini RC Car build.

To attach the steering servo, I drilled holes in the frame and bolted the two together.


I then hot-glued the front frame to the rear half, making sure I had enough ground clearance and all 4 tires on the ground.

The next step was creating a board that would support the Arduino chip, a socket for the bluetooth breakout board, the 3.3v voltage regulator and a socket for the servo connector.  Here's the prototype:


After a bit of soldering, here what I have so far:


Now that I have all the main components, I'll do the final assembly and start programming the on-board Arduino code and the Android controller app.

To view the whole project, go here

Feb 9, 2012

Mini RC Car - Part 1

While cleaning up the basement, we came up on that old electric racetrack and finally decided to get rid of that thing.  Of course I kept all the electrical circuitry and the kids kept the cars to play with.


Since I needed another project to start to justify not working on all the important stuff, I decide to re-purpose one of those car into a mini RC car that I would control using my Android phone. Communication will be done through bluethooth which I tested earlier.

My first test was to control the motor using an ATtiny13 Micro-controller.  This chip uses the same code as Arduino but has only 8 pins.  I powered the assembly using a LiPo battery from a dead cellphone.


I started by cutting the frame in two and hot glued a micro servo on the front part.


I then used a PC card slot-cover and bended it into a frame that would join the two half.

To view the whole project, go here

Jan 29, 2012

DIY Proto board

With the Arduino board, I'm using the proto shields very often. It all sounds good with the exception that I often have many ongoing projects and only two proto shields. On top of that I would like to start using the ATtiny and not only the Atmega328 and the UNO board is not made for the ATtiny.

The solution? Make my how proto board of course!

I wanted the board to be compact but still contain a mini breadboard so I decided to used one half of a mini breadboard.


To make things convenient, I also wanted to use a ZIF socket to easily change the micro-controller chip(s). Here are all the parts before assembly:


Part list:
1: ZIF socket 28 pin (~$2.95)
2: 8 pin female header (~$0.50 2x)
2: 6 pin female header (~$0.50 2x)
1: 5 pin female header (~$0.50)
1: 4 pin female header (~$0.50)
1: 16MHz Crystal (~$0.95)
1: Mini breadboard (~$3.95)
2: Capacitor Ceramic 0.1uF (~$0.25 2x)
2: Electrolytic Capacitors - 100uF (~$0.35 2x)
1: Voltage Regulator – 5V (~$1.25)
1: 9V Snap Connector (~$1.25)
1: PCB board (~$1.25)
+ some wires for connecting the components.

Total cost: ~$16.0

Here's the final product.


I'm pretty happy with it because it's small, it doesn't need a separate proto shield, I can use it with either 1 Atmega328 or 1-2 ATtiny(s) and the ZIF socket makes things a lot easier when switching chips.

Jan 24, 2012

Non-Accountability Platform

Everybody is talking about platforms. Here a platform, there a platform, everywhere a platform. Don't get me wrong, I love platforms but I'm not so sure that accountability is following at the same pace.

I suspect a trend might develop, if it's not already here. Some platform developers can say anything they want about the “supposed” capacities of their platform and the application developers will get the heat of any short comings.


Here's a typical situation that explains the problem: Company A promises a platform that will do X, Y and Z. Developer D starts making product on the evolving platform with features dependant on the eventual existence of X, Y and Z. Company A delivers X on time but delivers Y too late forcing overtime on Developer D, resulting in bad feature integration. Also, in good measure, Company A doesn't even bother delivering Z which is part of a central feature of Developer D's future product. The fun part is that Company A doesn't have to publicly announce its short coming(s) because people will blame the developers for 'not using the platform the right way'. The only point of comparison for the public is the original 'promise' of the platform and, since the BIG company didn't change the specs, it must be the small developer's fault.

For contractual reasons, the developers can't say much in a situation like that, so they bite the bullet secretly dreaming of a magical land where truth and honor means something.

So... dear platform developers, please do these two simple things:

  • Don't promise impossible things
  • Publicly come clean with the 'real' specs and defend the developers

Jan 15, 2012

Arduino and Micro-SD logging

Getting started with Adafruit's Micro-SD Breakout Board in 2 minutes.

Wiring
Wiring the Breakout board is very simple.
  • Connect the 5v pin to the 5V pin on the Arduino
  • Connect the GND pin to one of the three GND pin on the Arduino
  • Connect CLK to pin 13
  • Connect DO to pin 12
  • Connect DI to pin 11
  • Connect CS to pin 10


Picture shamelessly taken from its home at adafruit.com

Programming
To use the Micro-SD you need to include the SD.h library at the top of your program.  Then add the following line of code to your setup() function:

SD.begin(10);

Now you can write something on the card:

File logFile = SD.open("log.txt",FILE_WRITE);

if(logFile){
   logFile.println(“Hello World!”);
   logFile.close();
}

Finally, while humming the MissionImpossible theme, you can power off the Arduino board, take the Micro-SD card out, put the micro-SD card in an SD card adaptor, put the SD card adaptor in your laptop and look at your new file.

Muha ha ha ha ha.

Note: I used this in my last arduino/bluetooth project.   

Arduino Bluetooth Link


In a previous Arduino project, I used the BlueSmirf Bluetooth Breakout Board to communicate with my Android phone. There was absolutely no special code on the Arduino to handle Bluetooth since, by default, the BlueSmirf is set as Slave and will accept any connection call. The phone app was doing all the work.

The next logical step was to use the BlueSmirf interface by programming the Arduino. Using a second Bluetooth board, I decided to create a link between two autonomous Arduinos. To make things interesting, I've set a couple of rules for the project. I wanted to heave the same code on both Arduinos and have the whole connection process be automatic. I also wanted the Master device to scan for other devices, retrieve the MAC address, connect and send data.  Here's the video of the final result:



My biggest issue started with the Sparkfun proto shield for Arduino. It has a built-in socket for their Bluesmirf device. Nice marketing move! This socket is hardwired to use the Arduino pins 0 and 1 for communications. It all looks good until you need to use it in the real world. Here are the pros and cons:

Pros:

  • No wiring needed to connect the Bluesmirf board.
  • No extra library needed to do serial communications.

Cons:

  • You must remove the Bluesmirf breakout board every time you need to plug the Arduino board in the computer. Why? Because of the hardwired Bluesmirf socket the Arduino board communications are mixed with the Bluesmirf interface.
  • Another consequence of the previous problem: You can't used the USB serial output to the computer to send debug info. That is really annoying when debugging your project.
  • The power is always ON for the Bluesmirf.

I'll fix this by using different pins for the Bluetooth communication using the NewSoftSerial library. I will also modify the Sparkfun Bluesmirf socket to use any communication pins and to have control on the power usage.

For more details continue reading after the break. (Warning! Geeky stuff about code and electronics)