Informatics Enlightened Station 1 Sunflower

Similar documents
Informatics Enlightened Station 2 Park distance control system

Session 1 Introduction to Data Acquisition and Real-Time Control

Module 4: Traffic Signal Design Lesson 1: Traffic Signal (Arduino) Control System Laboratory Exercise Grade 6-8

ENGR 40M Project 3b: Programming the LED cube

Theory and Practice of Tangible User Interfaces. Thursday Week 3: Analog Input. week. Sensor 1: Potentiometers. Analog input

QTI Line Follower AppKit for the Boe-Bot (#28108)

COLOUR CHANGING USB LAMP KIT

Light Emitting Diodes and Digital Circuits I

LEGO MINDSTORMS PROGRAMMING CAMP. Robotics Programming 101 Camp Curriculum

Experiment 0: Hello, micro:bit!

ELECTRONIC GAME KIT TEACHING RESOURCES. Version 2.0 BUILD YOUR OWN MEMORY & REACTIONS

9/23/2014. Andrew Costin, Tom Syster, Ryan Cramer Advisor: Professor Hack Instructor: Professor Lin May 5 th, 2014

The NXT Big Thing #14

Smart Interface Components. Sketching in Hardware 2 24 June 2007 Tod E. Kurt

First, connect the LED and the resistor, by twisting the wires together.

(Skip to step 11 if you are already familiar with connecting to the Tribot)

Lesson Sequence: S4A (Scratch for Arduino)

Ginger Bread House

E X P E R I M E N T 1

Topic: Instructional David G. Thomas December 23, 2015

Light Emitting Diodes and Digital Circuits I

Experiment 9A: Magnetism/The Oscilloscope

Data Acquisition Using LabVIEW

Defining and Labeling Circuits and Electrical Phasing in PLS-CADD

Dust Sensor using GP Y

Rotary Knife Controller

Digital 1 Final Project Sequential Digital System - Slot Machine

Preface. About SunFounder. About Super Kit. Free Support

Using an oscilloscope - The Hameg 203-6

Physics 120 Lab 10 (2018): Flip-flops and Registers

PCM-24 Press Feed Controller

Revision 1.2d

Complete Train Control. Run Your Trains, Not Your Track!

Interval Preset Switching of the Oscillators in a Moog Prodigy

AKD SYSTEM CONFIGURATION WITH KOLLMORGEN DDL LINEAR MOTORS

PLTW Engineering Digital Electronics Course Outline

COPYRIGHT NOVEMBER-1998

Digital Electronics Course Outline

CATHODE RAY OSCILLOSCOPE. Basic block diagrams Principle of operation Measurement of voltage, current and frequency

Callisto DISEqC Antenna Tracker

AXE101 PICAXE-08M2 Cyberpet Kit

This Unit may form part of a National Qualification Group Award or may be offered on a free standing basis.

Introduction. The Clock Hardware. A Unique LED Clock Article by Craig A. Lindley

Lecture (04) Arduino Microcontroller Programming and interfacing. By: Dr. Ahmed ElShafee

PASS. Professional Audience Safety System. User Manual. Pangolin Laser Systems. November 2O12

DAGON Company Leszno Jackowskiego 24 Street tel DAGON Lighting series SPL-3

Scanning Laser Range Finder Smart-URG mini UST-10LX (UUST003) Specification

MICROMASTER Encoder Module

Visit our Page LaisDcc TM Decoders Manual

MOBILE DEFENDERS : QUALITY GUIDE FEBRUARY 2019 MOBILE DEFENDERS QUALITY GUIDE. Shenzhen, China: Our second home.

Lab Using The Multimeter And The Trainer

The Micropython Microcontroller

Microcontrollers and Interfacing week 7 exercises

Simple Way To Brighten Up A 17 Computer Monitor Picture Tube

If you have any problems please contact our office at Thank You! And Enjoy! Like us on Facebook /AllenLeighSC

Training Note TR-06RD. Schedules. Schedule types

PRACTICAL APPLICATION OF THE PHASED-ARRAY TECHNOLOGY WITH PAINT-BRUSH EVALUATION FOR SEAMLESS-TUBE TESTING

Complete Train Control. Run Your Trains, Not Your Track!

TV Synchronism Generation with PIC Microcontroller

ORM0022 EHPC210 Universal Controller Operation Manual Revision 1. EHPC210 Universal Controller. Operation Manual

ECE-320 Lab 5: Modeling and Controlling a Pendulum

QUIZ BUZZER KIT TEACHING RESOURCES. Version 2.0 WHO ANSWERED FIRST? FIND OUT WITH THIS

Building the ChronoDot Calendar Reminder

Light Emitting Diodes and Digital Circuits I

Lab experience 1: Introduction to LabView

Monday 28 January 2013 Morning

UNIT V 8051 Microcontroller based Systems Design

Wired Troubleshooting Manual

B.Sc. (Computer Science) Part-I Examination, 2010 Computer Programming Fundamental

Ordering Information. Absolute 60-mm-dia. Rotary Encoder E6F-A. High Accuracy and Durability for Automatic Equipment.

Electrical connection

Software vs Hardware Machine Control: Cost and Performance Compared

SRV02-Series. Rotary Pendulum. User Manual

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

Technology Control Technology

EP486 Microcontroller Applications

Cambridge International Examinations Cambridge International General Certificate of Secondary Education

PCM-22 Rotary Knife Controller Operators Manual

Perform in the spotlight

Winmate Communication INC.

Vision Sensor Short Manual

Objectives: Learn how LED displays work Be able to output your name on the display

TV Character Generator

VNS2210 Amplifier & Controller Installation Guide

Digital Ratio Controller

technology T05.2 teach with space MEET THE SENSE HAT Displaying text and images on the Sense HAT LED matrix

E6CP-A. An Absolute Encoder at About the Same Price as an Incremental Encoder. Ideal for robot limit signals. Low-cost Encoder with Diameter of 50 mm

and Re:system MR-Slave Module Dominating Entertainment. Revox of Switzerland.

ACUBRITE 23 SS. Manual. Stainless Steel Chassis 23" LCD Display. Content

DZ143. Z Scale. Mobile Decoder 1.25 Amp/2 Amp Peak 4 FX 3 Functions, 0.5 Amp. Fits Many Z, N and HO Scale Locomotives

Signal Logic Example

Measure the value of water flow using water flow sensor and DC water pump 12 V interfacing with Arduino uno

Arduino Lesson 3. RGB LEDs

Catch or Die! Julia A. and Andrew C. ECE 150 Cooper Union Spring 2010

G5-series AC Servo Drives with Built-in EtherCAT Communications Linear Motor Type

Particle Magic. for the Casablanca Avio and the Casablanca Kron. User s Manual

Character LCDs. Created by lady ada. Last updated on :47:43 AM UTC

Experiment # 4 Counters and Logic Analyzer

A dedicated data acquisition system for ion velocity measurements of laser produced plasmas

S I N E V I B E S FRACTION AUDIO SLICING WORKSTATION

Transcription:

Efficient Sunbathing For a sunflower, it is essential for survival to gather as much sunlight as possible. That is the reason why sunflowers slowly turn towards the brightest spot in the sky. Fig. 1: Sunflowers The same principle also applies to solar cells, so that as much sunlight as possible can be turned into electricity. With the help of these assignment sheets, you will learn how to build your own sunflower and how you can make it turn towards a source of light by combining the right kinds of electronic devices. Fig. 2: Solar energy plant Necessary components The wiring of the sunflower on the Arduino patch panels only includes a handful of components. Besides Arduino and patch panels, you need these items: a brightness sensor, a 100 kω resistor, a Servo motor with a cross top, 3 blue, 2 red, 2 yellow and 2 green cable, and of course a paper sunflower. In addition, you also need a flashlight as a source of light, to test you project. To make you turn your flower purposefully, every device you have to know about. Help you, these exercise sheets can. Fig. 3: Image by Stuart McGhee 1

The lets the sunflower recognize if it is getting brighter or darker and if it is moving to the right (towards the sun) or wrong (away from the sun) direction. Brightness sensor, or rather light resistor The brightness sensor we re using here is actually a resistor, which lets more or less electricity through depending on the light incidence. The more light hits the sensor, the higher the resistance and the less electricity can flow. To measure the resistance, you have to examine the flow of electricity. A digital pin can only identify if electricity is running (HIGH) or not (LOW), but not how much, so they won t help us a lot in this case. That is why we need the analog pins. Necessary components You need the following components to test the brightness sensor: a 100 kω resistor a brightness sensor 2 blue, 1 red und 1 yellow cable Look at the graphics and the image. There you can see what your wiring should look like in the end. The circuit is similar to the one you did for the LED. However, you need an additional cable between resistor and brightness sensor which is connected to an analog pin. Now you can start programming and working with the brightness sensor. The following steps will help you understand how to identify which signals arrive at an analog pin using the serial monitor. Fig. 4: Complete wiring Fig. 5: Complete wiring (Fritzing) 2

1. Open a new Arduino sketch and save it under a reasonable name. 2. Create the default structure, which you know from the introduction. 3. First, you need to set up all the variables that you need in the settings section. Give them reasonable names and write them down in the box below. [Note: Even though the pins are called A0, A1, etc., you only use the number in your sketch!] You need a. an -variable for the pin that you used for the brightness sensor. The value of the variable has to be the number of your analog pin. b. an -variable, which will save a number for the brightness, in this case 0. 4. You first have to start the serial monitor in. If you don t know how that is done anymore, just have another look at the introductory project. Analog pins are usually used as an input, so you don t need to specify any pin mode and the can stay as it is. 5. In (), you can read out the analog pin and save the content of your brightness variable from 3.b): 6. You should display the brightness variable in the. 7. The program will measure and display the numbers too quickly. That is why, you should add a, so that you can follow the serial monitor. Don t forget: 8. Now you can start the test. You will probably have to resolve some slips. Those happen to most of us, but they are usually spotted during the testing phase. Start your program and then open the. If the numbers are still appearing too quickly, increase the value. Does a small value 9. Illuminate the head of the brightness sensor and watch the mean bright or dark? values displayed on the serial monitor. Shield the sensor with your hand or a piece of paper. Write down the results in the box below. [Note: In reality, it s never equally bright. That is why your measurements will vary a little bit..] dark: high values low values bright: high values low values 3

