HFU HF Underground

Technical Topics => The RF Workbench => Topic started by: greator on June 01, 2020, 1500 UTC

Title: HF Beacon, design questions
Post by: greator on June 01, 2020, 1500 UTC
Hello Everyone!

I have started to build an HF beacon, and thought someone here might be able to help me with parts of the design. The beacon will have a simple 10W transmitter, and be controlled by a arduino and have a few sensors, the antenna will be a less than perfect longwire with a counterpoise. Placement will be on tree. There will probably be a 10-20W solarpanel and a 12v led-acid battery with 5-10Ah. Frequency will be in the range 2-8MHz.

Communication protocoll:
The beacon will have a name, that will be transmitted in CW. Lower speed will make it easier to read on fldigi/DM780 etc.. The values for voltage, temperature and lightlevel on the other hand, might be better to send in dits(0-10 dits = 8-15volts etc...) A timed pulse would also be usefull, but consume more power. What is the normal transmittion interval of a HF beacon these days?

Power management: I live in a Scandinavian country, in the winter its only about 5-6hours of daylight. A lower limit on transmittion will prevent deep discharge of the battery, but perhaps transmittion intervals should be proportional to the voltage? 11-14v = transmition each 5 to 1 minute? At the lower frequencys, its perhaps better to save battery power for the night, when there is better propagation.

Solarpanel: To prevent overcharging(havent got a power regulator), it might work to simply disconect the solar panel when voltage is above 14volts.

Protection: I am thinking about using some kind of epoxy to protect the transmitter and control circuit from water. Does any epoxy work?
Title: Re: HF Beacon, design questions
Post by: Stretchyman on June 01, 2020, 1649 UTC
I'd go for less power than 10W as it's going to draw around 1A at key down, 1W should be plenty for a beacon but I'd improve the antenna as much as possible to compensate.

Using this circuit is about as simple as it gets, driven with a CPP oscillator from Cardinal.

https://circuitsaladdotcom.files.wordpress.com/2015/07/qrp-rf-amp4.jpg

The beacon keyer from G4JNT is also about as simple as it gets too.

http://www.g4jnt.com/BcnKeyer.htm.

Solar panel charging wise will not need anything fancy as SLA batteries withstand mild abuse so just a simple 14V5 regulator will be fine but you do want to stop it discharging beyond 10V or so.

Shame you cant use LiPo, but they dont like the cold at all!

Good luck with your project, it was another thing I intended to build but never found the time.

Regards

Stretchy.

Title: Re: HF Beacon, design questions
Post by: greator on June 02, 2020, 1605 UTC
I got the battery and solar panel, the battery is 12v/5Ah and the solar panel is 20w. Its a bit difficult to calculate the power production, it might produce 240Wh a good day in the summer, and about 20Wh a bad day in the winter. The battery can store approx 60Wh. There will probably need to bee some kind of overcharge protection.


I thought i would program the beacon to send its callsign in CW(10 speed), followed by voltage, temperature and lightvalue. The values will probably be sent in dits, 0-10 = 8-15v. One transmittion should be able to be done in about 30s, and consume about 0,15Wh. That would mean that 24 transmit sessions per 24h would use far less than the 20Wh available in the winter, only 3,6Wh. The limit would be approx 100 transmit sessions per day, one every 15 minutes.

(https://i.postimg.cc/4dCHdhYn/bild.png)
Title: Re: HF Beacon, design questions
Post by: redhat on June 02, 2020, 1636 UTC
Keep in mind, it snows up there right  ;D  You might get 2WH after a good storm comes through and leaves 2" on your panel.

+-RH
Title: Re: HF Beacon, design questions
Post by: greator on June 02, 2020, 1834 UTC
That is a good point, and i also thought about dialing the transmitter down to 1W to avoid any unnecessary interference. Low battery voltage during the winter is also a bad thing with led-avid batteries since they tend to freeze easier then. I will probably set a "hibernation voltage" on 11v or so, that will stop all transmissions and save the power for the CPU and controlling unit.
Title: Re: HF Beacon, design questions
Post by: greator on June 04, 2020, 1741 UTC
I started with the controlling circuit, im using a Arduino Nano clone. I really love these circuits, cost near to nothing and makes setting the hole thing up much easier than having to handle all the circuitry separate as if you were using a PIC or AVR. I added a voltage divider to the mains, to be able to messure battery voltage with the ADC. There is also an external 7805 voltage regulator to be able to use the full battery voltage.

(https://i.postimg.cc/jSQLDhrT/bild.png)
Title: Re: HF Beacon, design questions
Post by: greator on June 05, 2020, 1731 UTC
The code for the beacon has started to come together, its basic function is as follows.

1. Check voltage, pause while voltage is below 10,5v
2. Delay 15 minutes
3a. Send beacon name
3b. Send voltage in beeps(0-8)
3c. Send temp in beeps(0-8)

I also found a smaller solar panel that wont damage the battery so much without a regulator, its 6 watts.

Some "Psudo code"
Code: [Select]
void setup() {
  Serial.begin(9600);
}

//
void loop()
  {
  int voltage = analogRead(A7); //init voltage ADC
  int temp = analogRead(A6); //init temperature ADC
  int beeps;

  if (voltage < 382) //if voltage is below 10,5v hybernate
    {
    while(voltage < 394) //wait until voltage is above 11v
      {
      }
    }
  delay (15UL * 60UL * 1000UL); //delay 15 minutes
 
  send([name of beacon]) //send name of beacon
  delay(1000); //short break
    while(beeps < (voltage - 474)/18) //send one to 8 beeps, equals 11-15v
      {
      send(beep) //send short beep
      beeps = beeps + 1; //increment beeps
      }
   beeps = 0;
   
   delay(1000); //short break
   
    while(beeps < (temp-124)/2) // send one to 8 beeps, equals -10 to +30 degrees
      {
      send(beep) //send short beep
      beeps = beeps + 1; //increment beeps
      }
    beeps = 0; 
  }
}
Title: Re: HF Beacon, design questions
Post by: syfr on June 05, 2020, 2315 UTC
There's a lot you can do with those $2 Nano's to reduce standby consumption. Simple things like turning off I/O's rather than leaving them active, as well as using the various sleep modes as well as turning OFF your transmitter Vcc when not transmitting.   It's pretty easy to make a voltage measurement of your battery and make some decisions on when to next transmit , or adjusting your transmit duty cycle,

My guess is that you might be able to do most of what you need with an ATTiny for even less power consumption. 

Also google charge controllers or charge controller circuits . THey're easy to find and cheap and made for this purpose.

You're building on a good ground plane. Yes, youll need to waterproof things!  This turns out to be trickier than first thought.
Title: Re: HF Beacon, design questions
Post by: greator on June 06, 2020, 1320 UTC
I took your advice and tried to get powerconsumption down on my Arduino Nano, with the voltage divider and the tempsensor(simple 1n4148 diode) it was about 27mA. I changed a few of the resistors and installed a "sleep mode" on the arduino, called LowPower. After that i got down to 11mA. If i  desolder the power-on led, i will get down 1-2mA more probably.

The updated code checks voltage, if below 10,5v goes into sleep mode, wakes up 8s later and checks again. When the voltage is OK a transmit session is started. The transmitted code is simply "BMX1 [voltage 0-8 beeps] [temp 0-8 beeps]" followed by a pause.


Code: [Select]
#include <LowPower.h>

int len = 80; //set speed to 15 wpm

void setup()
{
  Serial.begin(9600);
  pinMode(13, OUTPUT);

}

//
void loop()
  {
  int voltage = analogRead(A7); //init voltage ADC
 
  if (voltage < 382) //if voltage is below 10,5v hybernate
     {
     LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); 
     }   
  else
    {
    sendbeacon();
    }
   
  delay (15UL * 60UL * 1000UL); //delay 15 minutes
 
  }

int dot()
  {
  digitalWrite(13, HIGH); //send short beep
  delay(len);
  digitalWrite(13, LOW); //send short beep
  delay(len);
  }

