Show Posts
Pages: 1 2 [3] 4 5 ... 9
31  Using Arduino / Sensors / Re: Using a Piezeo Element to read analog values on: July 19, 2013, 08:59:34 pm
OK I have found that if I put a 1M resister between the Red + Black legs of the Piezieo element then I get good data.

Thanks for the info on the knock sensor - it helped but I found it on a youtube video and not on here.

cheers


I have also changed the loop to

Code:
void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);  
if (sensorValue >= 5)  
  Serial.println(sensorValue);
  // turn the ledPin on
  delay(100);                  
  
}

So I now have

A0 connected to 1 Leg of 1M resister and then connected to RED leg of Piezo
GND connected to other leg of 1M and then connected to BLACK leg of Piezo



chris
32  Using Arduino / Sensors / Using a Piezeo Element to read analog values on: July 19, 2013, 07:35:54 pm
Hi

I am using an UNO and a piezeo element connected directly between ground and A0



The additional wires (red + orange) are only being used to hold the very small Piezeo wires in place - nothing else.

My code is

Code:

int sensorPin = A0;    // select the input pin for the potentiometer
int sensorValue = 0;  // variable to store the value coming from the sensor

void setup() {
  // declare the ledPin as an OUTPUT:
  pinMode(ledPin, OUTPUT);  
  
  Serial.begin(9600);
}

void loop() {
  // read the value from the sensor:
  sensorValue = 1023-analogRead(sensorPin);    
  // turn the ledPin on
  
  Serial.println(sensorValue);

delay(100);
}

This runs full speed and generally returns 0 if nothing is going on. But if I touch/tap the piezeo element it changes values say jumps to 600 and then slowly reduces back to 0.

This reduction to 0 can take 30 seconds.

I would have expected a much quicker drop to 0

If I was using this to record audio (such as a rain drop or hail) I would need much quicker reduction to 0 since one strong hail stone would be only a few ms not 30 seconds.

Any ideas on what I need to ensure a quicker drop and why it is doing this?

Could there really be that much energy being released over 30 seconds?

Chris
33  Community / Products and Services / Re: Xboard Relay: making Internet Of Things easy (iphone ready) on: July 09, 2013, 02:31:09 pm
You say the relay board is discounte to $17.00 but your web site does not offer this price!

Chris
34  Using Arduino / LEDs and Multiplexing / Re: Driving LEDs from external power supply on: April 21, 2013, 02:34:42 pm
Thanks for your comments - it has helped me a lot.

Cheers

Chris
35  Using Arduino / LEDs and Multiplexing / Driving LEDs from external power supply on: April 20, 2013, 11:39:46 pm
I have a basic understanding of leds and current but I always confuse myself when working out how much power something will use.

I am looking at creating a LED lighting unit for my aquarium.

I am looking at this Arduino Shield - Arduino 6 channel led shield 0,35-0,7-1A

So it can be configured to run at:
  • 350ma
  • 700ma
  • 1000ma



It can be bought on EBAY at this http://www.ebay.com/itm/Arduino-6-channel-led-shield-3-currents-can-be-set-0-35-0-7-1A-/370745850727?pt=LH_DefaultDomain_0&hash=item56522cbb67#ht_401wt_892

It requires external power.

I assume from this I can run all channels at 1amp - which would require 6 amps.

So I have been looking at power supplies as well on Ebay

I could buy an external power supply like 24v @10a @ 240w but I could also buy a power supply like 24v @5a @120w

So 5 amp may be able at a stretch run to 6 amp, but if I was only running 4 amp is there a negative to me buying the 10amp version?

Will it cost me more electricity to run? Or is it just capable of producing more power?

Also when talking about LEDs:

If I want to run 1 channel at 700ma and 1 led can consume 700ma does that means I can only run 1 led on this channel?

If I wanted to run 10 leds on a single 700ma channel does that mean each led although could consume 700ma each led will now will only get 70 ma?

