Pages: [1]   Go Down
Author Topic: Minimal arduino RF transmitter in fritzing  (Read 6727 times)
0 Members and 1 Guest are viewing this topic.
Vejen, Denmark
Offline Offline
Edison Member
*
Karma: 9
Posts: 1178
RAWR! ^,..,^
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I hope this is the right category...

But here it goes... I am trying to design a little print for some small RF sending arduino's.
They only got these components on:
Code:
J1            Generic female header - 4 pins
PCB1          Rectangular PCB - Resizable
R1            10kΩ Resistor
U1            atmega168
U2            Voltage Regulator - 5V
VCC1          Battery
Y1            Resonator

But it seems to do it from the wrong side when I export to an etch able file.

Isn't this how it would look from the up side, and not from the side where I would solder on?
Logged

captain-slow.dk | non contagious!

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have a schematic to go with that? This layout raises some questions - maybe you are just starting.
Where is the RF transmitter? Where are the connections to whatever the board receives data from to send out? Is there a place to connect an antenna for the RF transmitter antenna?
Is the big chip to be installed in a socket so you can pull it out to reprogram it?
I would call the battery connector something besides VCC1 - VCC usually indicates the power after it goes thru a regulator, not before it.Maybe call that BATT1 instead.
Most regulators would also like to have an input capacitor and an output capacitor.
I would also design in some pads to give yourself some other power connections - like skip the regulator, run from 6 AA batteries for example - with 4.5V going to the atmega and 9V going to the transmitter for better range. Or if running at lower frequency, say 8MHz, run off 2 LiPO batteries - 3.7V to the atmeage, and 7.4V to the transmitter.
I have a remote control using this Rx transmitter MO-SAWR, WRL-08946 TX from Sparkfun, transmits fine from 3.7V as well over.
J1 - this is going to the transmitter? Pin 5, (Arduino D3?) is to be your output pin?

Why not add a 2nd row of holes adjacent to the big chip, connected to the pin next to it, give yourself some flexibility for making other connections?

Yes, the  picture depicts looking down at the top of the components - the little square at the upper left of the big part indicates pin 1.

My remote, runs from 1 LiPO 1000mAH battery, plug into 5V to charge it up. Development was done with 3 AA batteries & no charger.
Goes into sleep mode after a key press.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Vejen, Denmark
Offline Offline
Edison Member
*
Karma: 9
Posts: 1178
RAWR! ^,..,^
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your suggestions, they gave me some new ideas.

Trying to make the schematic for it readable, it is a REAL mess right now, so big a mess that I refuse to show it to anyone. smiley-wink Will try to improve it, when I am done configuring my new router, and then get back with more info. smiley
Logged

captain-slow.dk | non contagious!

Vejen, Denmark
Offline Offline
Edison Member
*
Karma: 9
Posts: 1178
RAWR! ^,..,^
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

 smiley-eek

They are perfect! But what receiver to use with the 434 Mhz kit? I currently only got a 433 Mhz receiver, and it will most likely not work with the JeeNode transmitters.
« Last Edit: January 27, 2011, 02:43:48 pm by bld » Logged

captain-slow.dk | non contagious!

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://shop.moderndevice.com/products/rfm12b-radio

I believe the RF12B is a transceiver (can transmit or receive), so if you had 2 jeenodes they would talk to each other.
Or put at RF12B together with another arduino instead.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Vejen, Denmark
Offline Offline
Edison Member
*
Karma: 9
Posts: 1178
RAWR! ^,..,^
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah yes, I was looking for receiver, not radio. smiley Going with these instead, much easier than making it from scratch smiley-wink

Can read up on how to put them into sleep instead then.
Logged

captain-slow.dk | non contagious!

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can out the arduino into sleep mode pretty easily.

Need  these
#include <avr/sleep.h>      // powerdown library
#include <avr/interrupt.h>  // interrupts library

An easy way to wake up is external interrupt on Int0 or Int1 (low on pins D2, D3).
Set up D2 or D3 as an input with pullup resister enabled, pulling it low via a switch will wake it up.

Not sure what you can do with the transceiver. I only have a transmitter, it doesn't seem to draw much power when no data is sent to it for transmission.
Have to read the transceiver spec, maybe it has something built in. Or maybe add an external transistor to cut Vcc to it.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Vejen, Denmark
Offline Offline
Edison Member
*
Karma: 9
Posts: 1178
RAWR! ^,..,^
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sleep isn't that important, it is going to be on a wall wart adapter. But it could be fun to try.