int dash()
  {
  digitalWrite(13, HIGH); //send short beep
  delay(len*3);
  digitalWrite(13, LOW); //send short beep
  delay(len);
  }
 
int sendbeacon()
  {
  int beeps = 0;
  dash();
  dot();
  dot();
  dot();
  delay(len*3);
 
  dash();
  dash();
  delay(len*3);

  dash();
  dot();
  dot();
  dash();
  delay(len*7);

  dot();
  dash();
  dash();
  dash();
  dash();
  delay(len*7);
 
  int voltage = analogRead(A7); //init voltage ADC

 beeps = 0;
  delay(1000); //short break
    while(beeps <= ((voltage - 384)/18)) //send one to 8 beeps, equals 11-15v
      {
      digitalWrite(13, HIGH); //send short beep
      delay(240);
      digitalWrite(13, LOW);
      delay(240);
      beeps = beeps + 1; //increment beeps
      }
   beeps = 0;
   
   delay(560); //short break
  int temp = analogRead(A6); //init temperature ADC   
    while(beeps < ((16 -(temp -126)))/2)// send one to 8 beeps, equals -10 to +30 degrees
      {
      Serial.println(temp);
      digitalWrite(13, HIGH); //send short beep
      delay(240);
      digitalWrite(13, LOW);
      delay(240);
      beeps = beeps + 1; //increment beeps
      }
    beeps = 0; 
 
  }
Title: Re: HF Beacon, design questions
Post by: syfr on June 06, 2020, 1509 UTC
I'd have to look back at my notes, but as I recall that 27 mA range is roughly what I recall too.   There's a lot of opportunity to sleep the uP between transmit cycles, etc to save power .  Removing the LED is a winner too.   I can't recall what benefit underclocking might bring in regards power consumption , but switching loss is real, so it should help too.

You might look at the brownout detect functions too.


Added: The version without the microusb is yet less power hungry. IIRC I got it to sleep with a consumption of 2mA or so. 

 
Title: Re: HF Beacon, design questions
Post by: Charlie_Dont_Surf on June 06, 2020, 1704 UTC
The updated code checks voltage, if below 10,5v goes into sleep mode, wakes up 8s later and checks again. When the voltage is OK a transmit session is started. The transmitted code is simply "BMX1 [voltage 0-8 beeps] [temp 0-8 beeps]" followed by a pause.

Good. As I was reading these comments, I was going to suggest to make sure that once the conditions are appropriate and the uP powers up fully, just be sure that everything (all circuitry) turns on correctly but it sounds like you have looked at this and have it under control.
Title: Re: HF Beacon, design questions
Post by: Charlie_Dont_Surf on June 06, 2020, 1725 UTC
Protection: I am thinking about using some kind of epoxy to protect the transmitter and control circuit from water. Does any epoxy work?

Please understand that when you apply "conformal coating" to the completed PCB, you are also affecting the power dissipation of the circuit; the various components will not be able dissipate the heat with an epoxy over them as well as they do with air around them. It also makes repairing the beacon later very difficult.

Instead, I suggest that you might try some sort of waterproof plastic box around the PCB. Any cables that enter/exit the box can have epoxy applied around the entry/exit holes to keep moisture and insects out of them. It may not be completely sealed but I would prefer this to applying a coating to the PCB.
Title: Re: HF Beacon, design questions
Post by: syfr on June 06, 2020, 1742 UTC
Yeah, I agree with CDS.... I'd be leery of anything like conformal coating.  It's a major PITA to deal with afterwards, it's rarely as inert as advertised and it's a rework/repair nightmare.  I think it's more meant to avoid condensation and dirt in industrial electronics rather than actual waterproofing.  Find an ammo box, or a plastic snap on container or the like to waterproof your electronics. There's lots of solutions for short money. The crappy part is, most waterproof containers are almost impossible to glue to when you need to.

I'd also consider putting more hysteresis in your undervoltage logic. If Vbattery is low, I'd sleep for an hour or so to get the voltage >> your threshold of concern voltage.  I'm thinking you want to stay further away from brownout conditions than the 8 sec tolerance.

Just my inexpert 0.02$!

