HOLOGRAPHY PROJECTS FOR THE EVIL GENIUS PDF
Request PDF on ResearchGate | Holography Projects for the Evil Genius | Take Your Imagination to Another Dimension This wickedly inventive guide explores. Holography Projects for the Evil Genius®. Gavin D. J. Harper. New York Chicago San Francisco Lisbon London Madrid. Mexico City Milan New Delhi San Juan. Title: #PDF~ Holography Projects for the Evil Genius Free, Author: zep-hyr, Name: #PDF~ Holography Projects for the Evil Genius Free.
|Language:||English, Spanish, Hindi|
|ePub File Size:||18.36 MB|
|PDF File Size:||14.24 MB|
|Distribution:||Free* [*Register to download]|
york chicago san francisco lisbon london madrid mexico city milan new delhi san juan seoul holography projects for the evil genius pdf - holography projects for. Holography Projects For The Evil Genius PDF ePub Mobi - Download Holography Projects For The Evil Genius (PDF, ePub, Mobi)Books Holography Projects. Holography Projects For The Evil Genius composed by yazik.info Mentoring is readily available in word, pdf, ppt, txt, zip, kindle, and rar. holography projects.
It fetches program instructions stored in the Flash memory and executes them. This means that may mean changing one of the digital outputs from instead of 10 mA, the current will actually be 0 to 5 volts. We can also set one of these digital connections to be an input, in which case, it works rather like an analog input, except that it will just tell us if the voltage at a pin is above a certain threshold roughly 2.
Some of the digital connections 3, 5, 6, 9, 10, and 11 have the letters PWM next to them. These can be used to provide a variable output voltage rather than a simple 5V or nothing. Figure ATmega block diagram. Whereas for most of our projects; however, we will also the Flash memory is intended for storing program dabble with the interesting Lilypad Arduino. It does not have a USB connection, which functions in an identical way to the and you must use a separate adaptor to program it.
ATmega except that it has half the amount of This is an exceptionally beautiful design. Inspired every sort of memory. At the other end of the spectrum is the Arduino Mega.
Cleverly, the Arduino Mega can still use shields Above the microcontroller there is a small, silver, built for the smaller Arduino Diecimila and rectangular component.
Follow the Author
This is a quartz crystal Duemilanove boards, which sit at the front of the oscillator. Only the most demanding of projects To the right of the crystal, is the Reset switch. Clicking this sends a logic pulse to the Reset pin of the microcontroller, causing the microcontroller to start its program afresh and clear its memory. Note that any program stored on the device will be retained because this is kept in nonvolatile Flash memory—that is, memory that remembers even when the device is not powered.
To the right of the Reset button is the serial programming connector. It offers another means of programming the Arduino without using the USB port.
Get A Copy
Since we do have a USB connection and software that makes it convenient to use, we will not avail ourselves of this feature. This converts the signal levels used by the USB standard to levels that can be used directly by the Arduino board. Figure Arduino Lilypad. Arduino sits somewhere in between these two extremes and uses the C programming It is standard practice to include such text at the language.
It does, however, wrap up the C top of any program file. You can also include language, hiding away some of the complexity. The C language is, in computing terms, an old The Arduino development environment uses and venerable language. This line of code gives a name to the digital output pin that we are going to connect to the An Example LED.
Project 1 in a bit more detail. It may be an int, as is the case case, the function is called setup. Every sketch here, or a float, or a number of other types that we must contain a setup function, and the lines of will describe later in this chapter.
In this case, that is just the line starting particular pin on the Arduino. There is, after all, no with pinMode. It will an equal sign, then a value, and finally a semicolon also be run every time a new sketch is to indicate the end of the line: Try The first thing to mention is that we have a removing the semicolon and clicking the Play different type of comment on the end of this line.
You should see a message like this: That is, the single-line comment. This begins with error: They will actually be defined the Arduino pin to write to and the value to write. We have already met the variable ledPin and The next section of code is another function that declared it to be of type int. Most of the variables every Arduino sketch must have; it is called loop: If you are new to programming, I would use ints The function loop will be run continuously until for almost everything and gradually expand your the Arduino is powered down.
That is, as soon as it repertoire of data types as your experience grows. Remember that an Arduino board is summarized in Table So if frequently if you let them. More alarmingly, if you have doing continuously is to turn the LED on, wait a an int variable with 32, and you add 1 to it, you second, turn the LED off, and then wait another will end up with —32, When it has finished doing this, it will Until you are completely happy with these begin again, turning the LED on.
In this way it will different data types, I would recommend sticking go round the loop forever. By now, the command syntax for digitalWrite and delay will be becoming more familiar. Arithmetic Although we can think of them as commands that are sent to the Arduino board, they are actually It is fairly uncommon to need to do much in the functions just like setup and loop, but in this case way of arithmetic in a sketch.
Occasionally, you they have what are called parameters. Its negative numbers are not normally used. Use with caution, as arithmetic with ints may cause unexpected results. However, on Arduino, it is the same as float. Strings Conditional Statements When programmers talk of Strings, they are Conditional statements are a means of making referring to a string of characters such as the decisions in a sketch. There is a lot to take in the temperature variable had a value that was if you are not familiar with electronics, and while anything except We will keep the hardware fairly simple so that we can concentrate Description Appendix on the programming of the Arduino.
Arduino Diecimila or Programming microcontrollers can be a tricky Duemilanove board or clone 1 business requiring an intimate knowledge of the D1 5-mm red LED 23 inner workings of the device: Hardware Project 2 Morse Code S. Flasher The hardware is exactly the same as Project 1. So, you can either just plug the resistor and LED Morse code used to be a vital method of directly into the Arduino connectors or use a communication in the 19th and 20th centuries.
Its breadboard see Chapter 1. The letters S. Save Our Souls is still recognized Rather than start typing this project in from as an international signal of distress. In this project, we will make our LED flash the So if you have not already done so, please sequence S.
For this project, you will need just the same If you have not already done so, download the components as for Project 1. We are digitalWrite ledPin, LOW ; going to alter our sketch to improve it, and at the delay ; same time make it a lot shorter. Loops allow us to repeat a group of commands a This makes the sketch a lot smaller and a lot certain number of times or until some condition is easier to read.
In Project 2, we only want to flash three dots for Putting It All Together an S, so it is no great hardship to repeat the flash That concludes Project 2. We will now cover some command three times. However, it would be far more background on programming the Arduino less convenient if we needed to flash the LED before we go on to look at Project 3, where we or times. In that case we can use the for will use our same hardware to write a Morse code language command in C.
But first, we need a little more theory in order The for loop is a bit like a function that takes to understand Projects 3 and 4. This is just a quirk of the C language. This specifies a variable to be languages, begins its index positions at 0 rather used as a counter variable and gives it an initial than 1. This means that the first element is actually value—in this case, 0.
The second part is a condition that must be true To illustrate the use of arrays, we could change for us to stay in the loop. You indicate that a variable contains an array by Another way of looping in C is to use the while placing  after the variable name. If you are command. The same example shown previously setting the contents of the array at the same time could be accomplished using a while command, you are defining it, as in the previous example, you as shown here: For example: The expression in parentheses after while must be true to stay in the loop.
In programming parlance, flash durations[i] ; they are known as a block.
The variables we have met so far have only contained a single value, usually an int. In Project 3, we will take the For this project, you will need just the same use of arrays a stage further to make a more components as for Project 1 and 2.
In fact, the general-purpose Morse code flasher. Figure shows the Morse code translator in action. The contents of the message box are being Hardware flashed as dots and dashes on the LED. Please refer back to Project 1 for the hardware To do this, we will make use of what we have construction for this project. Some of the rules of Morse code are that a dash G V …- 8 For a full list of all the Morse characters, The sketch for this is shown in Listing Project 3.
An explanation of how it all works follows. We have two of these, one for subtracting one letter from another, but it is letters and one for numerals. So to find out what perfectly acceptable to do this in C. We pass this string to a function called can change this value, as all the durations are flashSequence.
The flashSequence function is going to loop The setup function is much the same as for our over each of the parts of the sequence and flash it earlier projects; however, this time we are getting as either a dash or a dot.
Strings in C all have a communications from the USB port, so we must special code on the end of them that marks the end add the command: So, the first thing flashSequence does is to define a variable Serial. This is not very fast, but fast enough for our Inside the while loop, we first flash the current Morse code messages. We then have a series of if statements that Putting It All Together determine whether the character is an uppercase letter, a lowercase letter, or a space character Load the completed sketch for Project 3 from separating two words.
This window allows you to type messages letter array that we defined at the top of the sketch. The Serial Monitor is launched by clicking the Project 4 rightmost icon shown highlighted in Figure So in this messages coming from the Arduino board will be project, we are going to up the power and use a displayed. These LEDs are extremely drop-down list where you can select the speed at bright and all the light comes from a tiny little area which the data is sent.
Whatever you select here in the center, so to avoid any possibility of retina must match the baud rate that you specify in your damage, do not stare directly into it.
We use , which is the We also look at how, with a bit of soldering, we default, so there is no need to change anything can make this project into a shield that can be here. We should then have our message flashed to us in Morse code. We can use this to calculate power using the allow a much bigger current to flow between the formula: So times the current flowing through it, and the unit a current of 10 mA flowing through the base could of power is the watt.
So that LED would be cause up to 1 A to flow through the collector. This is a common problem in electronics, and The schematic diagram for our control circuit is can be summed up as getting a small current to shown in Figure The most commonly used flows through the base. V will be 4. There are many different types of 5V. So, the current will be 4. We came up with the figure of bipolar transistor.
In this case, the base current is small enough to ignore, so the power will just be 0.
It is always a good idea to pick a transistor that can easily cope with the power. In this case, we are going to use a BD that has a power rating of over 12W. In Chapter 10, you can find a table of commonly used transistors. Now we need to put out components into the breadboard according to the layout shown in Figure , with the corresponding photograph of Figure It is crucial to correctly identify the leads of the transistor and the LED.
The metallic side of the transistor should be facing the board. Later in this project we are going to show you roughly 5 — 3 — 0. This requires some soldering, so if 1. We must also use a resistor you think you might go on to make a shield and that can cope with this relatively high current.
The have the facilities to solder, I would solder some power that the resistor will burn off as heat is leads onto the Luxeon LED. Solder short lengths equal to the voltage across it multiplied by the of solid-core wire to two of the six tags around the current flowing through it. In this case, that is edge.
To be on the safe idea to color-code your leads with red for positive side, we have selected a 1W resistor. When it need to carefully twist the solid-core wire around is turned on, the transistor will consume power equal the connectors as shown in Figure Figure Project 4 breadboard layout. Making a Shield This is the first project that we have made that has enough components to justify making an Arduino Figure Attaching leads to the Luxeon LED Shield circuit board to sit on top of the Arduino without soldering.
We are also going to use this hardware with minor modifications in Project 6, so perhaps Figure shows the fully assembled it is time to make ourselves a Luxeon LED Shield. Making your own circuit boards at home is perfectly possible, but requires the use of noxious Software chemicals and a fair amount of equipment. But The only change in the software from Project 3 is fortunately, there is another great piece of Arduino- that we are using digital output pin 11 rather than related open-source hardware called the Arduino pin That Putting It All Together includes the board itself; the header connector pins Load the completed sketch for Project 4 from your that fit into the Arduino; and some LEDs, Arduino Sketchbook and download it onto your switches, and resistors.
Please be aware that there board see Chapter 1. You will need to open the Serial Monitor board is slightly different. Figure Photograph of complete breadboard for Project 4.
It is possible to just download the Protoshield circuit board on its own, which for many projects will be all you need. We are not going to solder all the components that came with our kit onto the board. We are just going to add the power LED, its resistor, and just the bottom pins that connect to the Arduino board, as this is going to be a top shield and will not have any other shields on top of it.
A good guide for assembling circuit boards is to solder in place the lowest components first. So in this case we will solder the resistors, the LED, the reset switch, and then the bottom pin connectors. Figure The underside of the Protoshield.
The 1K resistor, LED, and switch are all pushed through from the top of the board and soldered A good way to ensure that the headers are in the underneath Figure The short part of the right place is to fit the sections of header into an connector pins will be pushed up from underneath Arduino board and then place the shield on top and the board and soldered on top.
This will also ensure that the pins When soldering the connector pins, make sure are straight. We can now add our components for this project, which we can take from the breadboard. First, line up all the components in their intended places according to the layout of Figure to make sure everything fits in the available space.
This kind of board is double-sided—that is, you can solder to the top or bottom of the board. As you can see from the layout in Figure , some of the connections are in strips like a breadboard.
We are going to mount all the components on the top side, with the leads pushed through and soldered on the underside where they emerge from the board. The leads of the components underneath can then be connected up and excess leads snipped off. If necessary, lengths of solid-core wire can be used where the leads will not reach. Figure Protoshield in kit form.
Figure Project 4 Protoshield layout. Figure shows the completed shield. Power Summary up your board and test it out. If it does not work as soon as you power it up, disconnect it from the So, we have made a start on some simple LED power right away and carefully check the shield Projects and discovered how to use high power for any short circuits or broken connections using a Luxeon LEDs.
We have also learnt a bit more multimeter. You have created your first In the next chapter, we are going to extend this Arduino Shield, and it is one that we can reuse in by looking at some more LED-based projects later projects. Figure Complete Luxeon shield attached to an Arduino board.
This is set in your sketch. Since So now we know how to set a digital pin to be an you are going to be connecting electronics to one input, we can build a project for model traffic of these pins, it is unlikely that you are going to signals using red, yellow, and green LEDs.
Every want to change the mode of a pin. That is, once a time we press the button, the traffic signal will go pin is set to be an output, you are not going to to the next step in the sequence. In the UK, the change it to be an input midway through a sketch. For this reason, it is a convention to set the direction of a digital pin in the setup function that As a bonus, if we hold the button down, the must be defined in every sketch.
For example, the following code sets digital pin 10 to be an output and digital pin 11 to be an The components for Project 5 are listed next. Note how we use a variable declaration in When using LEDs, for best effect, try and pick our sketch to make it easier to change the pin used LEDs of similar brightness.
Arduino Diecimila or A photograph of the project is shown in Figure Duemilanove board or clone 1 and the board layout in Figure We only resistor 13 check to see if the switch is pressed once a second, S1 Miniature push to make so pressing the switch rapidly will not move the switch 48 light sequence on.
However, if we press and hold the switch, the lights will automatically sequence round. Hardware We use a separate function setLights to set the The schematic diagram for the project is shown in state of each LED, reducing three lines of code to Figure The LEDs are connected in the same way as our earlier project, each with a current-limiting Figure Schematic diagram for Project 5.
A model traffic signal. Figure Breadboard layout for Project 5. The Arduino is equipped with six analog input pins numbered Analog 0 to Analog 5. These measure the voltage at their input and give a number between 0 0V and 5V. We can use this to detect the position of a control knob by connecting a variable resistor acting as a potential divider to our analog pin. Figure shows the internal structure of a variable resistor.
A variable resistor is a component that is typically used for volume controls. It is constructed as a circular conductive track with a gap in it and connections at both ends.
A slider provides a moveable third connection. You can use a variable resistor to provide a variable voltage by connecting one end of the resistor to 0V and the other end to 5V, and then the voltage at the slider will vary between 0 and 5V as you turn the knob. Figure The internal workings of a variable As you would expect, the breadboard layout resistor.
Figure is similar to Project 4. Software second; the delays between turning the LED on and off will be milliseconds and 25 The listing for this project is shown here. The milliseconds, respectively. The layout of components on the Protoshield is shown in Figure This is basically the same as for Project 4, except that we have added the variable resistor.
The pins on a variable resistor are too thick to fit into the holes on the Protoshield, so you can either Figure Creating a battery lead.
To provide some mechanical strength, the variable resistor can be glued in place Project 7 first with a drop of Super Glue. The wiring for the S. To use this project for such a To power the project from a battery, we need to purpose, I would suggest the use of some kind of make ourselves a small lead that has a PP3 battery diffuser such as frosted glass, as you should not clip on one end and a 2.
Figure shows the semi-assembled lead. This is another project based on the Luxeon high-brightness LEDs. We will also use an analog output to slowly raise the brightness of the LEDs as they turn on and then slowly decrease it as they turn off. To make the light bright enough to be of use as a S. At this point, the caring nature of this project may be causing the Evil Genius something of an identity crisis. But, fear not—in Project 8, we will turn this same hardware into a fearsome high- powered strobe light.
Figure Protoshield layout for Project 6. Description Appendix The value of the output can be set using the Arduino Diecimila or function analogWrite, which requires an output Duemilanove board or clone 1 value between 0 and , where 0 will be off and D Luxeon 1W LED 30 full power. Since each LED consumes about mA, each column will draw about mA Regulated 15V 1A power supply 51 and so the supply must be capable of supplying Perf board 53 0.
Three-way screw terminal 52 This is the most complex schematic so far in our projects. If you want to save some money, regulators will normally be 1.
Some of the digital pins, namely digital pins 5, 6, The FET field effect transistor is like our 9, 10, and 11, can provide a variable output rather normal bipolar transistor, in that it can act as a than just 5V or nothing. These are the pins with switch, but it has a very high off resistance. So PWM next to them on the board. However, when it output control. It does so by rapidly turning them off. Both of the FETs are controlled from the the output on and off.
The pulses are always delivered at the same rate The completed LED module is shown in Figure roughly per second , but the length of the and the perf board layout in Figure If the pulse is long, our LED will The module is built on perf perforated board.
If, however, the pulses are short, The perf board is just a board with holes in it. It the LED is only actually lit for a small portion of has no connections at all. So it acts as a structure the time. This happens too fast for the observer to on which to fit your components, but you have to even tell that the LED is flickering, and it just wire them up on the underside of the board, either appears that the LED is brighter or dimmer.
It is a good idea leave a gap between them and the perf board using to color-code those leads—red for positive and the insulation on the wire to act as a spacer. The black or blue for negative—so that you get the voltage regulator will also get hot but should be LEDs in the correct way round. The voltage regulator Figure Project 7. High-power light module. So in order to have 5V at one end of our The screw terminals on the board are for the variable resistor and 0V at the other, we are going power supply GND and 15V and a control input.
At the top of the sketch, after the variable used for Our high-power LED module will be of use in pins, we have four other variables: This is common practice in connectors on the Arduino board. The spacing of programming. You can see this arrangement in Figure Similarly, turnOffSeconds determines output value Load the completed sketch for Project 7 from your Arduino Sketchbook and download it to the board In this sketch, there is nothing in the loop see Chapter 1.
Instead all the code is in setup. So, the light will automatically start its cycle when it is You now need to attach wires from the Vin, powered up. Once it has finished, it will stay GND, and digital pin 11 of the Arduino board to turned off until the reset button is pressed.
Slow turn-off works in a similar manner.
Holography Projects for the Evil Genius
The time period at full brightness is set by the Project 8 analog input. Assuming that we want a range of High-Powered Strobe Light times from 5 to 30 minutes, we need to convert the For this project, you can use the six Luxeon LED value of 0 to to a number of seconds between module of Project 7 or you can use the Luxeon and Fortunately, there is a handy shield that we created for Project 4.
The software Arduino function that we can use to do this. The will be almost the same in both cases. Apart from then darker that, the techniques we use in this sketch have s Strobe effect mostly been used in earlier projects. As we pointed out at the start of this section, When you have installed the sketch and fitted computers are deterministic, and actually our the Luxeon shield or connected the bright six- random numbers are not random at all, but a long Luxeon panel, initially the lights will be off.
Open sequence of numbers with a random distribution. This will start the light flashing. Try the numbers every time you run your script. Then try typing the w command to switch to wave mode. A second function randomSeed allows you to control this. The randomSeed function determines where in its sequence of pseudo-random numbers Random Number Generation the random number generator starts.
A good trick is to use the value of a Computers are deterministic. If you ask them the disconnected analog input, as this will float around same question twice, you should get the same at a different value and give at least different answer.
However, sometimes, you want chance to starting points for our random sequence. This take a hand. This is obviously useful for games. This project uses what we have just learned about The Arduino library includes a function for random numbers to create electronic dice with six creating random numbers.
LEDs and a button. It on a value and then flashing it. The schematic diagram for Project 9 is shown in Figure Each LED is driven by a separate digital output via a current-limiting resistor.
The Software only other components are the switch and its This sketch is fairly straightforward; there are a associated pull-down resistor. For example, as the dice six dots, we still need seven LEDs to have the rolls, the number changes, but gradually slows. Figure Schematic diagram for Project 9. Figure The breadboard layout for Project 9. LED dice. We also have a call to randomSeed in the should be on or off for any particular throw.
So setup method. If this was not there, every time we each throw element of the array is actually itself an reset the board, we would end up with the same array of seven elements, each one being either sequence of dice throws. In the next chapter we will investigate some Load the completed sketch for Project 9 from your different types of sensors and use them to provide Arduino Sketchbook and download it to the board inputs to our projects.
The projects in this chapter are all only way to do that is to solder them on. So this is about using light and temperature. Hardware The schematic diagram for Project 10 is shown in Project 10 Figure This project would not be out of place in the lair of Keypads are normally arranged in a grid so that any Evil Genius worth their salt.
A secret code when one of the keys is pressed, it connects a row must be entered on the keypad, and if it is correct, to a column. Figure shows a typical a green LED will light; otherwise, a red LED will arrangement for a key keyboard with numbers stay lit. The basic approach we have to K1 4 by 3 keypad 54 take is to connect each row to a digital output and 0.
We then put each output high in turn and see which inputs are high. Figure shows how you can solder seven pins are bought in strips and can be easily snapped to from a pin header strip onto the keypad so that you provide the number of pins required. Pin headers Now, we just need to find out which pin on the keypad corresponds to which row or column. If we are lucky, the keypad will come with a datasheet that tells us this.
If not, we will have to do some detective work with a multimeter. Set the multimeter to continuity so that it beeps when you connect the leads together. Then get some paper, Figure A switch keypad. Figure Soldering pins to the keypad.
Note that the keypad conveniently has seven pins that will just fit directly into the Digital Pin 0 to 7 socket on the Arduino board Figure , so we only need the breadboard for the two LEDs.
You may have noticed that digital pins 0 and 1 have TX and RX next to them. This is because they are also used by the Arduino board for serial communications, including the USB connection. We will still be able to program the board, but it does mean that we will not be able to communicate over the USB connection while Figure Working out the keypad the sketch is running. Since we do not want to do connections.
Then write a list of all the keys. Then, holding each key down While we could just write a sketch that turns on in turn, find the pair of pins that make the the output for each row in turn and reads the inputs multimeter beep indicating a connection Figure to get the coordinates of any key pressed, it is a bit Release the key to check that you have more complex than that because switches do not indeed found the correct pair.
After a while, a always behave in a good way when you press pattern will emerge and you will be able to see them. Keypads and push switches are likely to how the pins relate to rows and columns.
Figure bounce. That is, when you press them, they do not shows the arrangement for the keypad used by simply go from being opened to closed, but may the author. Figure Project 10 breadboard layout. Keypad security code. Fortunately for us, Mark Stanley and Alexander On a Mac, you do not put the new library into Brevig have created a library that you can use to the Arduino installation. Instead, you create a connect to keypads that handles such things for us.
The Evil Genius is much Arduino directory, we will be able to use it with amused by such altruism and sees it as a great any sketches that we write. But remember that on weakness. If Import Library Keypad.
Extract All and then save the whole folder into The sketch for the application is shown in C: Figure Installing the library for Mac.
The loop and round indefinitely without meeting any kind of function checks for a key press. If, on the other hand, the key pressed is one of the Some rotary encoders also incorporate a button numerals, it checks to see if it is the next key so that you can turn the knob and then press.
This expected secretCode[position] is the key just is a particularly useful way of making a selection pressed, and if it is, it increments position by one.
A rotary encoder is a digital device that has two outputs A and B , and as you turn the knob, you Putting It All Together get a change in the outputs that can tell you Load the completed sketch for Project 10 from whether the knob has been turned clockwise or your Arduino Sketchbook and download it to the counterclockwise. Figure shows how the signals change on A If you have trouble getting this to work, it is and B when the encoder is turned. When rotating most likely a problem with the pin layout on your clockwise, the pulses will change, as they would keypad.
So persevere with the multimeter to map moving left to right on the diagram; when moving out the pin connections. So if A is low and B is low, and then B becomes Rotary Encoders high going from phase 1 to phase 2 , that would indicate that we have turned the knob clockwise.
A We have already met variable resistors: These used to be low, B being high, and then A becoming high behind most knobs that you could twiddle on going from phase 2 to phase 3 , etc. However, if A electronic equipment. There is an alternative, the was high and B was low and then B went high, we rotary encoder, and if you own some consumer have moved from phase 4 to phase 3 and are, electronics where you can turn the knob round therefore, turning counterclockwise.
The majority of the circuitry is the same as for Project 5, except that now we have a This project uses a rotary encoder with a built-in rotary encoder. It is a much three switches: Each of these switches requires a and is really not far off the logic that you would pull-down resistor. Since the schematic is much the same as for Rotating the rotary encoder will change the Project 5, it will not be much of a surprise to see frequency of the light sequencing.
Pressing the that the breadboard layout Figure is similar button will test the lights, turning them all on at to the one for that project. The components are the same as for Project 5, with the addition of the rotary encoder and pull-up Software resistors in place of the original push switch. The starting point for the sketch is the sketch for Project 5.
We have also taken the opportunity Description Appendix to enhance the logic behind the lights to make them behave in a more realistic way, changing Arduino Diecimila or Duemilanove board or clone 1 automatically. So our sketch now has two periods: This longPeriod is the period that is switch 57 changed by turning the rotary encoder. Figure Breadboard layout for Project The key to handling the rotary encoder lies in quickly will result in some changes not being the function getEncoderTurn.
Every time this is recognized correctly. The changed, works out if it was clockwise or function uses the static modifier for the oldA and counterclockwise and returns a —1 or 1, oldB variables.
This is a useful technique that respectively. If there is no change the knob has allows the function to retain the values between not been turned , it returns 0. This function must one call of the function and the next, where be called frequently or turning the rotary controller normally it would reset the value of the variable every time the function is called.
This schematic for this is shown lets you time events turning an LED on for so in Figure If we just used the Arduino expect at the analog input. The ratio of count has reached 20, This is less accurate voltages would then be about 4: A more sensitive photo detector is the phototransistor. This functions like an ordinary transistor except there is not usually a base Putting It All Together connection. Instead, the collector current is Load the completed sketch for Project 11 from controlled by the amount of light falling on the your Arduino Sketchbook and download it to the phototransistor.
You can press the rotary encoder button to test the LEDs and turn the rotary encoder to change how long the signal stays green and red. Sensing Light A common and easy-to-use device for measuring light intensity is the light-dependent resistor or LDR. They are also sometimes called photoresistors.
The brighter the light falling on the surface of the LDR, the lower the resistance. We can convert this change in resistance to a change in voltage by using the LDR, with a fixed resistor as a voltage divider, connected to one of Figure Using an LDR to measure light.
Shine the bright LED onto one side of your finger while the This project uses an ultra-bright infrared IR LED phototransistor on the other side of your finger and a phototransistor to detect the pulse in your picks up the amount of transmitted light.
The finger. It then flashes a red LED in time with your resistance of the phototransistor will vary slightly pulse. We have Description Appendix chosen quite a high value of resistance for R1 because most of the light passing through the Arduino Diecimila or Duemilanove board or clone 1 finger will be absorbed and we want the phototransistor to be quite sensitive. Figure Schematic for Project Short leads are soldered to the LED and phototransistor, and then another layer of tape is wrapped over everything to hold it all in place.
Be sure to check which colored wire is connected to which lead of the LED and phototransistor before you tape them up. The breadboard layout for this project Figure is very straightforward.
Figure Sensor tube for heart monitor.
For this reason, the phototransistor and LED are built into a tube or corrugated cardboard held together with duct tape. The construction of this is shown in Figure Figure Project Pulse rate monitor.
Indeed, the first step is not to run the entire can capture them and paste them into a spreadsheet final script, but rather a test script that will gather for analysis. When you start the Serial The test script is provided in Listing Projet Monitor, you will need to change the serial speed to baud.
Then, copy and paste the captured text into a void loop spreadsheet. If the Serial. The real sketch is provided in the following listing on the next page. If you are having trouble, run the 0. Instead of an LDR, a device called a thermistor is used.
The formula for calculating the resistance at a particular temperature is given by: In this case, its value is By default, the logger will calculate the voltage at the analog input using the record 1 sample every five minutes, and can record formula: Reports the status of the device, number of samples taken, etc. This project just requires a thermistor and Figure Schematic diagram for Project Sometimes we want to be able to Arduino Diecimila or store data persistently so that it is there next time Duemilanove board or clone 1 we start up the board.
This means that once we have set our data logging recording, we can disconnect it Hardware from the USB lead and leave it running on batteries. Even if the batteries go dead, our data The schematic diagram for Project 13 is shown in will still be there the next time we connect it.
You will notice that at the top of this sketch we This is so simple that we can simply fit the use the command define for what in the past we leads of the thermistor and resistor into the would have used variables for.
This is actually a Arduino board, as shown in Figure So it is actually ideal for pin settings and constants like beta. The command define is The software for this project is a little more what is called a pre-processor directive, and what complex than for some of our other projects see happens is that just before the sketch is compiled, Listing Project It is very much a matter the actual reading data in the bytes that follow.
Here we had a choice: We could happens just one byte at a time. So if we want to either store all 4 bytes or find a way to encode the write a variable that is a byte or a char, we can just temperature into a single byte. Second, we assume that we only need to know the temperature The 0 in the parameters for read and write is the to the nearest quarter of a degree.
This can be any With these two assumptions, we can take any number between 0 and , with each address temperature value we get from the analog input, being a location where one byte is stored. So we will record , that just fits nicely. Finally, we can type the G command to start Both encoding and decoding the values are logging.
We can then unplug the USB lead and wrapped up in the functions storeReading and leave our logger running on batteries. After waiting getReading. So, if we decided to take a different 10 or 15 minutes, we can plug it back in and see approach to storing the data, we would only have what data we have by opening the Serial Monitor to change these two functions.
Now open the Serial Monitor Figure , and Once in the spreadsheet, we can even draw a for test purposes, we will set the temperature chart using our data. We now know how to handle various types of Now we can check the status of the logger by sensors and input devices to go with our typing?.
In the next section we will In order to unplug the USB cable, we need to look at a number of projects that use light in have an alternative source of power, such as the various ways and get our hands on some more battery lead we made back in Project 6.
You need advanced display technologies, such as LCD text to have this plugged in and powered up at the same panels and seven-segment LEDs. Figure Issuing commands through the Serial Monitor. Figure Temperature data imported into a spreadsheet. In particular, we look Blue LED, you can use a six-pin device instead. Hardware Project 14 Figure shows the schematic diagram for Multicolor Light Display Project 14 and Figure the breadboard layout.
The rotary LED in combination with a rotary encoder. For more detail on displayed by the LED. Pin 1 is the pin closest to that edge. The other Arduino Diecimila or way to identify the pins is by length. Pin 2 is the Duemilanove board or clone 1 common anode and is the longest pin. The LED has way as for Project Multicolor Light Display. Software elements should be lit. The numbers in the array are shown in hexadecimal and correspond to the This sketch Listing Project 14 uses an array to hex number format used to represent bit colors represent the different colors that will be displayed on webpages.
If there is a particular color that you by the LED. Each of the elements of the array is a want to try and create, find yourself a web color long bit number. Three of the bytes of the long chart by typing web color chart into your favorite number are used to represent the red, green, and search engine. You can then look up the hex value blue components of the color, which correspond to for the color that you want. Figure shows the circuit for driving a single Load the completed sketch for Project 14 from seven-segment display.
This required the wearer to press a button on the watch for the time to magically appear as four bright red digits. After a while, the inconvenience of having to use both limbs to tell the time overcame the novelty of a digital watch, and the Evil Genius went out and bought an LCD watch instead. This could only be read in bright sunlight.
Figure Seven-segment LED display. A single seven-segment LED is not usually a through the base of the transistor and out through great deal of use. Most projects will want two or the emitter, it allows a much greater current to four digits. When this is the case, we will not have flow through from the collector to the emitter.
We enough digital output pins to drive each display have met this kind of transistor before in Project 4, separately and so the arrangement of Figure is where we used it to control the current to a high- used.
Rather like our keyboard scanning, we are going We do not need to limit the current that flows to activate each display in turn and set the through the collector to the emitter, as this is segments for that before moving on to the next already limited by the series resistors for the digit.
We do this so fast that the illusion of all LEDs. However, we do need to limit the current displays being lit is created. Most transistors will Each display could potentially draw the current multiply the current by a factor of or more, so for eight LEDs at once, which could amount to we only need to allow about 2 mA to flow through mA at 20 mA per LED —far more than we the base to fully turn on the transistor.
For this reason, Transistors have the interesting property that we use a transistor that is switched by a digital under normal use, the voltage between base and output to enable each display in turn. So, if our Arduino pin bipolar transistor.
It has three connections: This does mean that there are in turn. This is in contrast to how we controlled the relatively long and bare resistor leads, so take care power to the Luxeon LED in Project 4, where we to ensure that none of them are touching each controlled the power on the ground side of the other.
This also accounts for the apparently random circuit. This all means that we are going to use a allocation of Arduino pins to segments on the LED different type of transistor. Instead of the NPN display. They are arranged like that for ease of negative-positive-negative transistor we used connection.
You will notice the different Software position of the arrow in the circuit symbol for the transistor to indicate this. We also use an array to segment display, then we would have an NPN determine which segments should be lit to display transistor, but at the bottom of the circuit rather any particular digit. This is a two-dimensional than at the top.
Project Double seven-segment LED dice. We display on in turn, setting its segments can then light either one or both LEDs to make a appropriately. So our loop function must keep the red, green, or orange color. This project makes use of one of these devices To throw the dice, we use the random function, and allows multicolor patterns to be displayed on it and whenever the button is pressed, a new value over the USB connection.
As projects go, this one will be set for dice1 and dice2. This means that the involves a lot of components and will use almost throw will also depend on how long the button is every connection pin of the Arduino. Hardware They consist of an array of LEDs in this case, 8 Figure shows the schematic diagram for the by 8.
These devices can have just a single LED at project. LED Array. So instead of needing To drive the matrix, we have to do the same an Arduino board output for each row, we just kind of trick that we did with the two-digit, need two outputs: There are 24 leads on the LED array, and only Note that we do not use the first output of the 17 pins on the Arduino that we can easily use D2- This is because this pin is on as soon as the 13 and A So we are going to use an integrated is reset and this would lead to that column circuit called a decade counter to control each of being enabled for longer than it should be, making the columns in turn.
The layout for this is shown in Figure Software Be careful to check every connection as you The software for this project is quite short Listing plug your wires in because connections Project 16 , but the tricky bit is getting the timing accidentally swapped over produce very strange right, because if you do things too quickly, the and hard-to-debug results.
This causes a blurring of colors. On the other hand, if you do things too slowly the display will flicker.
This is the reason for the calls to delayMicroseconds. Each digit will be 0 for off, 1 for green, 2 Apart from that, the code is fairly for red, and 3 for orange. So typing a straightforward. When designing patterns to display, it is a good idea to write out the lines in a text editor or word Putting It All Together processor and then paste the entire pattern into the Load the completed sketch for Project 16 from Serial Monitor.
As soon as it is a connected to the USB port and has reset, you b should see a test pattern of a green outer ring with c a red ring inside that and then a block of orange in d the center.
This should clear the display. These have the advantage that c d they come with built-in driver electronics, so a lot e of the work is already done for us and we do not f have to poll round each digit, setting each segment.
Each character is made up of an array of 7 by 5 segments. So it is just as This is a really good project for the Evil Genius well that we do not have to drive each segment to experiment with. You may like to try and separately. Figure 2 by 16 LCD module. This means we just have to tell it which shown in Figure and the breadboard layout in character to display where on the display.
As you can see, the only components We need just seven digital outputs to drive the required are the LCD module itself and a resistor display.
Four of these are data connections and to limit the current to the LED backlight. The LCD there is a standard library that we can use. To reduce the number of pins required, we do not use these. Project 17 The easiest way to attach the LCD module to USB Message Board the breadboard is to solder header pins into the This project will allow us to display a message on connector strip, and then the module can be an LCD module from our computer. There is no plugged directly into the breadboard.
Listing Project Arduino Diecimila or The loop reads any input and if it is a Duemilanove board or clone 1 character clears the display. In your Arduino Sketchbook and download it to the the next chapter we will look at projects that use board see Chapter 1. We can now try out the project by opening the Serial Monitor and entering some text.
Later on in Project 22, we will be using the LCD panel again with a thermistor and rotary encoder to make a thermostat. The result will look something like Figure This project reads values from the analog input and sends them over USB to your computer. Rather than be received by the Serial Monitor, they Project 18 are received by a little program that displays them Oscilloscope in an oscilloscope-like manner. As the signal changes, so does the shape of the waveform.
An oscilloscope is a device that allows you to see an electronic signal so that it appears as a Note that as oscilloscopes go, this one is not waveform. A traditional oscilloscope works by going to win any prizes for accuracy or speed, but amplifying a signal to control the position of a dot it is kind of fun.
Figure Hz noise on oscilloscope. Arduino Diecimila or Duemilanove board or clone 1 There are two parts to the circuit.
They are just like a voltage divider. This is the first time we have used capacitors. R3, R4, C2, and C3 just provide a stable C1 can be connected either way round; however, reference voltage of 2.
The reason for this is so C2 and C3 are polarized and must be connected that our oscilloscope can display both positive and the correct way round, or they are likely to be negative signals. So one terminal of our test lead is damaged. As with LEDs, on polarized capacitors, fixed at 2. A positive voltage will mean a the schematic symbol is longer than the negative value at the analog input of greater than 2.
The negative lead also often has a — minus a negative value will mean a value at the analog or diamond shape next to the negative lead. Figure shows the completed oscilloscope. Figure Schematic diagram for Project Software of dividing it by four and making it fit into a single byte. The sketch is short and simple Listing Project Its only purpose is to read the analog input and We obviously need some corresponding blast it out to the USB port as fast as possible.
Simone rated it it was amazing Dec 10, Nooor rated it it was amazing Mar 03, Ahmed rated it really liked it May 18, Nikhil Amane rated it it was amazing Jul 04, Toan Pham rated it really liked it Aug 11, Brendan rated it really liked it Feb 17, Miles added it May 04, Rob added it Apr 02, Hamed Abbasi marked it as to-read May 02, Akbar Abbas added it May 03, Jon Hutty marked it as to-read May 11, Siddhant Unavane marked it as to-read May 17, Joe Lawrence marked it as to-read Oct 23, Bitethedream marked it as to-read Feb 20, Semiconductor added it May 11, Abbas Warsi marked it as to-read May 19, Cordula is currently reading it Sep 09, Mostafa Sadek marked it as to-read Sep 26, Lisa marked it as to-read Nov 18, Vasily marked it as to-read Jan 22, Chandra Shekhar added it Sep 06, Davian Dawson marked it as to-read Sep 28, Michael Wais is currently reading it Oct 02, Amine marked it as to-read Oct 25, Neel marked it as to-read Nov 08, Srkoder marked it as to-read Jan 21, Burak Zafer marked it as to-read Feb 23, Radium marked it as to-read Mar 26, Sujay marked it as to-read Oct 25, Sudipto Choudhuri marked it as to-read Nov 26, Juan marked it as to-read Dec 31, Casseroll marked it as to-read Jul 20, Ethan MacDonald marked it as to-read Dec 30, High-Tech Moulero marked it as to-read Dec 31, Noura marked it as to-read Jan 14, Munkhbat marked it as to-read Apr 29, There are no discussion topics on this book yet.
About Gavin D. Gavin D. He went on to study towards Gavin D. He also holds the Diploma of Vilnius University, Lithuania. Other books in the series. Evil Genius 1 - 10 of 37 books.
Books by Gavin D.Figure Photograph of complete breadboard for Project 4. Siddhant Unavane marked it as to-read May 17, Power Summary up your board and test it out.
Sensing Light A common and easy-to-use device for measuring light intensity is the light-dependent resistor or LDR. Holography Projects for the Evil Genius Features step-by-step instructions and helpful illustrations for each project Allows you to customize your projects Includes details on the scientific principles behind the projects Removes the frustration factor--all required parts are listed, along with sources Enlightening coverage of: There are little linking wires between the left use multicore wire, as it will tend to bunch up and right halves of the GND strip, as on this when you try to push it into the breadboard holes.
The lock will stay unlocked until we infrared message from an existing remote control press the key. The Software only other components are the switch and its This sketch is fairly straightforward; there are a associated pull-down resistor. If there is no change the knob has allows the function to retain the values between not been turned , it returns 0.
Note how we use a variable declaration in When using LEDs, for best effect, try and pick our sketch to make it easier to change the pin used LEDs of similar brightness.