Chris
36  Using Arduino / Sensors / Re: Trying to control Mitsubishi Heat Pump Air Conditioning Unit on: April 09, 2013, 11:44:10 pm
I am not getting to far.

I have gone though 24 hours of values for the ON TIMER, with the off timer set to the same value.



So far I am not seeing a good pattern for the times.

Chris
37  Using Arduino / Sensors / Re: Trying to control Mitsubishi Heat Pump Air Conditioning Unit on: April 09, 2013, 11:03:56 pm
2. When I use the timer buttons "sleep" "on" "off" the raw code jumps from 180 to 255.
Can you replicate this?

Hi

There are infact 276 bits returned.

You need to modify the IRREMOTE.H file to increase the buffer

#define RAWBUF 276

And this time you need to modify the structure in IRREMOTEINT.H

typedef struct {
  uint8_t recvpin;           // pin for IR data from detector
  uint8_t rcvstate;          // state machine
  uint8_t blinkflag;         // TRUE to enable blinking of pin 13 on IR processing
  unsigned int timer;     // state timer, counts 50uS ticks.
  unsigned int rawbuf[RAWBUF]; // raw data
  unsigned int rawlen;         // counter of entries in rawbuf

  //uint8_t rawlen;         // counter of entries in rawbuf
}
irparams_t;

Change the uint8_t rawlen to an unsigned int as shown above.

The uint8 is in fact an unsigned char = so its values are limited to 0 - 255.

This will now allow you to return the full 276 bits of binary data.

I have had a quick look but not yet decoded the additional 96 bits of data.

I will keep you posted.

Chris
38  Using Arduino / Sensors / Re: Trying to control Mitsubishi Heat Pump Air Conditioning Unit on: April 09, 2013, 11:52:31 am
Hi

Yes I have seen the extra data bits that when uou use the timer functions, on time, off the etc.

Since I was not interested I ignored it, I was more interested in the base data functions only.

I did not look into it but the start time and end time are encoded into those bits and the sleep settings as well.

In regards to your Q1

I know I can not set fan speeds with powerful and Eco but I am unsure in what context you mention this?

Chris
39  Using Arduino / Motors, Mechanics, and Power / Re: I am unsure where to start with Stepper Motors on: April 06, 2013, 10:27:15 pm
Thanks Jim
40  Using Arduino / Motors, Mechanics, and Power / I am unsure where to start with Stepper Motors on: April 06, 2013, 10:17:49 pm
I am unsure where to start with Stepper Motors.

Basically I have some ideas and I am unsure where to start and where to find good information for a new-be to learn by.

How do I determine what size stepper motor is needed? How do I determine what size driver is needed?  I know it depends on the purpose.

I guess I am looking for a motor 101 type of site on stepper motors and drivers.

I see lots of cheap stuff on EBAY and I buy most of my stuff from EBay as it is cheap - just takes 4+ weeks delivery to NZ.

Any links would be appreciated to good sites explaining this.

cheers

Chris
41  Topics / Home Automation and Networked Objects / Re: iPhone controlled universal remote on: April 06, 2013, 08:20:22 pm
Dd you get a chance to try a different remote?

Does the different remote also show strange patterns?

Chris
42  Topics / Home Automation and Networked Objects / Re: iPhone controlled universal remote on: April 06, 2013, 07:11:08 pm
I also came across this which may help you but not until we determine why you are getting strange values.

http://www.hifi-remote.com/sony/

chris
43  Topics / Home Automation and Networked Objects / Re: iPhone controlled universal remote on: April 06, 2013, 07:05:28 pm
Can you change it so it uses the actual value instead of 0 and 1

Search the script for

 if (1==0)

and change to

  if (1 == 1)

When you run it you will get raw values which may or may not help.


Also try the code with different remotes - if you are still getting garbage then

* What pin is your sensor connected to?
* Have you got another sensor to try?


