An other Start Here inspired robot

Hi all,

Here is my first robot using a micro-controller ! I started with the Start Here guide and it evolves a bit. I rewrote the code, it might not be as good as the orginal, but it was the best way to understand how it works !

So, this robot simply wanders around, avoid obstacles and detects when it gets too close of an edge (and randomly, change direction). A piezo speaker and 2 Leds help this little guy to communicate with the outside world ;)

The code is attached. There's a bit of "dead code", I had planned to build a robot kinda "schizophrenic" : it would change his behaviour randomly and/or on some events (I am not sure I'll add that, I have an other robot in mind ;)

I had a little problem with cables from the SRF05: they always got detached after a few seconds when the servo's head was moving. So I made a support to keep them in place.

SRF05 support for cables from behind

SRF05 support for cables

The edges sensor (a Sharp IR sensor), its angle can easily be modified

View from behind

A micro-switch turns on/off the robot. The piezo speaker is screwed under the top plexi panel.

The 2 leds

I used 2 ball casters to stabilize the robot better

And here it is :)

It wanders around, avoid obstables and dosent' fell from edges

  • Actuators / output devices: 2 geared motors, a couple of LEDs, piezo speaker
  • Control method: autonomous
  • CPU: Picaxe 28x1
  • Power source: 4x AA (1.2V)
  • Programming language: Picaxe basic
  • Sensors / input devices: SRF05, 1 Sharp InfraRed Sensor
  • Target environment: indoor

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/an-other-start-here-inspired-robot

Nice small bot~

Nice small bot~

Hi, I like your robot,fast

Hi, I like your robot,fast and good looking too. I should try to add on a few outputs too on my robot. I will take a look at your code,thanks for sharing. :slight_smile:

Thanks ! :slight_smile:

Thanks ! :slight_smile:

Thanks for the encouragement

Thanks for the encouragement ! Outputs are very easy to add and give a little more personality to your robot :slight_smile:

nice one

nice one

Yes I agree with you my

Yes I agree with you my friend,I like sound on robots. I will get a piezo,will it be connected directly to the output pin and ground,or it needs other components to work? Got one with 3 wires but it doesn’t seem to work,since I got it many years ago.

I only have 2 wires on my

I only have 2 wires on my piezo. It is connected to the outpin threw a 330 Ohms resistor (if you are using the same resistor array than the one from the Start Here, you already have what you need :slight_smile: and to ground.

Yes I do have the array,so

Yes I do have the array,so it will be great then. Thanks again :slight_smile:

The ultrasonic and Sharp seems to work fine together,no conflics in the code and electronicaly. Thanks for your fast answer.

100$ ?

Does that include the 2 bottles of scotch? :wink:

Excellent question !

Unfortunately, it doesn’t. But I would hope so :wink:

Frame

What materials did you use for the frame? Acrylic and ordinary hardware? Where did you get those items?

Yes, exactly

Yes, exactly : acrylic from a larger panel cut with an handsaw and ordinary hardware. Frame parts come from a big hardware shop.

I ordered the rest (electronical stuff, motors and wheels) from a french online shop (since I live in France :wink: : http://www.gotronic.fr

Hey my friend, I’ve

Hey my friend, I’ve programmed my tracks robot with your code, installed an IR sensor in front beaming the floor at a 45 deg and also the 2 leds ;)  Works fine but I have to work on the code because the robot gets into the same patern in front of a wall and he can’t take the right decision moving left and right for a while… Since programming is not so easy for me,if you can give me a hint where to look at inside the code,i would appreciate it. Thanks.

I’m honored…

I’m honored you tried my code on your robot… especially if it worked :wink:

The algorithm is far from being perfect, I wrote it in one night and stopped as soon as I had something acceptable :wink: So it can definitely be improve ! A few leads you could follow :

- when an obstacle get too close (“dangerDistance” in the code), check both side to choose which one is the better instead of going backward and turning right. Or you could make a random choice of the direction to go, like I did when an edge is detected :

        gosub GetRandomValue
        randomValue = randomValue % 2
        if randomValue = 0 then : gosub TurnRight : else : gosub TurnLeft : endif
        pause rotationDuration

I didn’t implement that because the robot would have to stop in order to check each side, and I wanted it to be always moving.

- you could add some more random choices, it would give the robot an impredictive behaviour

Anyway, I let you find great ideas ! All the code dedicated to make decision in front of an obstacle is in the “AnalyseCurious” method : firstly the robot check for any edges, then it checked for obstacles and take a decision according to the current distance (if  the mesured distance is less or equal to the “dangerdistance”, it goes backward and turn right, if the mesured distance is greater than the “dangerdistance” and lesser than the “avoidingdistance”, it softly turns to the opposite direction of the servo’s position).

Knowing that, you can change values for “dangerdistance” and “avoidingdistance”, add new constants etc. !

Good luck ! :slight_smile:

Hello my friend :slight_smile:

Thank a lot for you kind answer,I appreciate.  Also “merci” for your hint on the code modification,I will try to make some changes and give a try. I wanted to create my own tone sound but I have an alarm system 12v piezo,it wont produce all the frequencies that I need. Will let you know what happen next. Take care my friend and I’ll keep track on your progres too. You are a great inventor.

Good luck too!  :slight_smile:

**hey !!! i’m small but i’m responsive :slight_smile: **

hi LordGG ,

Very cool your small bot, and very responsive !

I like the use of ultrasonic sensor on a servomotor : it’s like the white rabbit alway late and a little paranoiac (is there something here, and here, …) lol

Thanks MoX !

Thanks MoX ! Yeah, he’s a bit nervous :wink:

The LED’s

I really like the design of the LED’s you used. Where could I purchase some like that?

I like your robot… and

I like your robot… and your choice of obstacles.