How fast is it to wake up?

I am going to use the Int0 as the trigger for when mail is hitting one of the switches inside the mailbox. But that might only be a very short impulse, and no problems if it runs without sleeping.

So what this needs to do, is to wake up when getting an impulse on the Int0, send the message, then go back to sleep.
Logged

captain-slow.dk | non contagious!

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think the ATmega spec says something like 6 clock cycles to wake up.
The code I have for my remote  wakes up from sleep,
Code:
// *  Name:        pin2Interrupt, "ISR" to run when interrupted in Sleep Mode
void pin2Interrupt()
{
  /* This brings us back from sleep. */
}
then restores the output state so reading of the keypad can be done (I had to set low as part of going to sleep so a keypad press could cause a Low interrupt)
Code:
//***************************************************
// *  Name:        enterSleep
void enterSleep()
{
  /* Setup pin2 as an interrupt and attach handler. */
  attachInterrupt(0, pin2Interrupt, LOW);
  delay(50); // need this?
  /* the sleep modes
   SLEEP_MODE_IDLE - the least power savings
   SLEEP_MODE_ADC
   SLEEP_MODE_PWR_SAVE
   SLEEP_MODE_STANDBY
   SLEEP_MODE_PWR_DOWN - the most power savings
   */
  set_sleep_mode(SLEEP_MODE_PWR_DOWN);  // setting up for sleep ...
  sleep_enable();                       // setting up for sleep ...
  sleep_mode();                         // now goes to Sleep and waits for the interrupt 
The last line is what actually puts into sleep mode.
Then when the interrupt occurs we keep going
Code:
 /* The program will continue from here after the interrupt. */  
detachInterrupt(0);                 //disable interrupts while we get ready to read the keypad

  /* First thing to do is disable sleep. */
  sleep_disable();

  // set all the keypad columns back high so can read keypad presses again
  digitalWrite(7, HIGH);
  digitalWrite(8, HIGH);
  digitalWrite(9, HIGH);
  digitalWrite(10, HIGH);
  // then go to the void Loop()
}
and it does all that so fast the keypad library still catches the button presses to send them over the RF transmitter
Code:
// this code is in the Void loop
{ // part of code that determines if should go to sleep
if (enter_sleep_mode == 1){
    enterSleep();                             // call Sleep function to put us out
    
                                              //  THE PROGRAM CONTINUEs FROM HERE after waking up in enterSleep()
  }                                           // end of checking to go to sleep

    // go read the keypad
  char key = keypad.getKey();                 // reading the keypad
  if(key)                                     // same as if(key != NO_KEY)- did something change?
  {
    msg[0]=key;                               // load the array with the key character
    // msg[1]=NULL;                           // Rx side seems to work without this

    digitalWrite(ledPin, true);               // Flash a light to show transmitting

    vw_send((uint8_t *)msg, strlen(msg));     // send the character out via VirtualWire command

//    Serial.println(key);                // for debugging only

    vw_wait_tx();                             // Wait until the whole message is gone

// other code to turn off the LED and basically start a counter to see if should go back into sleep mode

the order looks a little funny, but the ISR and entersleep functions are defined outside of void loop().
« Last Edit: January 28, 2011, 11:45:49 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Vejen, Denmark
Offline Offline
Edison Member
*
Karma: 9
Posts: 1178
RAWR! ^,..,^
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Got the JeeNode v5 today, and assembled it, but is way too tired to figure out how to actually use it... smiley-sleep

Very small though, and fits my purpose perfectly. smiley-kitty
Logged

captain-slow.dk | non contagious!

Vejen, Denmark
Offline Offline
Edison Member
*
Karma: 9
Posts: 1178
RAWR! ^,..,^
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

heh, days looking at the stuff... and still makes me go @_@ and haven't been able to find any easy way to use it or how it is actually connected and supposed to work... heh
Logged

captain-slow.dk | non contagious!

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can always try the jeelabs forum
http://jeelabs.com/pages/about

or contact Jean-Claude Wippler at jeelabs if there is some jeelabs specific that we cannot help you with here.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: