Pages: [1]   Go Down
Author Topic: Arduino - Seeedstudio 433MHz module  (Read 2205 times)
0 Members and 1 Guest are viewing this topic.
Netherlands
Offline Offline
Sr. Member
****
Karma: 0
Posts: 414
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a Seeedstudio 433MHz tx/rx that I want to use with Arduino. The transmitter can be powered from 2-12V. Higher voltage, better range according to Seeedstudio.

I am not very good at drawing schematics with Eagle, but I threw together the one below.


I want to power the RF Transmitter with 12V, but not all the time. I want to switch power on and off through a transistor, a BV337-16 in this case. Switching is done through Arduino analog pin 2 (+5V) to collector and transistor emitter to analog pin 3 (GND). There is +12V at the base of the transistor. As soon as pin 2 goes high, the RF module should be powered with 5V.

At least, this is how I planned to do it. Is there anyone who can check the schematic and my explanation above to confirm it's correct?

Thanks in advance!
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 611
Posts: 49092
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why are you connecting to analog pins? Analog pins are for input. Digital pins are for input or output (HIGH or LOW being +5V or 0).
Logged

Netherlands
Offline Offline
Sr. Member
****
Karma: 0
Posts: 414
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using analog pins because I took the code from an example (Wiichuck adapter).
Logged

Offline Offline
Edison Member
*
Karma: 3
Posts: 1001
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It seems like you got your transistor wired wrong. Current flows from collector to emitter, switched through base.

So - connect RF/Vcc to +12V, RF/GND to collector, emitter to GND and Arduino pwr on/off pin (ana 2) to base through 2k2 resistor.

When you power the RF module you need to delay a minimum of 20ms before you send data.
Logged

Netherlands
Offline Offline
Sr. Member
****
Karma: 0
Posts: 414
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your reply BenF,

I have it like this now:


Pin description of RF Module:
Pin 1 - VCC
Pin 2 - Data
Pin 3 - GND
Pin 4 - Antenna

You mention a 2.2K resistor, I have 2.5K. Should I get a 2.2K for this?
Logged

Offline Offline
Edison Member
*
Karma: 3
Posts: 1001
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks good to go!

The transmitter needs about 60mA at 12V and with your transistor's minimum Hfe at 100 you get away with anything less than 7k for a base resistor. That is 2.5k will be just fine.

Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17293
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't forget you will need a ground connection between the +12vdc supply and the Arduino ground.

Lefty

Logged

Netherlands
Offline Offline
Sr. Member
****
Karma: 0
Posts: 414
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks all.

I did exactly as above (incl. Lefty's suggestion), but it doesn't seem to send anything. Will do some more testing tomorrow.

I will post again when I have more information.
Logged

Offline Offline
Edison Member
*
Karma: 3
Posts: 1001
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just noticed you have drawn a connection from emitter to ana3. There is no need for this - just wire it directly to Arduino ground (common with 12V DC ground).

Ana2 (digital 16) and digital 12 (data) must be set to pinMode output. Also remember the delay (minimum 20ms) from turning on power (ana2 to high) and starting to transmit. If you still have issues (and know the receiver side is good) try with a full second delay (or leave it powered on) before transmitting to rule out power-on time as a possible cause.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 611
Posts: 49092
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How are you supplying power to the transistor? The analog pins are for reading data. I don't believe you can use them as output pins.
« Last Edit: February 11, 2010, 03:44:18 pm by PaulS » Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 388
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@PaulS, see the Note toward the bottom of http://arduino.cc/en/Reference/PinMode:
Quote
The analog input pins can be used as digital pins, referred to as numbers 14 (analog input 0) to 19 (analog input 5).
« Last Edit: February 11, 2010, 07:43:47 pm by TBAr » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 611
Posts: 49092
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There has been no indication that OP was going to refer to the analog pins using the 14+ numbering. I wanted OP to be aware that analog pins are input only.
Logged

Netherlands
Offline Offline
Sr. Member
****
Karma: 0
Posts: 414
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is how I use the Analog pins 2 and 3.

In setup:
Code:
pinMode(16, OUTPUT);   // +5V - Arduino analog pin 2
pinMode(17, OUTPUT);   // GND - Arduino analog pin 3

I have 2 functions to power on and power off the rf transmitter:
Code:
void powerOff()
{
  digitalWrite(16,LOW);
  digitalWrite(17,LOW);
}


void powerOn()
{
  digitalWrite(16,HIGH);      // Pin 2
  digitalWrite(17,LOW);       // Pin 3
  delay(1000);  // wait for things to stabilize
}

So, I understand that I should use digital pins? I have been using the same code with analog pin 2 and 3 when I powered the RF transmitter with only 5V. Because at 5V the distance I need is not enough, I switch to 12V by using the transistor.

I hope to do some more testing this afternoon.
Logged

Plano, TX
Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Wiichuck adapter uses analog pins 2 and 3 (actually, digital pins 16 and 17) as a tricky way to provide power.  There is really nothing special about these particular pins - they are simply adjacent to the I2C pins it needs for communication.  Any digital output can safely source (when set to "1") or sink (when set to "0") up to around 20 mA on a continuous basis.

This trick is no longer applicable for you since you now want to use 12V to power the transmitter.  You can use a transistor to turn on/off 12V to the transmitter (high side switch) or to connect/disconnect the transmitter's GND pin to Arduino GND and 12V power supply GND (low side switch).  Your second schematic is essentially a low side switch (do as BenF said and connect it to GND instead of analog 3) but an NPN transistor is not really appropriate for the job - use a FET.  If you use a logic level FET, you can avoid needing external logic to drive the gate.
Logged

Netherlands
Offline Offline
Sr. Member
****
Karma: 0
Posts: 414
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the explanation. Can you suggest a FET. In the mean time I will use google to see what a FET is/does.
Logged

Pages: [1]   Go Up
Jump to: