Showing posts with label chassis. Show all posts
Showing posts with label chassis. Show all posts

Tuesday, May 7, 2019

Some tips on using the Smart 2 Wheel Arduino Robot chassis

I'm a big fan of these basic 2 wheel chassis.  They're cheap to buy.  I've seen them on eBay for less than £6.00 without the batter holder.  There is enough space on them an Arduino or PiZero with a motor controller alongside the battery pack.
2 wheel smart robot chassis
They're usually listed as "2 Wheel Smart Robot" with the word Arduino added in there somewhere even thought they are not Arduino specific.  I think it's there to improve SEO for all the people making their first robot using an Arduinio.  Also, they are not smart, there is no intelligence provided.  They usually come with  tachometer encoders for the wheels, but you need extra electronics to read them.

I've used these chassis a few times and these are some gotchas that I'd to figure out.

1. The perspex is clear
If the perspex is opaque or brown in colour then this is a layer that can be pealed off.  It's there to protect the perspex.  You can leave it on but it's supposed to come off.

2.  The caster goes to the back.
Even though most of the pictures you see show the caster wheel at the front this is really a drag wheel and should be at the back of the bot.
The fact the caster spins means if it is put at the front then you're pushing against the caster when turning.  It's like having a wobbly shopping trolley.  Easier to pull behind you than push in front. Also, you can see from the image the (correct) front has more mounting options for sensors which makes sense.

3.  The battery box can be screwed on the underside
All pictures I've seen always have the AA battery box on the top.  Makes sense as gravity will keep the batteries in.  But, if needed the battery box can be screwed to the underside of the deck giving more real estate on the top for other components.

4.  The connections on the motors are very fragile
Where you solder the wires to the motors is very fragile and prone to snapping off if put under any strain.  So, it's best to put in place some strain relief.
The easiest and without needing any additional hardware is to knot the two wires around the plastic fastener holding the motor in place.  In this way if someone pulls on a wire or it gets snagged it doesn't put any pressure on the actual connection on the motor.

Strain relief on the motor wiring

Some final thoughts

I've used these motors with L298N as well as L9110s motor controllers.  Both work great.  The L298N is bigger and really over specced for these little motors so the L9110s is more than capable of driving them.
The cheap L9110s board only has one GND connection and assuming using a different power supply for the motors and the controller (Pi/Arduino) you'll need to tie the GND from the different power supplies, the controller and the L9110s together.  I usually use one of the additional GND pins on the controller.  Arduino Uno has three GND pins, the Arduino Nano has 2 and the Raspberry Pi has 8.

L9110s - only one GND connection


I've heard reports that as the gears are plastic they can be shredded.  A lot of fast reversing with a decent power supply can put the cogs under a lot of strain.  This is one of the main compromises for the price.  So, either limit the speed at which the motors can change direction or be ready to replace the motors.

These little yellow motors look like they're all the same, but the gearing inside them can be different.  If you do need a replacement motor you may not get the same gearing ratio which would affect the ability of your robot to go in a straight line or just move consistently.

Even with all this I think these kits are a great start.  They're easy to put together.  Reliable (enough), powerful (enough) and cheap so a great place to start.
Add an Arduino Nano and an L9110s with a small breadboard to connect everything together and you have a capable platform to develop from for less than £10.00.
You can then add ultra-sonic sensors, line following sensors, infra-red remote control, Bluetooth interface, or even the tachometers to measure speed and lots more...
Giving an easy and cost effective introduction to robots.
This may not be the chassis you finish with but it's definitely a good place to start.
And if you're already thinking of upgrades there is a 4 wheeled version as well for not much more.

4 Wheel Smart Chassis

Happy roboting.








Wednesday, February 4, 2015

Robot Club - fourth session completed


Link to Preparing post details in the parts in the kits.: http://winkleink.blogspot.co.uk/2014/11/preparing-for-2015-after-school.html

Link to First session; http://winkleink.blogspot.co.uk/2015/01/robot-club-first-session-completed.html

Note; I did not post for the second session. There is a short summary in the Third Session post.
Link to Third session: http://winkleink.blogspot.co.uk/2015/01/robot-club-third-session-completed.html

This week we nearly had a full house.
Only 1 child missing due to illness.

The 4 who attended the previous week remember a lot of their work and code so were getting stuck into getting their robots to go around a corner.

I had a bit more fun getting drivers on enough school PCs to permit the Arduino Nano to be seen. It needs custom USB/Serial drivers that are not included by default.

The teacher who is ICT coordinator came in to see the session in full swing with robots spinning, or moving along the floor. With coding going on and due to plus and minus lines on the batteries being shorted a nice little display of black smoke and the lovely smell of burnt plastic.
No real harm done just a jumper wires plastic sleeving was melted.
I congratulated the child on making smoke as it's something we all do when we work with electronics.  They were kind of shocked.
It was great that the teacher had the same attitude so no harm done and no concern about burning down the school.
I tested their robot kit and Arduino. Nothing damaged, amazingly so did a little bit of rewiring and handed them back their robot to get working on again.

On of the kids who was in the previous session had a problem where their robot was pulling to the left.  These are small cheap kits so the motors aren't tuned and the wheels are small and have grip meaning they catch on the carpet.  Meaning they cannot reliably go straight.
We tried to fix it by turning the wheels in or our to change the resistance but no go so introduced that child to analogWrite.
A value of 235 seemed to make it all work perfectly. They had a nice straight running robot.

Once again the kids were not that eager to leave as they were perfecting their code and making it better.

At the end one of the girls who was being collected wanted to show her mother what she had done so she gave a great demonstration of her robot.  Holding down reset to stop it moving.
Set it up and let it go. She then explained the code she had made as well as giving details on some of the other parts we will be using.

Next week we will be using an input device. A small line following sensor. I will mark the edge of the room area with white paper providing a contrast with the blue flooring. The idea will be to detect the paper and make the robot turn.
This will be the first time the kids do inputs and will also require the introduction of the 'if' statement.

Looking forward to another productive session next Monday.

Monday, January 12, 2015

Robot Club - first session completed

Link to Previous Post on Preparing for the Club with details on Partner Used: http://winkleink.blogspot.co.uk/2014/11/preparing-for-2015-after-school.html


Today we had the first session of the new robot club I'm running at my kids primary school.
It is for year 6, so 11-12 year olds.

The club is based on the parts from the previous post. http://winkleink.blogspot.co.uk/2014/11/preparing-for-2015-after-school.html

Today the kids came in and there were 3 from last year, so 7 new which is great.
Also, the gender mix is 4 boys and 6 girls.  Sounds very positive from a gender equality then heard the robot club is clashing with football, so expect there are many boys already committed to football.

Still it was a great first session.

The goal for today was to build the chassis.  I wanted to give the kids a bit of a challenge so we worked it out together using the Chinese instructions and my previously built chassis.

A lot of bolts going in the wrong way round and parts in upside down. So, each team had to take their bits apart multiple time.

As we went through the hour I expected the kids to lose heart with the every increasing times they had to remake the chassis.  But, I was delighted that by the end they were very excited to have it built and really wanted to do more.  We had to stop as parents were waiting to collect the kids.

We wired up some of the motors and I showed that since the motors mirror each other than with the motors wired the same way that one wheel goes forward and the other goes backwards with the same red-positive / black-negative wiring.  I explained we can sort this out in code.

The best comment of the day from one of the girls was. "Today is the first time I don't want to leave school."

She was very curious about the 4x4 keypad, so I explained how it works.
Send a signal into each horizontal pin one after another and seeing which pin it comes out at.

Metal Note: try to bring a white board market next time.  Teachers take them away after their classes.


In preparation for next week I have to get all the chassis sorted. One of the motors had the tab ripped off so lucky I have a spare motor.

Then add the L298N H-Bridge and Arduino Nano compatible so coding can start next week.

Goals for next session.
Understand the wiring.
Code to make it go forward, backwards and turn.
Program to go around the centre section in the room.

Roll on next Monday.




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 (http://winkleink.blogspot.co.uk/2014/01/programming-arduino-pro-mini-16mhz-5v.html) and soldering the headers (http://winkleink.blogspot.co.uk/2014/01/soldering-up-pro-mini-arduino.html)

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);

    delay(1000);

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

    delay(1000);

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

    delay(600);

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

    delay(1000);

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

    delay(600);
}



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.