Servo rotation and 315Mhz T/R help

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jc27
 
Posts: 185
Joined: Sun Nov 24, 2013 5:05 am

Re: Servo rotation and 315Mhz T/R help

Post by jc27 »

How do the github files work? Do I just download them? Also, are there files for the 315MHz receiver as well?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Servo rotation and 315Mhz T/R help

Post by adafruit_support_bill »

If you download the zip file and extract it to a folder, you should be able to open the board file & schematic with EagleCAD.

We don't manufacture the 315MHz components in-house, so we don't have board files for those.

User avatar
jc27
 
Posts: 185
Joined: Sun Nov 24, 2013 5:05 am

Re: Servo rotation and 315Mhz T/R help

Post by jc27 »

I've never used a eagle before, so it's going to be a bit before I can get the PC board made. Now if I could just figure out how to get the board dimensions and header pin holes imported into MS Visio I would be all set. I use a company called pad2pad to make my boards, and they have their own board drawing software, and of course the trinket file won't open in it.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Servo rotation and 315Mhz T/R help

Post by adafruit_support_bill »

Not sure what software your board maker uses, but there are export utilities for Eagle that can export various file formats (e.g. DXF)

User avatar
jc27
 
Posts: 185
Joined: Sun Nov 24, 2013 5:05 am

Re: Servo rotation and 315Mhz T/R help

Post by jc27 »

It can import dxf files, so that would work perfect. Since I am using the free version of eagle, does that mean that those types of ad dons are not accessible?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Servo rotation and 315Mhz T/R help

Post by adafruit_support_bill »

Should be. I just did one to check and it worked fine.

User avatar
jc27
 
Posts: 185
Joined: Sun Nov 24, 2013 5:05 am

Re: Servo rotation and 315Mhz T/R help

Post by jc27 »

I got the DXF file thing figured out, but the company's software ( I use a company called pad2pad for making my PC boards) tens to make a mess of the DXF file. They have a bunch of Arduino component footprints loaded in their program, so I sent them an email seeing if they plan on using any of the components that you make (that have public CAD files) a preloaded footprint in their software.
The problem I am having is that I will be through-hole mounting the 315MHz receiver, trinket, and the A23 12v battery to the custom PC board. This means that I need to make the file that pad2pad will be using to create these boards, with the most accurate location and size of the header pin holes. If the holes are off by too much, none of the parts will be able to get soldered to the new board and the money I spent on those boards is wasted.
I looked to see if there was a file for the receiver, but it doesn't look like there is one.

User avatar
jc27
 
Posts: 185
Joined: Sun Nov 24, 2013 5:05 am

Re: Servo rotation and 315Mhz T/R help

Post by jc27 »

Here is the newest code:

Code: Select all

#include <Adafruit_SoftServo.h>
int button1 = 0; // down rotation
int press1 = 0;
int button2 = 2; //  up rotation
int press2= 0;
Adafruit_SoftServo servo1;
int pos = 0;

void setup()
{
  OCR0A = 0xAF; // copied from the gemma tutorial
  TIMSK |= _BV(OCIE0A); // copied from gemma tutorial and what is this symbol "|"
  pinMode (button1, INPUT); // down rotation
  pinMode (button2, INPUT); // up rotation
  servo1.attach (1);
  servo1.write (0);
}
void loop()
{
  if ((digitalRead(button1)) == HIGH && (pos == 0))
  {
    for (int i = 0; i < 144; i++)
    {
      pos ++;
      servo1.write(pos);
      delay (6);
    }
  }
  if ((digitalRead(button2)) == HIGH && (pos == 144))
  {
    for (int i = 144; i > 0; i--)
    {
      pos --;
      servo1.write(pos);
      delay (15);
    }
  }
}
volatile uint8_t counter = 0;
SIGNAL(TIMER0_COMPA_vect)
{
  counter += 2;
  if (counter >= 20)
  {
    counter = 0;
    servo1.refresh();
  }
}
  
Now what will happen if I were to change the values in the servo refresh section? I changed it to 1 and 10, and I didn't notice any difference.
Here is a quick vid of the mock up in action.
https://www.youtube.com/watch?v=Vnoai1a ... e=youtu.be

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Servo rotation and 315Mhz T/R help

Post by adafruit_support_bill »

If the holes are off by too much, none of the parts will be able to get soldered to the new board and the money I spent on those boards is wasted.
I looked to see if there was a file for the receiver, but it doesn't look like there is one.
We don't manufacture these in-house, so we don't have board files. But the headers are standard 0.1" pitch headers.
Now what will happen if I were to change the values in the servo refresh section?
That just changes the frequency of updates to the servo. It does not change the speed at which it moves. If you want to move faster or slower, you need to change the delays in your 'for' loops.

User avatar
jc27
 
Posts: 185
Joined: Sun Nov 24, 2013 5:05 am

Re: Servo rotation and 315Mhz T/R help

Post by jc27 »

I think I have the code all set. Now here is another question about powering everything. I was planning on using an A23 12v battery to power the trinket and the receiver. The trinket can handle the voltage, but I'm a bit confused with the power capabilities of the receiver. The data sheet says the chip can handle more than 10v, but the adafruit product page says 5-10 volts. I have everything layed out on a breadboard and it seems to run fine off the 12v battery.
Another problem I have is the capacity of that battery. It only has a capacity of 55mAh, and it looks like the trinket and the receiver pull about 20mA, so that battery will only last about 2 hours which isn't very good. Any ideas of a way to power the trinket and receiver that is small and will last longer?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Servo rotation and 315Mhz T/R help

Post by adafruit_support_bill »

The chip itself is rated for more than 10v, but the manufacturer spec for the assembled board is 10v. There are probably some other 10v rated parts on the board.

A typical 9v battery will give you 400-600mAh. Would that be compact enough?

User avatar
jc27
 
Posts: 185
Joined: Sun Nov 24, 2013 5:05 am

Re: Servo rotation and 315Mhz T/R help

Post by jc27 »

I would like something smaller, but it looks like the 9v is my best option. It has the voltage and the current capacity, as well as being readily available and cheap. Now I need to see if I can do another layout using a 9v holder, which should be fairly easy, as well as ad an on/off switch.

User avatar
jc27
 
Posts: 185
Joined: Sun Nov 24, 2013 5:05 am

Re: Servo rotation and 315Mhz T/R help

Post by jc27 »

What if I use that dc regulator I was going to use in the beginning? It would drop the 12v down to 5v, so would that also increase the run time of battery? I found an enclose on Newark that will fit the board as it sits now, so using a 9v would require a new enclosure.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Servo rotation and 315Mhz T/R help

Post by adafruit_support_bill »

Using a buck-converter like that should give you close to twice the run-time.

User avatar
jc27
 
Posts: 185
Joined: Sun Nov 24, 2013 5:05 am

Re: Servo rotation and 315Mhz T/R help

Post by jc27 »

I have one so I will get it a try. I'm going to get new batteries tonight and I will power up the trinket and the receiver with the regulator to see how long before the battery dies.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”