Experiment 35: Checking the Real World

Chapter Experiment 35: Checking the Real World

Make Electronics Book Learning by Discovery
Pages 351
Views 5,055
Downloads : 27 times
PDF Size : 9.7 MiB

Summary of Contents

Make Electronics Book Learning by Discovery

  • Experiment 35: Checking the Real WorldChapter 5306Experiment 35: Checking the Real WorldOften we want a microcontroller to measure something and respond in an appropriate way. For instance, it can measure a low temperature and sound an alarm, as I suggested in the example that I gave earlier.The PICAXE has three analog-to-digital converters (ADCs) built in, accessible via logic pins 1, 2, and 4, as shown in Figure 5-139. The best way to use them is by applying a potential somewhere between 0 and 5 volts. In this experiment, I’ll show you how to calibrate the response of the chip.You will need:• Trimmer potentiometer, 2K. Quantity: 1.• PICAXE 08M chip and associated USB cable and socket. Quantity: 1 of each.ProcedureTake the same trimmer potentiometer that you used in 283,Experiment 32 and wire its center terminal to Logic Pin 2 of the PICAXE (which is hardware pin 5). The other two terminals of the 2K trimmer go to positive and to negative, respectively. So depending how you set the trimmer, the pin of the PICAXE is directly connected to positive (at one end of the scale), or directly connected to negative (at the other end of the scale), or somewhere in between. See Fig-ure 5-144 for the revised schematic, and Figure 5-145 for a photograph of the breadboarded circuit.3302K10K12345678PICAXE08Mcba22KFigure 5-144. This schematic, drawn in a layout suitable for breadboarding, shows how a 2K potentiometer can be used to apply a varying voltage to one of the pins of the PICAXE that is capable of converting an analog signal to a digital value.Figure 5-145. The trimmer potentiometer added to the previ-ously breadboarded circuit.