Interface a vibration sensor with a microcontroller

Discussion in 'The Projects Forum' started by tomega3, May 15, 2012.

  1. tomega3

    tomega3 Thread Starter New Member

    Joined:
    May 7, 2012
    Messages:
    9
    Hi All,
    I am a software programmer with just enough knowledge to be dangerous when it comes to electronic circuits. I did electronics 25 years ago and have been doing only software since 1990. I found the arduino uno at radio shack and decided to see what I can do with it....

    So, I built a vibration sensor as listed here:
    http://forum.allaboutcircuits.com/showthread.php?t=46948&highlight=piezo 555&page=3

    I added a Set/Reset latch to the output of the 555 and a power on reset ckt for the 555 and the latch. The latch remembers that the 555 saw the vibration. The power on reset ckt has a NO switch to reset both the 555 and the latch.

    I now want to interface the output of the latch to an input pin on a microcontroller (arduino uno) and have an output on the microcontroller replace the NO switch so as to perform a Reset of the sensor circuit.

    The vibration sensor is powered by is own 9v battery and is isolated from the +v and gnd of the microcontroller. The microcontroller is powered by 5 volts. The microcontrollers Serial lines RX and TX are connected to a 16 x 2 serial lcd.
    Then sensor will be 25 yards away from the microcontroller.

    Goal: Have an output from microcontroller replace the NO switch and an input to read the state (high, low) of the latch.

    I have been reading that I should consider using an optoisolater (4N36 or PS2501) to ensure voltage and gnd isolation and a Mosfet (2N7000) to replace the NO Reset Switch. I am not sure if I need a Mosfet on the microcontroller side to read the output of the isolated latch and or need a Mosfet on the output of the latch to drive the optoisolator since the distance between the sensor and the microcontroller is over 50 feet.

    Can anyone suggest an interface circuit to a accomplish my goal?
    A schematic with part numbers would be great.

    Thanks
  2. tomega3

    tomega3 Thread Starter New Member

    Joined:
    May 7, 2012
    Messages:
    9
    I forgot to mention that the latch is made from a 555 in bistable configuration. I was hoping this had enough current to drive the optoisolator or the 50 to 75 foot distance.
  3. tomega3

    tomega3 Thread Starter New Member

    Joined:
    May 7, 2012
    Messages:
    9
    Here is a schematic of the latch and the pwr on reset ckt.

    Attached Files:

  4. tomega3

    tomega3 Thread Starter New Member

    Joined:
    May 7, 2012
    Messages:
    9
    I found some info on a Isolated 20 mA Current Loop Interface circuit using a HCPL4100 and HCPL4200. Am I on the right track?
    Thanks
  5. tomega3

    tomega3 Thread Starter New Member

    Joined:
    May 7, 2012
    Messages:
    9
    Not sure if this will help generate some responses to my post but here it goes:

    My project is for a knock sensor or hit sensor for an air pistol Iron Plate Action Shooting (IPAS) competition. The microcontroller will signal the user to begin and start a timer. When the first plate is struck, the controller will light a led, and so on for the next plates. When all plates have been hit or 30 seconds has elapsed, the timer will stop and the total elapsed time from start time to last hit time will be calculated and displayed. I am planing to use a digital output on the controller to send the Reset signal to the remote sensors and a digital input on the microcontroller to read each sensors hit status from the latch.

    I apologize for my statement about knowing just enough about electronics to be dangerous. In my past I learned that electronic components run on blue smoke and they stop working or worse if you let the smoke out.

    I am having fun working with electronics again after so many years. So much has changed but the basic principals remain the same. I would greatly appreciate any suggestions.
  6. absf

    absf Well-Known Member

    Joined:
    Dec 29, 2010
    Messages:
    1,032
    Location:
    Sarawak (GMT+8)
    I was watching this thread and was also wondering why there was no response from others....

    The connections between the vibrating sensor 555 to the 555 latch is not the problem cause you can try it out on a breadboard. For each circuit, you need 2 wires for detecting the 555 latch and 2 wires for reseting it since you wanted the circuit isolated from your mcu using opto-coupler. So I guess the real problem is due to the 25 yards distance.

    Why cant you just set up one target and try it on your Arduino and see if it works? It should be quite straight forward. How far away do you place your targets from each other? Can all the targets share the same 9V battery?

    Allen
  7. tomega3

    tomega3 Thread Starter New Member

    Joined:
    May 7, 2012
    Messages:
    9
    Thanks for your reply. I have bread boarded the sensor circuit and glued a piezo to a plate and connected it. It works. I used the latch in order to be able to see the 'hit' in case the pulse from the piezo was to short to see visually.

    I no longer have an oscilloscope. I had one years ago with capture capability and I really miss it.

    I use the reset switch to clear the latch so future 'hits' can be sensed.

    Each sensor circuit will have its own 6vdc or 9vdc power supply. It may be possible to share one 9vdc or 6vdc battery pack with all the sensors since the plates may be only 1 or two feet apart from each other with say 15 feet max between the farthest plates.

    The arduino will have its own power supply not connected in any way to the sensors thus the isolation via an optoisolator. I read that this protects the arduino and the sensor from damage.

    I chose a 20ma current loop line driver to drive a signal over a long distance and that it is less sensitive to noise on the data lines between the arduino and the sensors.

    I am currently looking at replacing the HCPL4100/4200 chips with RS485 chips like the MAX485 or maybe one that has optoisolation already build in to the 485 chip like a MAX3157.

    I will try to put of a schematic of the 485 driver circuit later today.

    Any suggestions are greatly appreciated.
  8. absf

    absf Well-Known Member

    Joined:
    Dec 29, 2010
    Messages:
    1,032
    Location:
    Sarawak (GMT+8)
    Both 20mA loop and RS485 are well capable of going the distance you want. 20mA is older and I saw a lot used in the Ericsson equipments in our AXE Exchange in the 80's. RS485 is also reliable due to its differential output nature. I have the chips but I haven't used them yet. I'll take a look at the datasheet again and see if there is any example.

    The next problem is the amount of ports in your Arduino uno. How many targets are you setting up? May be you need a bigger Atmega like 1280 or 2560 to handle all the targets.

    The Yamaha electronics drums also used piezo sensors on the drum pads. That's how I knew it when one of them went silent and was sent to me for repair. Some people used them for alarm sensors and mount them on windows and doors.

    Allen
    Last edited: May 19, 2012
  9. tomega3

    tomega3 Thread Starter New Member

    Joined:
    May 7, 2012
    Messages:
    9
    Thanks Allen for your post. An RS485 interface will be a lot cheaper than using the HCPL4100/4200 drivers. Any help connecting them up to an arduino and the 555 latch would be great.

    I plan to eventually have 5 or 6 plates with the vibration sensors so I think I may need to use an arduino mega because it has more digital io ports.

    I have a proposed rs485 circuit for one sensor interface that is attached below:

    Thanks in advance for any advise.

    Attached Files:

Similar Threads
Forum Title Date
The Projects Forum How do I interface audio amp to key encoder Monday at 2:14 PM
The Projects Forum CONFIGURATIONS HMI (HUMAN MACHINE INTERFACE) CITECH FOR PLC OMRON CP2M Oct 27, 2014
The Projects Forum Remote Control Rx to Motor Interface Circuit Oct 27, 2014
The Projects Forum JTAG interface: 20pin to 10pin convertor Jul 5, 2014
The Projects Forum MIPI Camera Interface Jun 18, 2014

Share This Page