Now you know the scale of the values of the brightness sensor and you can tell whether it is bright or dark. But the flower needs to know if it is getting darker or brighter. You can use an variable which can save the old brightness value and an -command that checks whether the current brightness value is higher or lower than the old one. 1. Create a new -variable in the settings, which will later < >: save the old brightness value. Give it an appropriate name and the start value 0. 2. At the end of the, save the measured brightness value in the new variable: This way you can save the current value as an old brightness value and it can be used as a comparison in the next run. 3. Now you need an -command which compares the current brightness value with the old one and which tells the serial monitor if it got brighter or darker. You need to use the greater than and less than symbols you know from mathematics: Important: Your program starts at the top and ends at the bottom. Come up with the correct place for your -command yourself, so that it compares the brightness values correctly. 4. Test your program and have a look what happens on the serial monitor. If it s not working, don t worry about it. In that case, just look for the mistake and try to solve it. 5. Save your sketch! You will need it again for your sunflower. Should it be placed before or after the light measurement? Before or after the saving of the brightness value (see 2.)? 4

Very good! You already know how the brightness sensor works and how the program can register changes in brightness. Now you can work on the rotary motion. Necessary components a Servo motor with a cross top 1 blue, 1 red and 1 yellow cable. Don t forget to put on the cross top The will make the sunflower move. This sheet will explain to you how that works. Servo motor A Servo motor is a motor that can turn up to a certain degree. This Servo motor can turn from 0 to 179. Important: You can only tell the motor to turn TO a certain angle. Structure of the wiring You can keep your old wiring, because you will need it again for the sunflower. In the picture below, you can see how the setups look like side by side. 1. Connect your cables with the Servo motor: brown => blue red => red orange => yellow 2. Connect the cable with the Arduino: Fig. 6: Wiring with Servo motor Fig. 7: Wiring with Servo motor (Fritzing) blue => minus ledge red => plus ledge yellow => digital-pin Now you can go ahead and program the Arduino, so that it can steer the motor. You will first learn how to set up the program and then how to move the motor step by step. 5

