Brian Petrowicz

                                                                                                                        Robotics 1

                                                                                                                        Lab 3

The Clapper

 

To create Harold "Doc" Edgerton's strobe experiment, I used the piezo as a microphone instead of a beeper.  I connected the peizo from the UML dev board to Portc 0 of the Logo chip with a 10k resistor pulling it to ground.  I wired eight LED’s to Portb 6.  The basic circuit can be seen below in Fig 1.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This circuit, when hearing a loud noise, causes the LED’s to flash.  The way I have it wired above is not enough.  It will only light the LED’s when I flick the piezo.  I believe that this is due to the fact that clapping does not create enough of an output signal from the piezo to light the LED’s, a few hundredths of a volt.  By including an amplifier between the piezo and the input pin C0, the signal generated by the piezo will be made greater allowing the LED’s to light when a noise is made.  The amplifier would allow a wider range of noises to be seen through the LED’s.  A circuit diagram of an amplifier that could be used can be seen below:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Above is a picture of the circuit I created.  The code to cause the lights to flash when a sound is heard is the following:

 

            Constants

                        [[portb 6][portb-ddr $86]

                        [portc 7]]

 

            to blink

                        setbit 6 portb

                        wait 3

                        clearbit 6 portb

            end

 

            to init

                        write portb-ddr 0

            end

 

            to clap

                        waituntil [touch] blink

            end clap

            to touch

                        output testbit 0 portc

            end touch

 

            to slave

                        waituntil [newbus?]

                        if brcv = $180 [clap]

                        slave

            end slave         

 

            to start

                        init

                        slave

                        start

            end start

 

Then on the command line beep was used to execute the program.  When the PIC chip receives a signal from the piezo, it sets the pin B6 to a one, which lights the LED’s.  Placing this code in an infinite loop allows it to light the LED’s whenever it hears something loud enough. 

 

The code that I used on the Cricket was the simple command line: bsend $180 beep.  Hooking up the Logo Chip as a slave on the bus and adding a few lines of code allowed the Cricket to control the clapper.  The clapper would only respond to a clap if the Cricket told it that it could.  The Cricket would send a signal to the Logo chip to tell it that it could do what it wanted.  As long as the Logo chip did not receive this signal, it would sit idle.  Below is a picture of the Logo chip hooked up to the Cricket via a bus:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Only two wires are required to hook up the Logo chip to the Cricket.  The black one is wired to ground and the white one is wired to Port B0.  Everything else is the same as in Figure 1.  In addition to having the Cricket tell the clapper when to respond, I was thinking of having the Logo chip send back a single bit telling the Cricket that it had completed successfully.  Upon receiving this bit, I was thinking of making the cricket display a random message on a 4 digit 7-segment LED display.