Chris
44  Topics / Home Automation and Networked Objects / Re: iPhone controlled universal remote on: April 06, 2013, 03:49:21 pm
I just commented out my FixTimer function from the previous reply

and using the raw output of numbers I was getting this

Code:
47  12  11  12  12  12  12  12  11  12  12  12  12  11  12  12  23  12  12  12  12  12  11  13  11
 47  12  12  11  12  12  12  12  11  12  12  12  12  11  12  12  24  11  12  12  12  12  11  13  11
 48  12  11  12  12  12  12  11  12  12  12  12  11  12  12  12  23  12  12  12  12  11  12  12  12
 47  12  24  11  12  12  12  12  11  12  12  12  12  11  12  12  24  11  12  12  12  12  11  12  12
 47  12  24  11  12  12  12  12  11  12  12  12  12  12  11  12  24  11  12  12  12  12  12  11  12
 47  12  23  12  12  12  12  11  12  12  12  11  12  12  12  12  23  12  12  12  12  11  12  12  12

You can see then numbers 11 and 12 and 3 and 24 - so this slight difference may be something you are seeing?

Chris
45  Topics / Home Automation and Networked Objects / Re: iPhone controlled universal remote on: April 06, 2013, 03:36:41 pm
Using a Sony TV Remote I get results like this - quite repeatable

The following is pressing the buttons 1-6 (the repeat codes represent what is being sent out the IR transmitter - the longer you hold it down the more it repeats) In my case a quick press generated 3 repeats.

Code:
1000000000000000100000000
1000000000000000100000000
1000000000000000100000000

1010000000000000100000000
1010000000000000100000000
1010000000000000100000000

1000100000000000100000000
1000100000000000100000000
1000100000000000100000000

1010100000000000100000000
1010100000000000100000000
1010100000000000100000000

1000001000000000100000000
1000001000000000100000000
1000001000000000100000000

1010001000000000100000000
1010001000000000100000000
1010001000000000100000000

Here is my simple script

Code:
#include <Arduino.h>
#include <IRremote.h>

// Receive on Digital Pin 4
int RECV_PIN = 4;

decode_results results;
int incomingByte = 0;
IRrecv irrecv(RECV_PIN);

void setup()
{

/* add setup code here */
Serial.begin(57600);
Serial.println("Startimg....");

irrecv.enableIRIn(); // Start the receiver


}

void loop()
{
if (irrecv.decode(&results)) {
int count = results.rawlen;

// Skip the first byte - just a timing since last packet recevied.

for (int i = 1; i < count; i++) {

if (1==0)
{

if (results.rawbuf[i]< 10)
Serial.print("  ");
else if (results.rawbuf[i]< 100)
Serial.print(" ");
Serial.print(results.rawbuf[i]);
Serial.print(" ");
}
else {
if (results.rawbuf[i] == 8)
Serial.print("0");
else
Serial.print("1");
}
}
Serial.println("");
irrecv.resume(); // Receive the next value
}
}



In my code you will see it displays a binary 0 or 1 depending if the value is 8 or not. This could change depending on the device.

So to test that out change the code that says if (1==0) to if (1 == 1) in the script to use that section of the code which prints out the actual values read.


Special Note:

I have also modified the code in the IRRemote.cpp file in the IRRemote library to return values that do not change so much.

Basically when it saves values it calls this function to fix up the values to make them consistent.

Code:
unsigned int fixTimer(unsigned int t)
{
if (t <  20)
return 8;
else if (t < 31)
return 24;
else if (t < 33)
return 32;
else
               return t;
}


See http://wiki.crowe.co.nz/Mitsubishi%20Heat%20Pump.ashx to see what I changed.

This could explain why you are seeing different values - using the code on my wiki page I get consistent values of 8 and 24 on the Sony remote.

Chris
Pages: 1 2 [3] 4 5 ... 9