Kitronik Inventors Kit for Arduino Exp 8 Exploring Wind Power

Experiment 8 from the Inventors Kit for Arduino. In which we explore wind power. Included in this resource are code downloads, a description of the experiment, and also a video walkthrough. It provides additional help and is not meant to replace the documentation that ships with the kit. Arduino Inventors Kit Exp 8 Wind Power Arduino is an open-source code-able electronics platform. The boards can process inputs from many sensors, and also control outputs such as LEDs and motors. The Arduino is controlled by the code with which it is programmed. This code is written in the Arduino programming language, using the Integrated Development Environment (IDE). Once complete, the code is easily transferred to the board using a simple USB lead.  

 

Kitronik Inventors Kit for Arduino Exp 8 Wind Power:

Wind turbines convert the kinetic energy of air into electrical power. In this experiment, the motor and also the fan are used in reverse to generate a voltage which can be measured and displayed by the Arduino using a seven segment display. The aims of this experiment are:
  • To generate a voltage by blowing on a fan blade to spin a motor.
  • And to measure this voltage by using an analog input pin on the Arduino.
  • Also, to display the voltage generated using a seven segment display.
 

Video Walkthrough:

 

Exp 8 Code:

Either open a new Sketch then create the following code by typing in the editor window, or, copy and paste it straight into the editor

/*
Control a seven segment display to show how much 'power' is generated from a 'wind turbine'
*/
 
 /* 
  *  This array of 10 numbers shows the states of the pins for the segments 
  *  to display the appropriate number. This is used to simplify the code
  *  later - we can index the array to display the correct number.
 */
const bool Numbers[11][7] =  {{1,1,1,1,1,1,0}, //zero
                        {0,1,1,0,0,0,0}, //one
                        {1,1,0,1,1,0,1}, //two
                        {1,1,1,1,0,0,1}, //three
                        {0,1,1,0,0,1,1}, //four
                        {1,0,1,1,0,1,1}, //five
                        {1,0,1,1,1,1,1}, //six
                        {1,1,1,0,0,0,0}, //seven
                        {1,1,1,1,1,1,1}, //eight
                        {1,1,1,0,0,1,1},  //nine
                        {0,0,0,0,0,0,0}  //Clear Display
  
};

#define ClearDisplay 10

int displayNumber(int numberToDisplay)
{
  int pin = 2;
  for(int segment =0;segment<7;segment++) 
  {
    digitalWrite(pin, Numbers[numberToDisplay][segment]);  
    pin++;
  }
  return numberToDisplay;
}

void setup()
{
  // define pin modes
  pinMode(2,OUTPUT); //Segment A
  pinMode(3,OUTPUT); //Segment B
  pinMode(4,OUTPUT); //Segment C
  pinMode(5,OUTPUT); //Segment D
  pinMode(6,OUTPUT); //Segment E
  pinMode(7,OUTPUT); //Segment F
  pinMode(8,OUTPUT); //Segment G
  pinMode(9,OUTPUT); //Segment Decimal Point
  
  displayNumber(ClearDisplay); //make sure the display is off
 
}

void loop() 
{
  //first read in the generated voltage
  int GeneratedValue = analogRead(A0);
  
  //now we map it to a much smaller rangew, as we only have a single 0-9 display.
  int DisplayValue = map (GeneratedValue, 0,1023,0,9);
  //and finally display it.
  displayNumber(DisplayValue);
 //add a small delay so that the number doesnt change to rapidly to read.
  delay(100);
  
}

Inventors Kit Extra Resources:

Each of the ten experiments has been designed to ease you into coding and also physical computing for the Arduino. The experiments have been chosen to cover the key concepts of physical computing and they also increase in difficulty as you progress. If you are new to this, even the least complex examples can be quite challenging. With this in mind, we created walkthrough videos for each of the experiments. Our presenter talks you through the circuit in a way that backs up the information given in the booklet but in a style that some might find easier to absorb. As well as having a video walkthrough, each page also contains the code. Although it is always good to tackle the code yourself, it can be handy for testing your circuit. The code has been heavily commented as an extra learning resource. To get the most out of the experiment, once you've tested your circuit have a go at coding the experiment from scratch. Follow the links in the table below:  
Exp No#. Experiment Name.
1
Digital Inputs & Outputs.
2
Light Sensor & Analog Inputs.
3
Dimming an LED using a potentiometer.
4
Using a transistor to drive a motor.
5
Control a servo with a potentiometer.
6
Setting the tone with a piezo buzzer.
7
Using a seven segment display.
8
Exploring wind power.
9
Capacitor charge circuit.
10
Using an RGB LED.

Leave a comment

All comments are moderated before being published