Show Posts
Pages: 1 2 [3] 4 5 ... 13
31  Using Arduino / Sensors / Re: Piezo sensor sensitivity. on: January 27, 2014, 12:07:13 pm
If it were my project I would use 2 or more piezos. At least one for soft taps and one for hard taps.
Each with its own conditioning circuit for it's range.
Taking the example from Taiko Trainer (LM358) link I posted above, I would go from there.
I have quite a few different piezos hanging around and have been able to get a nice pulse on a few that I tried using variants of those circuits.
Also, I would test the conditioning circuit while someone is dancing and make adjustments according to those readings.
Are you using a breadboard for the conditioning circuit?  Cleaner readings from PCB board.
Are you using a plain flat disk piezo? If so what size?
32  Using Arduino / Sensors / Re: Sum up the temperature in DHT11 sensor on: January 16, 2014, 11:46:01 am
Samples of what?
How are you determining the moisture content prior to drying?
Example: A saturated sponge weighs 10 oz. . Say it's weight is a combination of 8oz water and 2oz sponge material.
So when it has 50% of it's moisture content removed it will weigh 6 oz. .
33  Community / Bar Sport / Re: Thomas Edison vs Tesla on: January 14, 2014, 09:42:45 pm
High voltage high current DC can stop your heart.
Think of TV tube caps.
But while pondering the question, a bit of comic relief- Edison Vs Tesla
34  Using Arduino / Programming Questions / Re: Soil Moisture Sensor - Troubles! on: January 08, 2014, 06:34:49 pm
Try this simple sketch:
  # Example code for the moisture sensor
  # Editor     : Lauren
  # Date       : 13.01.2012
  # Version    : 1.0
  # Connect the sensor analog out to the A0(Analog 0) pin on the Arduino board
  # Connect the sensor VCC pin to 5v pin on Arduino the board
  # Connect the sensor GND pin to GND pin on the Arduino board.
  # the sensor value description
  # 0  ~300     dry soil
  # 300~700     humid soil
  # 700~950     in water

void setup(){

void loop(){
  Serial.print("Moisture Sensor Value:");
35  Using Arduino / Sensors / Re: corrosion proof electrode material for soil humidity sensor? on: January 08, 2014, 06:17:31 pm
Post a pic, could be salt or mineral build up from fertilizer in the soil.
36  Using Arduino / Project Guidance / Re: rotary encoder limiting on: January 08, 2014, 12:36:10 pm
Try this:
/* interrupt routine for Rotary Encoders

 The average rotary encoder has three pins, seen from front: A C B
 Clockwise rotation A(on)->B(on)->A(off)->B(off)
 CounterCW rotation B(on)->A(on)->B(off)->A(off)

 and may be a push switch with another two pins, pulled low at pin 8 in this case


// usually the rotary encoders three pins have the ground pin in the middle
enum PinAssignments {
  encoderPinA = 2,   // right (labeled DT on our decoder, yellow wire)
  encoderPinB = 3,   // left (labeled CLK on our decoder, green wire)
  clearButton = 8    // switch (labeled SW on our decoder, orange wire)
                // connect the +5v and gnd appropriately

volatile byte encoderPos = 0;  // a counter for the dial
byte lastReportedPos = 1;   // change management
static boolean rotating = false;    // debounce management

// interrupt service routine vars
boolean A_set = false;
boolean B_set = false;

int pressCount = 0;

void setup() {

  pinMode(encoderPinA, INPUT_PULLUP); // new method of enabling pullups
  pinMode(encoderPinB, INPUT_PULLUP);
  pinMode(clearButton, INPUT_PULLUP);
  pinMode(9, OUTPUT);
  pinMode(13, OUTPUT);
  // turn on pullup resistors (old method)
  //digitalWrite(encoderPinA, HIGH);
  // digitalWrite(encoderPinB, HIGH);
  // digitalWrite(clearButton, HIGH);

  // encoder pin on interrupt 0 (pin 2)
  attachInterrupt(0, doEncoderA, CHANGE);
  // encoder pin on interrupt 1 (pin 3)
  attachInterrupt(1, doEncoderB, CHANGE);

  Serial.begin(9600);  // output

// main loop, work is done by interrupt service routines, this one only prints stuff
void loop() {
  rotating = true;  // reset the debouncer

  if (lastReportedPos != encoderPos) {
    Serial.println(encoderPos, DEC);
    lastReportedPos = encoderPos;
  if (digitalRead(clearButton) == LOW )  {
     pressCount ++;
     //Reset count if over max mode number
     if(pressCount > 2)
     pressCount = 0;
     switch (pressCount) {

     case 0:
     digitalWrite(13, LOW);
     case 1:
     case 2:
     digitalWrite(13, HIGH);

    encoderPos = 0;
  switch (encoderPos) {

    case 0:
      digitalWrite(9, LOW);
      digitalWrite(13, LOW);

    case 1:
      digitalWrite(9, LOW);
      digitalWrite(13, HIGH);

    case 2:
      digitalWrite(13, LOW);
      digitalWrite(9, HIGH);
    case 3:
      digitalWrite(13, LOW);
      digitalWrite(9, HIGH);


// Interrupt on A changing state
void doEncoderA() {
  // debounce
  if ( rotating ) delay (1);  // wait a little until the bouncing is done
  // Test transition, did things really change?
  if ( digitalRead(encoderPinA) != A_set ) { // debounce once more
    A_set = !A_set;
    // adjust counter + if A leads B
    if ( A_set && !B_set && encoderPos != 5)
      encoderPos += 1;
    if ( A_set && !B_set && encoderPos == 5)
      encoderPos = 0;

    rotating = false;  // no more debouncing until loop() hits again

// Interrupt on B changing state, same as A above
void doEncoderB() {
  if ( rotating ) delay (1);

  if ( digitalRead(encoderPinB) != B_set) {
    B_set = !B_set;
    //  adjust counter - 1 if B leads A

    if ( B_set && !A_set && encoderPos == 0)
      encoderPos = 5;
    if ( B_set && !A_set )
      encoderPos -= 1;

    rotating = false;
Works well for limiting encoder, sketch is set for a limit of 4.
Check on serial monitor.
37  Using Arduino / Sensors / Re: Piezo sensor sensitivity. on: January 07, 2014, 10:58:59 am
I used a LM386 amp module like this one.
If you are planning on using a speaker and don't have the above module then connect the LM386 chip like the circuit shows here.
If you plan on feeding the signal to an analog pin then use a LM358 like in the circuits described here .
38  Using Arduino / Sensors / Re: corrosion proof electrode material for soil humidity sensor? on: January 06, 2014, 10:52:16 am
Check out this soil sensor using 316 stainless probes, there's a sketch at the bottom of the page and instructions, maybe you can get some ideas from there.
39  Using Arduino / Sensors / Re: corrosion proof electrode material for soil humidity sensor? on: January 05, 2014, 06:42:29 pm
Stainless is great, electric fence wire works well.
40  Using Arduino / Sensors / Re: MQ-7 CO Module Setup on: January 04, 2014, 11:37:03 am
No and no, like I said here "You wire that module right to your Arduino, all needed components are on the module."
Gnd pin -> Gnd on module, 5V pin -> VCC pin on module, Analog pin -> AOUT pin on module.
41  Using Arduino / Sensors / Re: Piezo sensor sensitivity. on: January 04, 2014, 07:00:41 am
Glad to hear it's doing what you want.
That circuit is open to modifications depending on the piezo used.
I tried 4 different piezos and had to modify the circuit for each one to get a clean pulse.
As the author states "Be warned that piezo are all differents, and that size matters… So experiment with that before engraving the above stuff in copper."
 The way you have the circuit is fine, actually better if you are using the BAT85 diodes or any diode rated under 200V VRRM.
If you read the comments of that link Alan Burlison advises putting the zener in parallel first to protect the BAT85 diodes from over voltage. He also says the second diode isn't needed, I only found that to work with one of the piezos I tested.
So the circuit you used does this: Zener only allows 5.1xx volts to pass, diodes rectify to positive only voltage, RC filter cleans pulse.
**edit**In each test I checked the output using an oscilloscope to make sure it was a cleaned up pulse.
Were you able to test with an oscilloscope?
42  Using Arduino / Sensors / Re: 2 wire temperature sensor on: January 03, 2014, 04:43:40 pm
Do yo have 10 x 1k resistors?
If so put them in series for 10k, might be a bit messy on the breadboard but will do the job.
**Have a multimeter? Test the resistance of the sensor.
43  Using Arduino / Sensors / Re: 2 wire temperature sensor on: January 03, 2014, 02:19:53 pm
Try this tutorial.
44  Using Arduino / Sensors / Re: MQ-7 CO Module Setup on: January 03, 2014, 07:52:35 am
You wire that module right to your Arduino, all needed components are on the module.
Here is a tutorial for that family of sensors,use the AOUT pin on the MQ-7 module.
The trim cap is for adjusting DOUT.
Accurate calibration is difficult at home, the datasheet tells you to allow the module to pre-heat "No Less Than 48 Hours".
A good way to self calibrate is:
1.  Set your project up in the location that needs monitoring in a place where no one will be breathing on it.
2. Allow the 48+ hour pre-heat.
3. View the readings on the IDE serial monitor, that will be the areas "natural CO level" reading.
4. (Tricky part here) Determine the level of CO (IDE serial reading) needed to trigger an action.
5. Put your "trigger value" in the tutorial code here:
if (sensorValue >= 750)// Change 750 to your CO trigger limit

Hope this helps.
45  Using Arduino / Sensors / Re: Piezo sensor sensitivity. on: January 02, 2014, 10:54:44 pm
I tried this to amplify the "knock" a piezo picked up:
5.1v zener in parallel with piezo + 1N5819 in series > 1M ohm & 4.7nf cap in parallel> LM386 amp module 5V > speaker 8 ohm 1/2 watt
P++++5.1++1N5819+++1M++4.7+++++L++++++/ |
i           z                         O      N           M          /S |
e          e                         H       F           3          |  P  >
z          n                        M       |            8           \K |
o-Gnd-|----------------|-----|-------6--------\ |   
It amplified the signal just fine, could here it through the speaker but the tones produced from the piezo are very low.
I used the conditioner setup described by Alan Burlison from the comments of the link I posted earlier.
It really cleans up the piezo pulse no "ring like a bell" effect as you described earlier, it produces a signal from a few mV to 5.2V depending on "knock" intensity.
Pages: 1 2 [3] 4 5 ... 13