Thursday, July 3, 2014

Paper Marble Run - something different no electronics

I'm a big fan of encouraging creativity with low cost resources. I previously hacked a £6.00 remote control car to control it from a Raspberry Pi using Scratch and used a low cost eBay robot vehicle deck and wheels with a clone Arduino Pro Mini (all in for <£15.00).

Well some people aren't that into electronics and programming but are still looking for creative solutions.

I came across Marble Runs/Roller Coasters that you can buy and did a search online and found you can make you own from copper wire and also from stiff paper (200gsm). Never one to miss a chance to try something new I looked at the videos and made up templates for the paper marble run sections and began construction

After a fair few iterations and a lot of really small pieces of tape to put the bits together I finally had a set of templates that can be used to make a paper marble run.

This is the first video of the marble run. I really like the funnel and also that the marble comes off the end just below the funnel and because the moment is right it drops into the next channel/track section.

There is a fair bit of work in getting it stable and modifying the length of the straights and the curves so they work.  This is real tinkerer construction as the parts are not perfect and the design is evolving so regularly pieces need to be shortened, or bits added or the angle of the track needs to be modified to make it work.
Great fun going through all of this and learning about the properties of the paper, how strong the tape is and how to keep the marble going.

I then extended the run another bit. I like this view. There is something pleasing to me about the curves on the left section.

Finally I added a bumpy track and also a 'ladder' (no idea if that's it's name but it's the name I use) and more curves. This made the whole think a lot taller and works well. It does kind of unbalance the look and style of the overall marble run, so I think it is less pleasing to the eye than the earlier version.  Feels like when a skyscraper adds a large antenna to the top to officially be taller.

Here's the final video of the current Marble Run.

Overall I'm happy with the results and plan to make more runs.  A nice way to spend an afternoon/evening being creative.

Getting back to electronics I'm trying to design a simple marble lift using mainly paper (will need a motor). Onward and upward.

NOTE: If you want a copy of the templates (UK A4) just leave a comment and I'll message back a link.  They were done with Inkscape and my skills aren't the best, so they are a bit rough.

Sunday, April 6, 2014

HC-06 Bluetooth Slave Only

I bought a Bluetooth adaptor from eBay a while back and configured it allow me to login to the Raspberry Pi over Bluetooth.
As part of this I changed some of the settings on the adaptor and like a proper hacker didn't write down the changes anywhere and then lost my code when the Raspberry Pi SD got corrupted and I installed Lubuntu on my netbook (was XP).

After doing a lot of searching online I found details for the HC-05 and how to reset it by setting the Key pin HIGH and putting it into command mode.

After about 5 hours of messing with the adaptor and even noting the Key breadboard pin wasn't connect to the Key pin on the board, so shorted the pads on the back of the board. Then desoldered again

Nothing worked.

Then checked if what I really had was a HC-06. The Slave only version of the HC-05 board and guess what it is an HC-06 board and so the Key HIGH method doesn't work.

Note the little transistor near the header
Haven't seen this on any of the HC-05 modules
Also, on the back of the board there are 2 sets of pads not populated.

But from reading the following Google DOC ( discovered you can reset the HC-06 by setting PIN 11 to LOW on the module.
I did this, cycled the power and now I could connect at 9600.  All good.

I downloaded the Sketch from here:
And it worked.

So, no Master mode (cannot initiate pairing) but it's now working so I can have some proper fun with it.

Sunday, February 23, 2014

Arduino Compatible robot for £15

I was looking for a low cost way of building a vehicle controlled by an Arduino or Raspberry Pi and eBay once again came up with the solutions.

1 x Smart Robot Car Chassis Kit  - £7.60
1 x L298N - £1.86
1 x Arduino Compatible Pro Mini - £2.53

Total Cost: £11.99

The Smart Robot Chassis comes with 2 motors and wheels.  It comes with the encoding wheels for optical encoder to measure rotation, but without the electronics.
All the parts with chassis. 

The L298N is a Motor Driver Module
That's it on the right next to the battery pack

While the Pro Mini is a small Arduino compatible board that I previously blogged about programming ( and soldering the headers (

You need a USB to serial adaptor to program it. For this adaptor you have to solder a pin to the DTR and then attach that to the RST line on the Pro Mini when programming.

I built the Chassis and attached the L298N
All the parts

Bits for the front wheel mounting
Screw the spacers to the chassis

Attach the swivel wheel to the spacers.
Note nuts not in original picture

Parts for motor/wheel mount

Use small screws to attach pillars to chassis

Parts for connecting motors

Screw motor to the outside of the pillars.
Note: make sure to have motor connectors on the inside
for easy cable management

Add the encoder wheels if you want and the actual wheels

See in front of batter holder are the two holes where
the battery holder will be bolted to.
Use 2 of the slightly longer bolts for this.

All finished.  Still needed to solder the wires to the motors.

The L298N is then wired.

+ Battery to VCC and 5V on the L298Nand RAW on the Pro Mini. The L298N appears to be OK with 6V going to the 5V line. And the Pro Mini doesn't complain about the 6V from the batteries either.
As always connect all the GNDs together

Then for each motor connect Out1 and Out2 to one Motor and Out3 and Out4 to the other motor. Depending on which way around you do the connection will decide which way the motors spins, so if this is wrong you can either swap the wires or modify the code.

Then for control from the Pro Mini I connected

IN1 to 3
IN2 to 5
IN3 to 9
IN4 to 10

The eagle eyed will have noticed these are 4 of the PWM lines so in the future I can enable speed control by driving using PWM rather than digital.

Uploaded the following Sketch tot he Pro Mini and let it rip - see video at the bottom

// motor driver using PWM

int lb = 3;
int lf = 5;
int rb = 10;
int rf = 9;

void setup() {
  // put your setup code here, to run once:

  pinMode(lb, OUTPUT); 
  pinMode(lf, OUTPUT); 
  pinMode(rb, OUTPUT); 
  pinMode(rf, OUTPUT); 
  digitalWrite (lb, LOW);
  digitalWrite (lf, LOW);
  digitalWrite (rb, LOW);
  digitalWrite (rf, LOW);


void loop() {
  // put your main code here, to run repeatedly: 
    digitalWrite (lf, HIGH);
    digitalWrite (lb, LOW);
    digitalWrite (rf, HIGH);
    digitalWrite (rb, LOW);


    digitalWrite (lf, LOW);
    digitalWrite (lb, LOW);
    digitalWrite (rf, LOW);
    digitalWrite (rb, LOW);


    digitalWrite (lf, LOW);
    digitalWrite (lb, HIGH);
    digitalWrite (rf, HIGH);
    digitalWrite (rb, LOW);


    digitalWrite (lf, HIGH);
    digitalWrite (lb, LOW);
    digitalWrite (rf, HIGH);
    digitalWrite (rb, LOW);


    digitalWrite (lf, HIGH);
    digitalWrite (lb, LOW);
    digitalWrite (rf, LOW);
    digitalWrite (rb, HIGH);


All worked well.
Next I need to put in place a way of controlling it remotely.
The adventure continues.

Note: This chassis and L298N should also work with a Raspberry Pi. Need to be more careful with the power and a few other bits.