Skip to content

Commit

Permalink
Merge pull request #54 from sourcebots/servo-assembly-kit
Browse files Browse the repository at this point in the history
Servo Assembly hardware documentation
  • Loading branch information
thomasleese authored Dec 16, 2017
2 parents ea3993b + 73f9ec6 commit 1b4b21c
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ square-ish
83x99x24mm
4mm
2.2A.
uno
3.3V
2mm
PyCharm
macOS
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ title: Ultrasound

We noticed many teams used ultrasound sensors to assist the vision system for finer distance measurement. So we've built in the mechanisms for reading and measuring distances using ultrasound right into the kit!

Ultrasound sensors are connected to 2 pins, a _trigger_ pin, and an _echo_ pin. A signal is sent to the sensor on the _trigger_ pin, and the delay on a response on the _echo_ pin can be used to calculate the distance.

{{% notice warning %}}
Ultrasound should only be considered accurate up to around 2 metres, beyond that the signal can become distorted and produce erroneous results.
{{% /notice %}}

## Reading a distance
Assuming you wired the _trigger_ pin to pin 6, and the _echo_ pin to pin 7, you can query the distance from the sensor using:

Expand Down
7 changes: 4 additions & 3 deletions content/kit/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ weight: 1
---

## Boards

Besides the Pi, there are 3 main controller boards to interface with your kit.

| [Motor Board](motor-board) | [Power Board](power-board) | [Servo Assembly](servo-assembly) |
|---|---|---|
| ![Motor Board](/img/kit/mcv4b.png) | ![Power Board](/img/kit/pbv4.png) | Coming Soon! |
| ![Motor Board](/img/kit/mcv4b.png?width=20pc) | ![Power Board](/img/kit/pbv4.png?width=20pc) | ![Servo Assembly](/img/kit/servo-assembly.jpg?width=20pc) |

## Kit Contents

With your kit, you should have the following boards:

| Part | Quantity |
Expand All @@ -20,9 +22,8 @@ With your kit, you should have the following boards:
| [Power Board](power-board) | 1 |
| [Servo Assembly](servo-assembly) (Arduino + Servo Hat) | 1 |



### Additional Parts

In addition to the boards, your kit will also contain:

| Part | Quantity | Specification | Notes |
Expand Down
14 changes: 14 additions & 0 deletions content/kit/servo-assembly/GPIO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: GPIO
---

The arduino allows you to connect your kit to your own electronics. It has 14 digital I/O pins, and 6 analogue. The analogue pins can read an analogue signal from 0 to 5V. The board also has a couple of ground pins, as well as some pins fixed at 3.3V and 5V output.

The pin layout of the servo assembly is the same as an Arduino uno.

![Pin Map](https://raw.githubusercontent.com/Bouni/Arduino-Pinout/master/Arduino%20Uno%20R3%20Pinout.png?width=50pc)


{{% notice note %}}
The servo hat communicates using 2 of the analogue input pins (4 and 5), and so these are reserved. Using these pins will cause the servo hat to behave weirdly.
{{% /notice %}}
18 changes: 18 additions & 0 deletions content/kit/servo-assembly/_index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
---
title: Servo Assembly
---

The servo assembly allows you to control GPIO pins, Analogue pins, and servos. It's comprised of [an arduino](https://store.arduino.cc/arduino-uno-rev3), and a [servo hat](https://learn.adafruit.com/16-channel-pwm-servo-driver/overview).

![Servo Assembly](/img/kit/servo-assembly.jpg?width=30pc)

## The servo hat
The servo hat enables you to control up to 16 servos. It's attached to the top of the arduino, passing through its pins.

## The reset button
The reset button allows you to instantly reboot the arduino in case it isn't working. This is not a guaranteed fix, however may solve the problem.


## Designs
The board diagrams for both the Arduino and hat are below, as long as the custom firmware on the Arduino. You do not need this information to use the board but it may be of interest to some people.

- [Servo Hat Schematic](https://cdn-learn.adafruit.com/assets/assets/000/036/269/original/adafruit_products_schem.png)
- [Arduino Uno Schematic](https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf)
- [Firmware Source](https://github.com/sourcebots/servo-firmware)
8 changes: 8 additions & 0 deletions content/kit/servo-assembly/servos.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
title: Servos
---

By themselves, an Arduino is incapable of driving servos, without a lot of hard work and pin munging. So we're using a hat instead! This hat allows control of 16 servos.

## Connecting your servos
There are a total of 16 servo connectors, grouped into 4 groups of 4. Servo cables are connected with 0V (the black or brown wire) towards the side of the reset button.

## Power
The Arduino itself is powered entirely over USB. If you wish to use servos, you'll need to supply an additional 5V through the connector on the hat from the [power board](/kit/power-board). There are 2 red LEDs next to the power input, but these lights will turn on if the board is correctly powered.
13 changes: 13 additions & 0 deletions content/kit/servo-assembly/ultrasound.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: Ultrasound
---

Ultrasound sensors are a useful way of measuring distance when objects are too close for the [Webcam](/api/webcam) to detect, or if they don't have markers. Ultrasound sensors communicate primarily over 2 pins. A signal is sent to the sensor on the _trigger_ pin, and the delay on a response on the _echo_ pin can be used to calculate the distance.

{{% notice warning %}}
Ultrasound should only be considered accurate up to around 2 metres, beyond that the signal can become distorted and produce erroneous results.
{{% /notice %}}

## Wiring up the sensor
The sensor has 4 pin connections: ground, 5V, _trigger_ and _echo_. Most ultrasound sensors will label which pin is which. The ground and 5V should be wired to the ground and 5V pins of the arduino respectively. The trigger and echo pins should be attached to 2 different digital IO pins. Take note of these 2 pins, you'll need them to [use the sensor](/api/servo-assembly/ultrasound).

{{% notice tip %}}
If the sensor always returns a distance of 0, it means the _trigger_ and _echo_ pins are connected the wrong way! Either change the pins in the code, or swap the connectors.
{{% /notice %}}
Binary file added static/img/kit/servo-assembly.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1b4b21c

Please sign in to comment.