Introduction: Fish Feeder

Picture of Fish Feeder

This article is from tinkercademy, you can see the link here :

https://tinkercademy.com/tutorials/fish-feeder/. Tired of feeding your fish by hand? Here’s the micro:bit project for you! In this course, we will use a ADKeypad to control the motion of a servo to feed fish.

Note:
For more funny creation, you can pay attention to : http://www.elecfreaks.com/

Our product store: http://www.elecfreaks.com/estore/

Step 1: Pre-build Overview

Picture of Pre-build Overview

In this project, we are going to create a fish feeding machine. The movement of the servo will be controlled by the two red buttons on the ADKeypad and the OLED will display a message showing the status of the servo.

Step 2: Materials:

1 x BBC micro:bit,

1 x Micro USB cable

1 x Breakout board

1 x ADKeypad

1 x OLED

1 x Servo

Wires

Step 3: Goals:

Picture of Goals:

1. Get to know the ADKeypad, OLED and servo

2. Make something with a servo

3. Make something with a OLED

Step 4: Components

Picture of Components

Insert the micro:bit into the Breakout Board and plug in the micro USB cable, then plug in the OLED as shown in the picture above. You should be able to plug it into any of the three rows

Step 5: Connection

Picture of Connection

Connect the ADKeypad to Pin 0 and the servo to Pin 1. Make sure the colour of the wire matches the colour of the pins on the Breakout Board.

Step 6: ​Pre-coding

Picture of ​Pre-coding

We will add a package of code to enable us to use our kit components. Click on Advanced in the Code Drawer to see more code section and look at the bottom of the Code Drawer for Add Package.

Step 7: Add Package

Picture of Add Package

This will open up a dialog box. Copy and paste the following link into the Add Package… text field: https://pxt.microbit.org/50544-64675-33322-24641. Click on the search icon or press enter, then click on the Tinkercademy button.

Note: If you get a warning telling you some packages will be removed because of incompatibility issues, either follow the prompts or create a new project in the Projects file menu.

Step 8: Coding

Picture of Coding

Click on Tinkercademy inside the Code Drawer to find our custom blocks for the various components in your kit.

Step 9: Initialize OLED

Picture of Initialize OLED

You should always initialize the OLED at the beginning. 64 and 128 represent the height and width of the OLED respectively.

Step 10: Choose "else-if"

Picture of Choose "else-if"

Since there are only two conditions, we need only one ‘else-if’ statement.

If the button A of the ADKeypad is pressed, the servo will turn to angle 70 and the OLED will display “Loading food“. Or else,if button B of the ADKeypad is pressed, the servo will turn to angle 20 and the OLED will display “Feeding the fish“. You can adjust the servo angle to suit your requirement.

Step 11: Succeed

Picture of Succeed

Voilà! You have created a fish feeding machine! Try to find a fish pot and see how it works.Let's do it!

Note:
For more funny creation, you can pay attention to : http://www.elecfreaks.com/

Our product store: http://www.elecfreaks.com/estore/

Comments

About This Instructable

794views

11favorites

Bio: Email: louise@elecfreaks.com
More by RayM81:Make a Burglar Alarm Device With Micro:bitArduino Digital Tube Display ExperimentMicro:bit Fundamental Course: Touch Button
Add instructable to: