Show Posts
Pages: [1]
1  Using Arduino / Networking, Protocols, and Devices / The best way to troubleshoot rc-switch on: October 14, 2013, 11:48:06 pm
Hi,

I want integrate a 433Mhz siren in to Arduino (specifically the Arduino present on the BeagleBone cape that ships with the Ninja Block) so as far as I can tell this is all about rc-switch (warning big phone cam images):

https://dl.dropbox.com/u/2436853/alarm.jpg
https://dl.dropboxusercontent.com/u/2436853/alarm2.jpg

There is an atmega48v on there, the RX says 9931A on the PCB and has a cd4069ubm hex inverter being used I assume for the receiver.

Basically I have the remote and the siren, the remote actuates the siren, rc-switch sees the  button press as a 24bit code, I can see it but when I try to use the code to actuate the siren using rc-switch nothing happens, I believe RX and TX are implemented in different parts of rc-switch and so there could be stuff that RX OK but that doesn't TX properly?

I really want to get this to work but I have no idea where to start, I have access to a scope, logic analyzer and sdr as well as lots of Arduino boards and breakouts including 433Mhz, can somebody point me in the right direction please.

Thanks.

Richard
2  Using Arduino / Programming Questions / Re: Problem with my first program, please help. on: September 10, 2013, 03:33:31 am
Thanks Herbie56!
3  Using Arduino / Programming Questions / Re: Problem with my first program, please help. on: September 10, 2013, 02:46:00 am
Grumpy_Mike many thanks, that worked.

AWOL, sorry that came out wrong, the debug lines are not redundant for debugging.

Basically what happens now is the delay isn't working, I press either button and it works properly but doesn't stop after 15 seconds, my use of delay and break is perhaps wrong?

Thanks again guys!

Cheers
Richard
4  Using Arduino / Programming Questions / Re: Problem with my first program, please help. on: September 10, 2013, 02:24:58 am
Thanks AWOL, sorry I didn't know about code tags, that should be fixed.

I am not sure I understand about debug prints, if you mean that I should have bits of redundant code that spit the contents of variables out to the serial console, then my program doesn't have them, as the title says its it's my first sketch and I should add I am not a programmer and my programming skills are poor.

Thanks again.

Richard
5  Using Arduino / Programming Questions / Problem with my first program, please help. on: September 10, 2013, 02:14:36 am
Hi

Thanks for taking a look.

I have an Arduino 2560, two L298N boards and two momentary switches all connected up, I think I have just made some kind of simple error in the code.

Basically when I push the first button, I want all four motor connected to the two L298N boards to move the motors in the open louvres direction for 15 seconds.  When I push the second button close the louvres.

When I push the buttons nothing happens.

Buttons are connected to 5v and one to digital pin 50 the other digital pin 51, no external resistor is being used just INPUT_PULLUP.

5v-----switch-----switch
           \            \--------pin 51
            \-------pin 50

I wired both switches from a single 5v pin because I have run out of 5v pins.

I did basic testing before adding in the buttons and the Arduino was sending the right signals to the L298N boards, as I could see the LEDs lighting properly and measure the voltage on the motor outputs.

The sketch verifies and uploads.

Thanks again.

Richard
Code:
// motor A
int AIN1=30;
int AIN2=31;
int AENA=42;
// motor B
int BIN1=32;
int BIN2=33;
int BENA=43;
// motor C
int CIN1=34;
int CIN2=35;
int CENA=44;
// motor D
int DIN1=36;
int DIN2=37;
int DENA=45;
// switches
int OPEN=50;
int CLOSE=51;
void setup()
{
// set all pins
 pinMode(AIN1,OUTPUT);
 pinMode(AIN2,OUTPUT);
 pinMode(AENA,OUTPUT);
 pinMode(BIN1,OUTPUT);
 pinMode(BIN2,OUTPUT);
 pinMode(BENA,OUTPUT);
 pinMode(CIN1,OUTPUT);
 pinMode(CIN2,OUTPUT);
 pinMode(CENA,OUTPUT);
 pinMode(DIN1,OUTPUT);
 pinMode(DIN2,OUTPUT);
 pinMode(DENA,OUTPUT);
 pinMode(OPEN,INPUT_PULLUP);
 pinMode(CLOSE,INPUT_PULLUP);
}

void louvre_command(int mode) {
switch(mode) {

case 1:
// close louvre
digitalWrite(AENA,HIGH);// motor A enable
digitalWrite(AIN1,LOW);// rotate back
digitalWrite(AIN2,HIGH);
digitalWrite(BENA,HIGH);// motor B enable
digitalWrite(BIN1,LOW);// rotate back
digitalWrite(BIN2,HIGH);
digitalWrite(CENA,HIGH);// motor C enable
digitalWrite(CIN1,LOW);// rotate back
digitalWrite(CIN2,HIGH);
digitalWrite(DENA,HIGH);// motor D enable
digitalWrite(DIN1,LOW);// rotate back
digitalWrite(DIN2,HIGH);
delay(15000);

break;
case 2:
// open louvre
digitalWrite(AENA,HIGH);// motor A enable
  digitalWrite(AIN1,HIGH);// rotate forward
  digitalWrite(AIN2,LOW);
digitalWrite(BENA,HIGH);// motor B enable
  digitalWrite(BIN1,HIGH);// rotate forward
digitalWrite(BIN2,LOW);
digitalWrite(CENA,HIGH);// motor C enable
digitalWrite(CIN1,HIGH);// rotate forward
digitalWrite(CIN2,LOW);
digitalWrite(DENA,HIGH);// motor D enable
digitalWrite(DIN1,HIGH);// rotate forward
digitalWrite(DIN2,LOW);
delay(15000);

break;


}
}

void loop() {
// Getting data from the buttons
int open_press = digitalRead(OPEN);
int close_press = digitalRead(CLOSE);

// the logic


if(open_press == LOW && close_press == HIGH) {
louvre_command(2);
}

if(open_press == HIGH && close_press == LOW) {
louvre_command(1);
}

if(open_press == LOW && close_press == LOW) {
                // Do nothing....
// louvre_command(0);
}

if(open_press == HIGH && close_press == HIGH) {
// Do nothing....
// louvre_command(0);
}

delay(500);
}
6  Using Arduino / Project Guidance / Re: Flowmeter on: March 21, 2013, 07:46:18 pm
Thanks again Nick, the problem is I am not sure how to "intercept" and siphon off some of the 7V, its a shield and so it fits on the top of the Mega snugly...

This http://arduino.cc/en/uploads/Main/PoE-datasheet.pdf came soldered on to http://arduino.cc/en/Main/ArduinoEthernetShield making the shield I bought:

http://littlebirdelectronics.com/products/arduino-ethernet-shield-with-poe-module

Richard
7  Using Arduino / Project Guidance / Re: Flowmeter on: March 21, 2013, 07:22:09 pm
Thanks Nick!

It's 802.3AF so I think it is around 48V that goes in to a special part of the PoE version of the ethernet shield that drops it down to something like 7V, my switch sends the voltage directly to the ethernet shield.

Richard

8  Using Arduino / Project Guidance / Flowmeter on: March 21, 2013, 06:33:20 pm
G'day,

I am fairly new to all this and would really appreciate some help smiley

I have a flowmeter, the Blue-White Digi-Flo F-2000, it's this version:

Output type - current sinking type hall effect sensor (13.5mA max). Pull-up resistor is recommended. 5k ohm across red & bare wires. Approximately 10 to 350 Hz operating range.

Basically it has a cable with:

RED  Input Supply Voltage (+ 6 to 24 Vdc)
BARE Signal Output (square wave)
BLACK  Ground (-)

I would really appreciate info on how to wire it to my Mega with ethernet PoE shield, the idea being I want to power both the Arduino and the flowmeter with PoE.

I also bought a Pololu Adjustable Boost Regulator 4-25V to get the 5v on the Arduino up to a more useful voltage.

Also any tips on the sketch would be much appreciated!

Thanks in advance!

Richard
9  Using Arduino / Project Guidance / Re: Pool Chemical Measurements on: February 10, 2013, 12:36:42 am
Spooky, I just became the owner of a pool and was thinking along the same lines.

Floating measurement device
Solar powered with battery and charging circuit
Arduino
433Mhz Wireless

Initially I think these functions are important:
Ph sensor
Temp sensor

These would be cool:
A way to detect the water level - maybe the anchor being permanently on the bottom could have a REALLY accurate depth sensor or maybe a couple of magnets attached to the side of the pool and the floating lab can work out the level using a magnetic sensor?
Chlorine level - these sensors appear to be expensive, so probably too hard?
A way to detect the force of water coming out of the main pump outlet (to tell you the skimmer is blocked, the sand filter needs a backwash or the pump has issues) - the floating lab could be anchored next to the outlet and there could be a paddle that is moved by the water?

I am keen to get something happening here, thoughts?

Thanks.

Richard
Pages: [1]