1. Open a new Arduino sketch and save it under a reasonable name. 2. Create the default structure, which you know form the introduction. 3. Write down. at the very top of your project. That way, you tell the program it should provide all the functions avaivable. This command must be added to the very first line of the program in angle brackets and without a semicolon! 4. You can now add a to your program, which works like adding a variable. With that, you can later use all the different functions. Different from variables, Servos do not get a start value: 5. Just like with all other devices that are controlled, you need an -variable which saves the pin of the servo motor. 6. You have to tell the program in which pin is connected to the Servo by adding this: 7. In you can now move the motor. You can type in and add a random number between 0 and 179 into the brackets. Note: Do not add a. 8. Test your program and look for mistakes if it s not working. 9. Repeat steps 7 and 8 with different numbers and find out where the motor can move to. With larger numbers the motor moves: clockwise counterclockwise Awesome! You now know how the motor can move and what variables you have to use to make the motor turn from 0 to 179. 6

1. Come up with a new -variable, in which you will later save the degree or rather the position of the motor, and give it a reasonable name. Assign the initial value 0 to it. 2. In that position should always increase by 1. A variable can be increased by calling it up, adding a 1 and saving that new value. That might sounds difficult, but it is actually really easy: This new position should be used in your -command, so that your motor can head for its new target. Substitute the value in your -command by the name of your position variable. 3. A loop repetition happens so quickly, that the motor wouldn t have any time to move to the new location. That s why you need a break after (). You should add a. 4. Test your program. 5. Change the value and try again. Repeat that multiple times and complete this rule. If you increase the delay, the motor becomes: slower faster You ve learned how to gradually move the motor to a new position. But you will have probably noticed that the motor stops at 179. Now the motor should slowly move back and forth from 0 to 179. You can solve that problem with the help of some if-commands and a new variable for the movement direction. 7

1. Create an -variable, which should save the direction. If the value is 1, the motor should move clockwise. If the value is -1, the motor should move counterclockwise. Assign to it an initial value of 1. 2. This variable should be added to your position calculation by replacing the +1 with your direction variable: 3. Since the start value is 1, your program should still be working the same as before. The motor should still be turning from 0 to 179. Test that! 4. To make sure the motor changes its direction at the right moment, you have to add two if -commands that set the direction variable to 1 or -1, if the motor turns too far. That should work like this: 5. Test your program. If you did everything correctly, your motor should move back and forth from 0 to 179. 6. Save your sketch! You will need it again for your sunflower. Well done! Now you know everything you need to set up and program a moving sunflower. If you want the orientation of the sunflower to be exact, you have to shield the brightness sensor, so that most of the light really comes from one direction only. Otherwise the brightness sensor is too inaccurate. 8

Necessary components: 2 green cables 1 sunflower pattern Attachment of the sensor 1. Cut out the sunflower, coil up the rectangle and put it through the hole of the sunflower. 2. Take off the brightness sensor from the patch panel. 3. Attach it to the Servo motor by pushing the wires through one of the holes at the opposite arms of the motor. Make sure the wires don t touch each other, otherwise your wiring will not work. 4. Now put the green cables in the same holes, that way, they should stay in place on their own. 5. After that, impose the sunflower on the sensor and on one arm of the servo cross. Structure of the wiring To finish up the sunflower setup, you have to connect the green cables with the holes that you used for the brightness sensor before. Fig.8: Wiring (Fritzing) Functionality of the sunflower Good, now you know everything you need to steer the sunflower. The flower should move in small steps and change its movement direction, if it is getting darker. Otherwise it keeps its movement direction. 9

1. Open a new Servo motor sketch and use the save under function to save it under a reasonable name. That way, you don t have to start all over again but instead you can just expand your existing Servo motor program. Your sunflower is almost done, you re just missing one last thing: 2. Tell the motor to only change its direction, if it is getting darker. Otherwise the direction should be kept. a. Adopt the variables for the brightness value and the old brightness value from the program for the brightness sensor and adjust your accordingly. b. Use what you ve learned from the brightness sensor and change, so that your program works like this: [Note: One of these lines may need more than one line in your code. Don t hesitate to flip a few pages back, if you can t remember how something worked.] 3. Test your program with the help of your flashlight. Watch the brightness values on the serial monitor. If it is not working, it s probably a small slip in the if-else-command. It could also be, because your conditions are bad, it may help to have the motor turn each step. You did it!! values are way too high or way too low. If the lighting Awesome! You have now constructed your own sunflower. You can try to optimize your flower or continue with the next station. List of references: Fig. 1 Source: Photo by Charlotte Ségure Fig. 2 Source: Photo by Alex Lang Fig. 3 Source: Artist Stuart McGhee Fig. 5, 7, 8 Source: Screenshots of Fritzing-software (http://fritzing.org) for All other graphics/icons Source: InfoSphere 10