** Edit- was looking at ATTiny specs last night and it looks like one can get the standby current in "sleep" mode down to the uA range!      I have some dev boards I'm going to play with for some keying functions.  I think there's 5 I/O's on those boards too.

Fun project!
Title: Re: HF Beacon, design questions
Post by: greator on June 07, 2020, 1254 UTC
I connected the transistor for keying, and also one for a relay to power up/down the transmitter during transmit sessions. I found and ordered some switching(bi stable) relays that doesn't need power once shifted. Hopefully a short pulse of 80mA will switch the relay over to power the transmitter.

One idea i am thinking about is if the battery and temperature value perhaps could be sent using only 4 pulses each, in binary mode. It would keep power consumption as low as posible, 4 "dots"/bits should be able to communicate a value from 1-16.  Im looking if i can find some code to do that.

(https://i.postimg.cc/nLnHZ6c7/bild.png)
Title: Re: HF Beacon, design questions
Post by: greator on June 07, 2020, 1735 UTC
I did some major updates to the code.

Temperature and voltage is sent binary with 4-bits each. Dot = 0, Dash = 1. This equates to 0000 = 8 volts, 1111 = 15 volts and 0000 = -10c and 1111 = +30c.

Hibernation is now the normal state, each cycle is 8 seconds long(the longest the code seams to offer), after 8 seconds the Arduino wakes up, and checks if enough sleep cycles has passed(112 cycles for 15 minutes) and if the voltage is above 11v. If not, a new period of 15m sleep is initiated.

Each transmission takes about 10s at 15wpm speed.

Code: [Select]
#include <LowPower.h>

int len = 80; //set speed to 15 wpm
int sleeps = 0;
void setup()
{
  Serial.begin(9600);
  pinMode(13, OUTPUT);

}

//
void loop()
  {
  int voltage = analogRead(A7); //init voltage ADC
  //Serial.println(voltage);
 
  if ((voltage > 382) && (sleeps > 2)) //if voltage is below 11v hybernate
     {
      Serial.println("sending beacon");
      sendbeacon();
      sleeps = 0;
      }   
  else
      {
      LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); 
      sleeps++;
      }
   
 
 
  }

int dot()
  {
  digitalWrite(13, HIGH); //send short beep
  delay(len);
  digitalWrite(13, LOW); //send short beep
  delay(len);
  }

int dash()
  {
  digitalWrite(13, HIGH); //send short beep
  delay(len*3);
  digitalWrite(13, LOW); //send short beep
  delay(len);
  }
 
int sendbeacon()
  {
  int beeps = 0;
  dash();
  dot();
  dot();
  dot();
  delay(len*3);
 
  dash();
  dash();
  delay(len*3);

  dash();
  dot();
  dot();
  dash();
  delay(len*7);

  dot();
  dash();
  dash();
  dash();
  dash();
  delay(len*7);
 
  int voltage = analogRead(A7); //init voltage ADC
  int myNum = (voltage - 288)/16; // 8v = 0000, 15v = 1111
  int zeros = String(myNum,BIN).length();
 
 //below is convertion to binary string from decimal integer for voltage
  String myStr;
    for (int i=0; i<zeros; i++)
      {
      myStr = myStr + "0";
      }
  myStr = myStr + String(myNum,BIN);         
                     
  for(int i=4;i<8;i++)
      {
      if(myStr[i] == '1')
        {
       
        digitalWrite(13, HIGH); //send long beep = 1
        delay(len*3);
        digitalWrite(13, LOW);
        delay(len);
        }
      else
        {
       
        digitalWrite(13, HIGH); //send short beep = 0
        delay(len);
        digitalWrite(13, LOW);
        delay(len);
        }
       
      delay(len*3);
      }
delay(len*7);
//Send temperature

int temp = analogRead(A6); //init voltage ADC
  myNum = 17 - (temp - 124); // 0 = -10 and 16 = +30
  zeros = String(myNum,BIN).length();
 //below is convertion to binary string from decimal integer
 
 

    for (int i=0; i<zeros; i++)
      {
      myStr = myStr + "0";
      }
  myStr = myStr + String(myNum,BIN);         
             
  for(int i=4;i<8;i++)
      {
      if(myStr[i] == '1')
        {
        digitalWrite(13, HIGH); //send long beep = 1
        delay(len*3);
        digitalWrite(13, LOW);
        delay(len);
        }
      else
        {
        digitalWrite(13, HIGH); //send short beep = 0
        delay(len);
        digitalWrite(13, LOW);
        delay(len);
        }
       
      delay(len*3);
      }


   
 
  }
Title: Re: HF Beacon, design questions
Post by: syfr on June 07, 2020, 2041 UTC
Nice work! I like island construction too. It goes fast ...

Title: Re: HF Beacon, design questions
Post by: greator on June 09, 2020, 1434 UTC
I got a bunch of these SMI-05VDC-SL-2C relays, i havent worked with relays before, but i guess that a pulse between the two legs on the left(with the square) till make the contacts on the right to shift. Will the next pulse shift the other way, or do i need to revser the voltage to get it back to the first position?

(https://i.postimg.cc/q7Lx42fM/bild.png)
Title: Re: HF Beacon, design questions
Post by: greator on June 09, 2020, 1948 UTC
I did some tests with the relay, its not bi-stable/latching as i thought i was (Latching relays seem to be hard to find). It does however have both NO and NC outputs, and draws 108mA when pulled. This might still be usefull, the NC contact could be used as a charge controller. If the solarpanel is connected to the NC pins on the relay, the relay could use 108mA to keep the panel disconnected from the battery when the voltage is too high(>14,5v or something). Power will be abundant when the sun is shining directly at the panel and the battery is fully charged.

The NC option would also be "safe" in the way that if the program in the Arduino stalls, the solar panel will be reconnected when the battery voltage is too low for the arduino to keep it disconnected, the circuit will be rebooted and start with the panel connected.

Title: Re: HF Beacon, design questions
Post by: Stretchyman on June 10, 2020, 1609 UTC
Not sure why you've decided upon using a relay?

Why not use a MOSFET?

Turns on with uA!

Str.
Title: Re: HF Beacon, design questions
Post by: syfr on June 10, 2020, 1619 UTC
Yeah, FET's are cheap and efficient.  I wasn't sure what you were going to do with the relays (they're handy to have around) but without latch function, they're power hungry.

How much current are you switching?
Title: Re: HF Beacon, design questions
Post by: greator on June 10, 2020, 1825 UTC
Mosfet sounds like a good idea, i wish i had read your posts before i epoxyglued two relays to the board  ;D

I need the relay function for two things, regulating the solar panel and powering on the transmitter. The current from the solar panel will be something lika 1.2-1.5A, the transmitter will be lower.

I have a couple of IRF510 mosfets, i havent much experience working with them but i guess they would work as low-side relays in the way the image shows.

(https://arduinodiy.files.wordpress.com/2012/05/fet2_thumb.gif?w=349)

(https://i.postimg.cc/c4cGxTJK/bild.png)
Title: Re: HF Beacon, design questions
Post by: greator on June 11, 2020, 1705 UTC
Today i did some debugging of the program code, and tested it using different voltages. I recently got an oscilloscope, i thought i would try it out and it was a easy way to visualise the output from the transmitter.  The code is "BMX1 1101 1110". Im new to oscilloscopes, but thought i might try using this to build the qrp transmitter my self in stead of using the one i ordered online.

The epoxyglue did come of pretty easy, soon there will be a couple of Mosfets instead. I read up on how they work, and there will probably be one IRF510 in inverted mode(to disconnect the solar panel) and one that is non-inverted keying the transmitter and turning it on.

(https://i.postimg.cc/W3DGcLLp/bild.png)
Title: Re: HF Beacon, design questions
Post by: QRP on June 12, 2020, 0724 UTC
Dave Richards (AA7EE) has written an interesting article detailing his 1mW solar-powered HiFER beacon project

https://aa7ee.wordpress.com/2019/01/03/putting-the-hifer-brs-boris-beacon-on-the-air-finally/

https://aa7ee.wordpress.com/2018/05/07/the-boris-beacon-a-1mw-solar-powered-hifer-beacon/
Title: Re: HF Beacon, design questions
Post by: greator on June 12, 2020, 1839 UTC
Nice project AA7EE did, very goog looking circuits!

I did some more experimenting with the IRF510 as a switch, and managed to use it to stop charging the battery from my adjustable PSU, but for some reason it didnt manage to cut the power from the solar panel. Instead of getting into this problem i decided to keep it simple, im using a 6W solar panel that wont be able to overcharge the battery to much, so no charge controller will be needed.

I made the board a bit smaller to fit into a nice box i found, too keep the hole package weather protected. As the circuit is now there is two inputs(voltage and temperature) and two outputs, keying transmitter and powering on the transmitter(probably with a Mosfet).

Im happy with the code, so there will probably dont be much changes to it now. I will start with the transmitter instead.

(https://i.postimg.cc/xjM994b0/bild.png)

Title: Re: HF Beacon, design questions
Post by: syfr on June 12, 2020, 2150 UTC
Really nice work. And it works which is even better!

Congrats. That's a really nice looking transmitter .   When Im debugging/building something new it usually ends up looking like a dogs breakfast.   You did a nice job

Title: Re: HF Beacon, design questions
Post by: greator on June 13, 2020, 0925 UTC
Today i got started on the transmitter part, the oscilator has been built using the octal buffer 74HCT240(there are lots of designs with this IC online). The PCB is still a bit ugly with a 56ohm dummy load attached, but it works fine! I tested it out with a 8MHz xtal i had on hand.

The oscillator draws 16mA on idle and 69mA on operation. It puts about 45mW into a dummyantenna. Next step is to tidy up the circuitboard(the 7808 is a bit oversiezed etc..). Then it will need an amplifier to get it up to some more TX-power, and a low pass filter to get rid of the harmonics.

The digital oscilloscope is really handy, i was a bit hesitant before i bought it but for what im using it for it works really well.

(https://i.postimg.cc/d306bKcq/bild.png)
(https://i.postimg.cc/qBY2JK8c/bild.png)
Title: Re: HF Beacon, design questions
Post by: greator on June 13, 2020, 1640 UTC
The circuit is now put inside a IP67 plastic box, togheter with the oscillator, the amplifier and a lowpass filter. The amplifier(IRF530) puts out about 2 watts of RF power after the lowpass filter(1,4-2,8 depending on the battery voltage). The current draw during transmitt is 482mA, and 16mA during idle.

Next step is to connect the keyer and the "power upp" Mosfet between the Arduino and the transmitter.

(https://i.postimg.cc/JnYBVzgT/bild.png)
(https://i.postimg.cc/kgW86964/bild.png)
Title: Re: HF Beacon, design questions
Post by: syfr on June 13, 2020, 2358 UTC
That's looking really nice, and I'll look forward to listening for it.

that output filter sure neatened up that waveform!

Title: Re: HF Beacon, design questions
Post by: greator on June 14, 2020, 1939 UTC
I got a BUZ11 mosfet to work as a switch that powers down the transmitter between transmissions. The circuit is now installed in my garden, using a dummy load, to test it out for bugs and design flaws.

I tried out a few different crystals between 4 and 8 MHz, but didnt get it to work with any other than the 8MHz. The oscillator seams to work with them all, but the power amplifier doesnt, output is either highly distorted or lacking RF-power. With the 7,023MHz output grew with time, staring at 0,2W ending at 0,5W after 30s. Its all pretty strange, i will have to look into it some more.

Power consumption is down to 10mA on idle, with the 5aH battery it should be able to stay alive during dark winter months(even if its not transmitting).

(https://i.postimg.cc/hvTjNnQ6/bild.png)

(https://i.postimg.cc/R02vm8mB/bild.png)

Code: [Select]
#include <LowPower.h>

int len = 80; //set speed to 15 wpm
int sleeps = 0;
void setup()
{
  Serial.begin(9600);
  pinMode(13, OUTPUT);

}

//
void loop()
  {
  int voltage = analogRead(A7); //init voltage ADC
  //Serial.println(voltage);
 
  if ((voltage > 382) && (sleeps > 16)) //if voltage is below 11v hybernate
     {
      Serial.println("sending beacon");
      sendbeacon();
      sleeps = 0;
      }   
  else
      {
      LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); 
      sleeps++;
      }
   
 
 
  }

int dot()
  {
  digitalWrite(8, HIGH); //send short beep
  delay(len);
  digitalWrite(8, LOW); //send short beep
  delay(len);
  }

int dash()
  {
  digitalWrite(8, HIGH); //send short beep
  delay(len*3);
  digitalWrite(8, LOW); //send short beep
  delay(len);
  }
 
int sendbeacon()
  {
  digitalWrite(10, HIGH); //power on transmitter
  int beeps = 0;
  dash();
  dot();
  dot();
  dot();
  delay(len*3);
 
  dash();
  dash();
  delay(len*3);

  dash();
  dot();
  dot();
  dash();
  delay(len*7);

  dot();
  dash();
  dash();
  dash();
  dash();
  delay(len*7);
 
  int voltage = analogRead(A7); //init voltage ADC
  int myNum = (voltage - 288)/16; // 8v = 0000, 15v = 1111
  int zeros = String(myNum,BIN).length();
 
 //below is convertion to binary string from decimal integer for voltage
  String myStr;
    for (int i=0; i<zeros; i++)
      {
      myStr = myStr + "0";
      }
  myStr = myStr + String(myNum,BIN);   
   Serial.println(myStr);       
                   
  for(int i=4;i<8;i++)
      {
      if(myStr[i] == '1')
        {
       
        digitalWrite(8, HIGH); //send long beep = 1
        delay(len*3);
        digitalWrite(8, LOW);
        delay(len);
        }
      else
        {
       
        digitalWrite(8, HIGH); //send short beep = 0
        delay(len);
        digitalWrite(8, LOW);
        delay(len);
        }
       
      delay(len*3);
      }
delay(len*7);
//Send temperature

int temp = analogRead(A6); //init voltage ADC

  myNum = 17 - (temp - 124); // 0 = -10 and 16 = +30
  zeros = String(myNum,BIN).length();
 //below is convertion to binary string from decimal integer
 
 
    for (int i=0; i<zeros; i++)
      {
      myStr = myStr + "0";
      }
  myStr = String(myNum,BIN);         
  Serial.println(myStr);           
  for(int i=0;i<4;i++)
      {
      if(myStr[i] == '1')
        {
        digitalWrite(8, HIGH); //send long beep = 1
        delay(len*3);
        digitalWrite(8, LOW);
        delay(len);
        }
      else
        {
        digitalWrite(8, HIGH); //send short beep = 0
        delay(len);
        digitalWrite(8, LOW);
        delay(len);
        }
       
      delay(len*3);
      }
  digitalWrite(10, LOW); //power off transmitter

   
 
  }
Title: Re: HF Beacon, design questions
Post by: syfr on June 14, 2020, 2034 UTC
You transmitting into a 50 ohm load at both 4 and 8 Mhz?
Title: Re: HF Beacon, design questions
Post by: greator on June 15, 2020, 1532 UTC
Its 8MHz only, until i manage to find out why it doesnt play well with my other crystals  :)
Title: Re: HF Beacon, design questions
Post by: syfr on June 18, 2020, 0052 UTC
You might try replacing the output filter (Pi?) with a 47 ohm resistor to ground. Then test at both frequencies and see what the result is.
Title: Re: HF Beacon, design questions
Post by: Stretchyman on June 18, 2020, 0653 UTC
Don't use a wirewound one as you have done as it's only 47 ohms at DC!

I use to use 20x1K metal film in parallel.

Str.
Title: Re: HF Beacon, design questions
Post by: greator on June 21, 2020, 0826 UTC
Somehow the oscillator will not work with certain frequencies, it just doesnt oscillate(tested with the oscillator only). I will have to spend a little more time on the circuit this summer, and order a few more crystals.