Continuous audio tone for RF

212

Senior Member
Hi, I'm still playing with my RF camera stuff. This unit I'm working on now, uses a Sony P31 still cam and a 900mhz A/V transmitter to let me see what is down by the creek :) I am using a commercially sold "camera controller" for the camera operation, and I have that and the camera in one case. Using motion detection, the controller turns on the camera and sends video or a picture, then turns it back off. I had the seller customize the code so I can use the cameras video out port to send daytime video and stills at night ...because it needs the flash at night.

In another case is the RF transmitter, a battery for that, and I need something to send a continuous audio tone all the while the camera is on....then shut off when the camera turns off. At home here, I will still use a tone decoder, for now, to start and stop my VCR recording. (by the way, the picaxe works the universal remote just like I wanted :) ) I have one of the pins on the camera controller going high for as long as the camera is on, and I wired that to a Picaxe as it's power source. The Picaxe 08M turns on the transmitter now with a mosfet, and I have it sending a tone too.

What I need help and advice with is... I want a steady continuous tone. The frequency is not that important as I can adjust the decoder as needed. I've searched and read a bunch, but have not come across an answer to my question.... "how can I get the 08M to send an uninterrupted tone...or can I???

Power is cut to the Picaxe when the camera tuns off, so I just used this so far, I never need it on longer than 40 seconds:


for b1 = 1 to 10

main:

high 1
tune 2, 15,($80)

next b1

And it's OK to laugh cause I know I'm a dufus lol...
 

hippy

Ex-Staff (retired)
If you need an absolutely continuous tone you will have to use PWMOUT. You can slow the operating speed down ny poking the OSCCON register which will reduce the frequency.

Otherwise it's TUNE or SOUND in a tight loop but that will have some gaps in it.
 

moxhamj

New Member
At the risk of being labelled a heretic and being burned at the stake, this might be a solution for a 555. One chip, two resistors, one capacitor, cost $1.50 = cheaper than a picaxe. Square wave output of any frequency.

Then again, I wouldn't do it this way as transmitting a continuous tone over the airwaves might upset others who want to use that frequency. I would use picaxes and RF modules and send little data packets every minute or so that say "record" or "don't record". If you can decode an audio tone you can decode a serout at 600 to 2400 baud.
 

papaof2

Senior Member
Since the tranmission is video plus audio, the continuous audio is but a tiny portion of the bandwidth being used.

Not much different than having a mic connected and listening to the fish gossip down at the creek ;-)

John
 

212

Senior Member
Nobody around for miles to bother, and as far as I can tell I am within legal limits too :) I'm looking to use the picaxe because later on, as I learn more, I hope to add other features to the project, that will need it.

That code's tone lasts a few seconds...what good would it do to slow down the picaxe...if any???
 

212

Senior Member
I forgot to ask...this tight loop? A very brief interruption is OK...how tight, and huh...how?
 

hippy

Ex-Staff (retired)
You could try something like ...

Code:
Do
  Sound PIN,(100,250)
Loop
With a piezo on the Pin to 0V you should be able to hear the slight glitch.
 

212

Senior Member
Thank you, but now I have to really show my ignorance... I can not get it into my 08M ??? and I promise have been reading about this all day too.
 
Last edited:

212

Senior Member
Well good grief...this works and I get a solid lock on my decoder circuit too. Now why??? I need to figure out why or I'll never learn anything :)

high 1

main:
sound 2,(100,250) ‘ freq 100, length 250

goto main
 
Last edited:

manuka

Senior Member
212- bravo! Things indeed can be this simple with PICAXEs. However you're obviously a fast learner, as you look to have gone from suggestion to completion in < 30mins! Hence is your earlier query re "getting it in to the PICAXE" still valid?

Re SOUND syntax - if you still didn't know. That first 100 is the freq, although NOT in Hz, being simply a high tone of ~1kHz. These tone values range form 0 (silence) to 255 (hiss).

The 2nd variable (also a 100 for you) is the duration in units of 10 millisecs. Put a piezo across the output pin (with the other side grounded) & you'll hear it. It's quite normal to experiment with SOUND settings to get the desired effect, so tweak away. Stan
 
Last edited:

hippy

Ex-Staff (retired)
SOUND as manuka says is just the production of a continuous tone for a certain length of time ( I simply guessed at "100" as a frequency ). There's a short period when there will be no tone, while starting the command, when ending it, and while the PICAXE restarts the loop, but that is in the order of sub-milliseconds. Presumably that's not a long enough absence for the receiver to lose lock.

TUNE works similarly but AFAIR the tone is only present for 7/8ths of the time with 1/8th silence so may not work as well. That 7:1 ratio ( or it may be 8:1 for simpler implementation ) makes sequences played with TUNE sound much more musical, it's closer to the sound envelope generated by a piano. SOUND has a sound envelope more similar to that of a violin.
 

212

Senior Member
Well that explains why sound has less...ummm...quiet time, that's what it was meant to do. I appreciate you guys helping such a beginner with such simpleton questions. 30 years ago I could have picked this up faster, but 30 years ago there was no picaxe lol...
 

manuka

Senior Member
212: Happy to help-all part of the PICAXE approach. Now in return, & as you're a Texan, we'll ask for you to wave your magic wand over fuel prices. Sounds like a fair trade to me! Stan
 

212

Senior Member
Everybody knows everyone in Texas has oil wells, but mine has run dry, and I am at the mercy of the oil companies too now :( Our gas has risen to new all time highs like all over the world...$3.17 a gallon last week, and I'm sure higher next week. My advice is to build rubber band cars :)
 

manuka

Senior Member
Mmm- isn't rubber derived from oil these days? How about you help an old lady across the road instead!
 

212

Senior Member
Mmm- isn't rubber derived from oil these days? How about you help an old lady across the road instead!
"UK developed ( with Oil & Gas industry funding) by Bath firm Revolution Education"

I was going to ask them for assistance lol...
 

hippy

Ex-Staff (retired)
Time for "how expensive is oil/gas" around the world - half a cent over $8 USD per US gallon in the UK where I live, and you thought $3 was bad ;-)
 

212

Senior Member
ouch!

But that is only part of the story. When I was a young man, you could buy 5 gallons gas with an hours wages, now minimum wage will get you two.

oh yeah....I love my Picaxe ....( to keep on topic :)
 

manuka

Senior Member
212: Glad you mentioned this, which aligns with the "we've been spoilt" message =>http://seekingalpha.com/article/67666-gas-price-we-ve-had-it-good-for-a-long-time?source=wildcard

Global gas price are often massively skewed by local tax contents/subsidies & currency values, so comparisons are often difficult. Hence here in NZ (with regular retailing ~US$1.40 a litre March 10th 2008) the tax take is much greater than the fuel cost. In contrast Venuezulan fuel ( at ~US 20 cents a litre) is obviously greatly subsidized.

You have to be positive about the increased attractiveness of alternatives (solar PV especially), & public transport with higher fuel prices too. Those with long memories like mine may well recall the oil shock of 1973 soon lead to dramatic improvements in energy efficiencies, both for buildings & automotive needs.

Footnote: I see Bush is stressing ethanol as the way forward,perhaps meaning we should drink it to take our mind off the need to drive at all...
 

212

Senior Member
I don't know about the rest of he world, but the oil shock of 1973 brought lots of Japanese cars to market here, that's why the average MPG went up... Now, yes our American made cars get better milage...for a tank.

I don't drink, but if it is for the good of the world, I may have to start. Of course you realize the population might increase too then...
 

papaof2

Senior Member
Not American cars or Japanese cars - just American labels and non-American labels.

My Toyota pickup was assembled in California on the same assembly line that's used for some GM products

Nissans are built in Tennessee, BMWs in South Carolina, Hyundai is building a plant in Alabama, Kia in Georgia.

I think it may be time to investigate an electric-assisted bicycle with solar charger for trips to the post office, bank, etc. I'm working on a solar-powered irrigation system with PICAXE control to make using the rainwater I collect more efficient - only water when the ground is dry and only as much as is actually needed (I'm currently testing parts, such as a flowmeter that measures in tenths of a gallon and electric valves that work at less than 3psi water pressure).

John
 

manuka

Senior Member
If you can handle irrigation needs like these,then I'd say fitting a hub motor kit to make your own e-bike would be a breeze. Go to it! Warning- quite aside from limited range issues, some retrofit bike motors can be pretty noisy & may spoil your 2 wheel experiences, so check them out well FIRST. In contrast, larger Chinese e-scooters are so quiet that they're almost a pedestrian hazard. Stan
 
Top