Programming Video Games for the Evil Genius. Recycling Projects for the Evil Genius. Solar Energy Projects for the Evil Genius. Telephone Projects for the Evil . 19MB Size Report. DOWNLOAD PDF tinyAVR Microcontroller Projects for the Evil Genius (Evil Genius Series). Read more Recycling Projects for the Evil Genius Bionics for the Evil Genius: 25 Build-it-Yourself Projects. Read more. Recycling Projects For The Evil Genius. Ebook Recycling Projects For The Evil Genius currently available at usaascvb.info for review only, if you need complete .
|Language:||English, Spanish, Indonesian|
|Genre:||Business & Career|
|Distribution:||Free* [*Registration needed]|
To save Recycling Projects for the Evil Genius eBook, make sure you refer to the link collection that gives use of great number of PDF file document collection. To save Recycling Projects for the Evil Genius eBook, please refer to the web link below and This is actually the greatest pdf i have got go through until now. PROJECTS Electronic gadgets for the evil genius / Bob Iannini. p. cm. This book is printed on recycled, acid-free paper containing a minimum of 50 percent .
Many microcontroller boards use separate programming hardware to get programs into the microcontroller. This also has the advantage that you can use the USB connection to pass data back and forth between an Arduino board and your computer. For instance, you could connect a temperature sensor to the Arduino and have it repeatedly tell your computer the temperature.
On the older Diecimila boards, you will find a jumper switch immediately below the USB socket. With the jumper fitted over the top two pins, the board will receive its power from the USB connection.
When over the middle and bottom pins, the board will be powered from an external power supply plugged into the socket below. On the newer Duemilanove boards, there is no such jumper and the supply switches automatically from USB to the 9V socket.
The power supply can be any voltage between 7 and 12 volts. So a small 9V battery will work just fine for portable applications. Typically, while you are making your project, you will probably power it from USB for convenience. When you are ready to cut the umbilical cord disconnect the USB lead , you will want to power the board independently. This may be with an external power adaptor or simply with a 9V battery connected to a plug to fit the power socket.
There are two rows of connectors on the edges of the board. The bottom row of connectors has useful power connections on the left and analog inputs on the right. It is possible to download ready-made shields for many different purposes, including:. Duemilanove is Italian for , the year of its release. The older Diecimila name means 10, in Italian, and was named that after 10, boards had been manufactured.
Most compatible boards such as the Freeduino are based on the Diecimila and Duemilanove designs. Most of the projects in this book will work with a Diecimila, Duemilanove, or their clone designs, apart from one project that uses the Arduino Lilypad.
When you are making a project with an Arduino, you will need to download programs onto the board using a USB lead between your computer and the Arduino. This is one of the most convenient things about using an Arduino.
Many microcontroller boards use separate programming hardware to get programs into the microcontroller.
This also has the advantage that you can use the USB connection to pass data back and forth between an Arduino board and your computer. For instance, you could connect a temperature sensor to the Arduino and have it repeatedly tell your computer the temperature.
On the older Diecimila boards, you will find a jumper switch immediately below the USB socket. With the jumper fitted over the top two pins, the board will receive its power from the USB connection. When over the middle and bottom pins, the board will be powered from an external power supply plugged into the socket below. On the newer Duemilanove boards, there is no such jumper and the supply switches automatically from USB to the 9V socket.
The power supply can be any voltage between 7 and 12 volts. So a small 9V battery will work just fine for portable applications. 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. We are using two integrated-circuit I Please note this is one of the projects in this variable voltage regulators to limit the current book that requires soldering.
I flowing to the LEDs. 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. 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. Chapter 4 I More LED Projects 53 In this version of the strobe light, we are going Hardware to control the strobe light effect from the computer See Project 4 the Morse code translator using a with commands.
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.