Xtreme STEM
DashX

RoboBloX

BatBlock

BatBlock

Bats use sonar (echo location) to detect objects, now your robot can too

Theory

  • Sonar and sonic are other words for sound. Ultra-sonic are sounds above what humans can hear.

    The BatBlock has a speaker and a microphone (they look the same).
    The metal can on the right (with the T next to it) is the Transmitter (speaker).
    The metal can on the left (with the R next to it) is the Reciever (mic).

    The ultrasonic sensor sends out a very high frequency sound wave (that we can't hear). It then waits until that sound bounces off an object and returns to the sensor. Using a microphone it listens for the sound. It can then measure the time it took the sound to bounce off an object and return. Since we know sound travels about 345m/s the BrainBlock can calculate how far away the object is from the time it took.


Assembly

  1. Materials Required


    BatBlock 2x2
    1 - Ultrasonic sensor
    1 - Brick (2x2) with notches
    1 - Cable (4 wire)
  2. 2x2sandpaperq-tip
    Sand the top of the 2x3 "black" brick
    Acetone the top of the 2x3 "black" brick
  3. q-tip
    Acetone the back-side of the circuit board
    where the 2x2 brick will be glued
  4. Bad
    Wrong


    Good
    Correct


    Make sure the brick lines up like the picture.
    If it is turned sideways it will not fit correctly.
  5. 2x2
    Place 4 drops of Super Glue on the bumps of the 2x2 brick
  6. Good
    Place the brick on the back of the circuit board.
  7. clock
    Press firmly (but not too hard) together for at least 1 minute.
    Do not wiggle, move, slide any part of the assembly while gluing.
    Wait another 5 minutes before using the block.
  8. BatBlockBack
    You're Done!
    Your BatBlock should look like this.

 

Connection Diagram

  • The BatBlock needs power from V and G
    The 2 signal wires can be connected to any 2 digital pins.

    Wire

 

mBlock

  • Hints

    sonic
    Each time you click on this block it will read the sensor and show you a number above the block.
    This is the number of cm away the object is.
  • mblock
    So you don't have to keep clicking on the block, you can put it in a loop, and have a sprite "say" the distance.
  • Example

    Flappy
    Click on the picture to download the example

    Use your BatBlock to control how high flappy flies as you guide him past the poles.

    Credit to gotrhythm for the original Scratch project
  • Advanced

    When the sensor doesn't see an object it may return 0 or a large number (over 200).
    You need to be careful to deal with both a large number and a zero in your program.

Scroll to Top