Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 04:25 01 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : HC-12 Wireless Serial Module

     Page 3 of 8    
Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9066
Posted: 08:14pm 09 Mar 2016
Copy link to clipboard 
Print this post

Okey dokey, I will try this and get back to you.

I seem to recall that someone here wrote a nice little utility to program the device with the settings you want - Rob? Jim? Someone.....

However, this may be a requirement for direct control or something, yes?

I will post back soon.
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9066
Posted: 12:35am 10 Mar 2016
Copy link to clipboard 
Print this post

The module responds to "AT+A001" or "AT+A012" kind of command with an "OK", but attempts to query that command with the likes of "AT+RA" result in an error message.





My guess is that it is possibly ignoring commands from the earlier HC-11 module, for compatibility reasons. The module DOES NOT respond with "ERROR" when you issue "AT+A012", it just responds with "OK" but nothing else. Not sure if this helps at all, or makes matters worse!

EDIT: It does seem to be ignoring unknown commands, and sending "ERROR" for syntax errors in commands it does know. If you send something like "AT+ZZ" or "AT+OO", the module still responds with "OK".
Edited by Grogster 2016-03-11
Smoke makes things work. When the smoke gets out, it stops!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2289
Posted: 12:41am 10 Mar 2016
Copy link to clipboard 
Print this post

see page 2 of this thread:
"
and here we have it, an HC-11 configuration utility:
2016-01-15_155359_HC-11_config.zip

plus a minor revision of the HC-12 configuration utility:
2016-01-15_154000_HC-12_config.zip
"

using the HC-11 configuration utility with an HC-12 module attached, the response from sending "AT+A003" is "OK". this is not the expected response, but neither is it an error.

the HC-11 and HC-12 use completely different transceiver chips from different manufacturers. i would not expect the address command to be supported by the HC-12, and the "OK" response may just be there to provide some level of drop-in compatibility. note that an HC-11 can not communicate with an HC-12, even if the operating frequency of both are the same.


cheers,
rob :-)

addendum: SNAP! grogster posted as i was writing mine.Edited by robert.rozee 2016-03-11
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9066
Posted: 12:52am 10 Mar 2016
Copy link to clipboard 
Print this post

  robert.rozee said  The HC-11 and HC-12 use completely different transceiver chips from different manufacturers. i would not expect the address command to be supported by the HC-12, and the "OK" response may just be there to provide some level of drop-in compatibility.


...and there you have it, really.


  robert.rozee said  addendum: SNAP! grogster posted as i was writing mine.



Smoke makes things work. When the smoke gets out, it stops!
 
JohnL
Senior Member

Joined: 10/01/2014
Location: Seychelles
Posts: 128
Posted: 01:53am 10 Mar 2016
Copy link to clipboard 
Print this post

Thanks Grogster and Robert.
That information is helpful.
Regards
John
 
JohnL
Senior Member

Joined: 10/01/2014
Location: Seychelles
Posts: 128
Posted: 03:45pm 12 Mar 2016
Copy link to clipboard 
Print this post

Warning about legal use of 100mW (20dbm) HC-12 transceivers in Australia, or any other transmitting devices in the 433Mhz band.

https://www.legislation.gov.au/Details/F2015L01438

Appears that maximum allowed legal transmitting power in 433Mhz band is 25mW (14dbm).

Looks like similar limitation in Europe, but in USA 433Mhz is illegal.

915 Mhz (1000mw) maybe another lower frequency digital communication option provided that frequency spread hopping or digital modulation is used . 915Mhz is also legal in USA.

I am not an expert in this field, maybe some others with HAM licence can comment more.
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2289
Posted: 04:28pm 12 Mar 2016
Copy link to clipboard 
Print this post


below is a (slightly modified) reposting of my comments on the HC-12 output power from another thread. on the whole, there is little for kiwis, aussies, or brits to worry about, although it would be a good idea to check out the bandplan for your country if you are concerned.

  Quote  
the 433MHz band is referred to as LPD433 (low power device 433 MHz) and requires no licence for use in many countries:
https://en.wikipedia.org/wiki/LPD433
for the average person, the most familiar use of this band is for garage door controllers, for example green button Merlin remotes. it is also shared with amateur radio operators (70cm, 430-440MHz).

the first four channels of the HC-12 module fall within this band. the default power output of the HC-12 is 100mW, while in australia and new zealand the maximum power allowed is 25mW. however, the antenna supplied is a helical (20-turn, 4.5mm diamater, 20mm length) that is likely to attenuate the output to be within the 25mW limit:
http://www.cqham.ru/spiral.htm
the bandwidth of the transmission is also quite wide (400kHz), which spreads this power out quite bit, again helping to keep within the regulations.

also of note: the HC-12 only transmits when there is data sent to it. so if transmitting (for example) a temperature reading every minute, transmission will only consist of a short 'blip' now and then. this mode, in itself, is unlikely to interfere with other users such as remote controls or voice.

conclusion: using the supplied 20mm helical antenna the HC-12 should be ok to operate in australia or new zealand on channels 1 to 4 (channel 1 is the factory default); in the UK, the band is flagged as shared with amateur radio operators, but if acting with consideration to others this should not be an issue. so, in these countries no configuration needs to be sent to the unit.

setting a channel number above 4 is best avoided without first checking the local regulations, as is attaching a 'real' antenna. and finally, avoid sending data continuously to be courteous to other users of the band.

american users may with to chime in with details of their own local regulations.




cheers,
rob :-)
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5906
Posted: 04:29pm 12 Mar 2016
Copy link to clipboard 
Print this post

Being an Amateur operator doesn't mean we know the regs for things not part of our licence conditions.
Most of us probably aren't up to date with things that DO concern us.

As far as the HC-12 goes, you can configure the power level and frequency so it is easy to set it to comply with Australian regs.

It is also easy to configure it to be outside the permitted levels/frequencies so caution is advised.

Jim

VK7JH
MMedit   MMBasic Help
 
srnet
Senior Member

Joined: 08/08/2014
Location: United Kingdom
Posts: 164
Posted: 08:50pm 12 Mar 2016
Copy link to clipboard 
Print this post

  JohnL said  Appears that maximum allowed legal transmitting power in 433Mhz band is 25mW (14dbm).

Looks like similar limitation in Europe, but in USA 433Mhz is illegal.



In the UK, and I think most of Europe, the limit for an 433Mhz\434Mhz ISM band device is 10mW, 10dBm.

There are also duty cycle limitations depending on the signal bandwidth etc.
$50SAT is Silent but probably still working.
For information on LoRa visit http://www.loratracker.uk/

 
HankR
Senior Member

Joined: 02/01/2015
Location: United States
Posts: 209
Posted: 04:51am 13 Mar 2016
Copy link to clipboard 
Print this post

  srnet said  
  JohnL said  Appears that maximum allowed legal transmitting power in 433Mhz band is 25mW (14dbm).

Looks like similar limitation in Europe, but in USA 433Mhz is illegal.



In the UK, and I think most of Europe, the limit for an 433Mhz\434Mhz ISM band device is 10mW, 10dBm.

There are also duty cycle limitations depending on the signal bandwidth etc.


srnet is on the right track.

The "LPD433 (low power device 433 MHz)" Wikipedia reference cited before pertains primarily to voice communication devices operating on some of the same ISM allocations, and only tangentially to remote control or other digital data uses which cover the HC-12 (and HC-11). The ICs that power the HC-11 and HC-12 were both designed by US companies.

I believe in the US (just as in the UK and Europe), the applicable, controlling FCC regulation is in the ISM section of the rules.

433-434 Mhz is legal for many *non-voice* uses in the US. There are several Wikipedia articles on related topics that are in error that I'll be correcting in the next few weeks.

As I have a chance to study the FCC regulations that are more lengthy and complex than the Australian equivalent (Part 15 alone comprises more than 100 fine print pages), I'll come back with my interpretation of the specific US power limits for HC-12 type devices.

Hank
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1676
Posted: 10:18am 14 Mar 2016
Copy link to clipboard 
Print this post

For reference the LPD433 regulations in the UK
In the UK, LPD433 equipment that meets the respective Ofcom Interface Requirement can be used for model control, analogue/digitised voice and remote keyless entry systems

Only channels 1-4 can legally be used.

If you use any of the other channels, apart from intererence from Radio Amateurs, you should be aware the PRIMARY USER OF the 430-450Mhz band is the MILITARY and interfering with them is a definite NO. Don't chance it.

 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3016
Posted: 04:50pm 16 May 2016
Copy link to clipboard 
Print this post

  HankR said  
  srnet said  
  JohnL said  Appears that maximum allowed legal transmitting power in 433Mhz band is 25mW (14dbm).

Looks like similar limitation in Europe, but in USA 433Mhz is illegal.



In the UK, and I think most of Europe, the limit for an 433Mhz\434Mhz ISM band device is 10mW, 10dBm.

There are also duty cycle limitations depending on the signal bandwidth etc.


srnet is on the right track.

The "LPD433 (low power device 433 MHz)" Wikipedia reference cited before pertains primarily to voice communication devices operating on some of the same ISM allocations, and only tangentially to remote control or other digital data uses which cover the HC-12 (and HC-11). The ICs that power the HC-11 and HC-12 were both designed by US companies.

I believe in the US (just as in the UK and Europe), the applicable, controlling FCC regulation is in the ISM section of the rules.

433-434 Mhz is legal for many *non-voice* uses in the US. There are several Wikipedia articles on related topics that are in error that I'll be correcting in the next few weeks.

As I have a chance to study the FCC regulations that are more lengthy and complex than the Australian equivalent (Part 15 alone comprises more than 100 fine print pages), I'll come back with my interpretation of the specific US power limits for HC-12 type devices.

Hank


Hank,

Have you been able to determine what "non-voice" uses are permitted for 433mHz transmissions in the U.S.

Some years ago I found an ARRL document (the link is now dead) which stated: "The current Section 15.231(e) provisions for periodic radiators, however, permit field strengths of less than 5,000 uV/m at that frequency (measured at 3 meters), with duty cycles of less than one second, assuming a silent period between transmissions of at least 30 times the duration of the transmission."

I don't know how "field strengths" relate to the terms with which HC-12 and other 433mHz transmitters are described, e.g., in mW of transmission power.

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9066
Posted: 05:40pm 16 May 2016
Copy link to clipboard 
Print this post

  HankR said  As I have a chance to study the FCC regulations that are more lengthy and complex than the Australian equivalent (Part 15 alone comprises more than 100 fine print pages), I'll come back with my interpretation of the specific US power limits for HC-12 type devices.

Hank


Bloody hell. Why so complex? MORE then 100 pages just for part 15?!?!!!??

New Zealand allows up to 25mW on 433-434MHz band, sporadic transmission only. Continuous data streaming etc, is NOT permitted. Voice on those frequencies is also not permitted.








These regs are from 2013, but 433MHz band regs don't often change - in NZ at least.
Smoke makes things work. When the smoke gets out, it stops!
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3016
Posted: 01:45am 17 May 2016
Copy link to clipboard 
Print this post

Re FCC permitted transmissions in the U.S., this document -- https://transition.fcc.gov/Bureaus/Engineering_Technology/Documents/bulletins/oet63/oet63rev.pdf -- contains the following under a table labeled "Part 15 low-power transmitter frequency table"

Data items are: Frequency Band, Type of Use, Emission Limit, Det 47, CFR

410-470 MHz
Intermittent Control Signals: (125/3) x f(MHz) - (21250/3) ìV/m @ 3 m; A or Q 15.231
Periodic Transmissions: (50/3) x f(MHz) - (8500/3) ìV/m @ 3 m; under A or Q 15.231

Permitted usage varies depending on the type of antenna used, so, for instance, transmission usage permitted with the wound HC-12 antenna might not be permitted with an antenna which plugs into the socket on the board.

But I don't know how the FCC Emission Limit formulas relate to HC-12 transmission at a given wattage with a given antenna.
Edited by lizby 2016-05-18
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1676
Posted: 02:17am 17 May 2016
Copy link to clipboard 
Print this post

I want to use 3 of these in a project.

2 will be on separate frequencies

FOR SIMPLICITY'S sake let's "assume" these are the following:

No.1 on channel 1
No.2 on channel 5
No.3 on channel 12
No.4 on channel 31



These will NOT be the exact frequencies, I am simply using those as examples because they are easy ones to remember.

I want to use a 5th HC-12 with a Micromite but I want it to talk to BOTH of the other ones on different frequencies.

I have set the frequencies of the first 4 X HC-12 with the Excellent HC-12 Config Utility.

IS there a code I could send to the 5th HC-12 to change it's frequency when I want to use it?

For example lets say I want it on channel 1 most of the time, (let's call it the "default frequency"

At some stage I will want it to change the frequency talk to No.2 on channel 5 and send "transmit data"

How could I do this from a Micromite? I'm sure it's possible but I don't know enough about it to figure it out.

It MUST also change back to the "default channel 1" when it's done that task.

Also

At some stage I will want to talk to Number 3, and 4 HC-12's and do the exact same thing, but after each communication it MUST change back to the "default channel" channel 1

I've read the manual and it seems that the frequencies are in "channels"

And AT+Cxxxx is the command to change channels

If I want to keep the baud rate and the power level of all the modules the same (set previously with the HC-12 Config Utility, so the only thing I need to change is the 5th HC-12 and ONLY change channel as it's ONLY the 5th HC-12 that will be receiving the messages from the other HC-12's

So assuming I want to change No 2 HC-12 to channel 5 send the message "send data".

At the start of the received data data would be something like "No.2 Sending" then the message

How can I check for the correct response and once it's received tell the HC-12 to go back to channel 1?

Hope I made that clear, I can see what I want to say in my head but I find it hard to find the correct words.

Lewis

EDIT: The SET pin on the HC-12 is connected to a Micromite pin so I can pull it LOW when I want to change channel/frequency
Edited by lew247 2016-05-18
 
RonnS
Senior Member

Joined: 16/07/2015
Location: Germany
Posts: 120
Posted: 11:09am 17 May 2016
Copy link to clipboard 
Print this post

hello Lewis,

i do similar things at time

my slaves for fieldwork are picaxes the are in the garden and the Micromite as LCD-Backpack is in my living room

i think it should work how follow:

send a command to switch in a subroutine were you do the setpin to low and send out the AT Command*s

your receiving channel should have an interrupt to receive the answer from the HC-12

......


i do all these things with interrupts.. so i have a good feeling
and it works

example for my Picaxe Waterswitch with an HC-12
; *******************************
; ***** Sample Header File *****
; *******************************
; Filename: Wasserschalter
; Date: 09.05.16
; File Version: 1
; Written by: Ron's
; Function:RemoteControl WaterValve
; Last Revision:
; Target PICAXE:20X2 / AXE118
; *******************************


#picaxe 20x2
#no_table
#no_data
symbol index = b10
;Hserin=Pin B.6
;Hserout=Pin C.0
SYMBOL batV = w10
SYMBOL ADCval = w9
SYMBOL D1 = b14
SYMBOL D2 = b15
symbol switchflag=b22
Low b.2:Low b.3:switchflag=0
hsersetup B9600_8,%001 ;<--this sets up the hser stuff: 1= N ,0, 1=Hserin background enable
setintflags %00100000, %00100000 '<--this will zip down to the interrupt
' routine
Hserout 0, ("I+STARTED+My+Tramsmission+and+Reciving+Job")
main:

if pinc.3=1 then gosub VENTSW 'the pushButton

pause 150

goto main

interrupt:
pause 200; wait a while to be sure you got everything --may or may not need this
low c.7
get 0,b1 ;<-- this is the first byte that came in (scratch pad location 0)
get 1,b2 ;<-- this is the second byte that came in (scratch pad location 1);
get 2,b3 ;<--and so on. All the bytes that you receive will get put on
get 3,b4 ;the scratchpad --use "get" to read any or all of them
get 4,b5 ;they come numbered in the order they come in
get 5,b6
get 6,b7
get 7,b8


if b1<>"g" then goto MAIN
if b2<>"G" then goto MAIN
if b3<>"W" then goto MAIN
if b4="H" and b5="E" and b6="L" and b7="L" and b8="O" then gosub HELLO
if b4="V" and b5="E" and b6="N" then gosub VENTSW
if b4="S" and b5="T" and b6="A" and b7="T" and b8="S" then gosub Status



hserptr = 0 ; reset the background receive pointer (scratchpad pointer)
; the next time we get some data, it will get written to the
' scratchpad starting at location 0 --sorta "resets" the system
; ready for the next send

hserinflag=0 ;reset the interrupt flag so you don't interrupt again
;as soon as you leave this subroutine

setintflags %00100000, %00100000 'fire up the int flags again

return ;get back to what ever you were doing
HELLO:
hserout 0,("HELLO")
CALIBADC10 ADCval
batV = 10475 / ADCval
BinToAscii batV,D2,D2,D1
Hserout 0, ("AKKU:",D2,",",D1,"Volt")
return

VENTSW:
high c.7' is an LED
if pinc.3=1 or b7="T" and b8="G" then 'pinc.3 is an manual switch
if switchflag=1 then
switchflag=0

toggle b.2
toggle b.3
hserout 0,("+Ventil=Zu")
else
hserout 0,("+Ventil=Auf")
toggle b.2
toggle b.3
switchflag=1

low c.7
endif


endif
pause 250
return
Status:
hserout 0,("HELLO")

return



Ron's

Edited by RonnS 2016-05-18
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1676
Posted: 01:42am 18 May 2016
Copy link to clipboard 
Print this post

Thank you RonnS that is very helpful

One last question for anyone.

If I want one of the HC-12's to go into "sleep mode" until I need to question it again I can send the command "AT+SLEEP"

and to wake it I send the command "AT"

Does the HC-12 I want to sleep need to have the SET pin low for this to work, or can I leave it disconnected (pulled high internally)

 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2289
Posted: 02:14am 18 May 2016
Copy link to clipboard 
Print this post

  lew247 said   Thank you RonnS that is very helpful

One last question for anyone.

If I want one of the HC-12's to go into "sleep mode" until I need to question it again I can send the command "AT+SLEEP"

and to wake it I send the command "AT"

Does the HC-12 I want to sleep need to have the SET pin low for this to work, or can I leave it disconnected (pulled high internally)



from the HC-12 datasheet:
"• AT+SLEEP
After receiving this command, the module will enter sleep mode upon exiting from
command mode, with a working current of about 22uA. This mode doesn’t allow
serial port data transmission. Upon entering command mode again the module will
exit from sleep mode automatically.
e.g: When wireless data transmission is not needed, to save power send command
“AT+SLEEP” to the module, and the module will return “OK+SLEEP”. Upon exit from
command mode the working current will drop to about 22uA."

so pull pin 5 low, wait 40mS or so, then send the string "AT+SLEEP" to the module. the module will respond with "OK+SLEEP". release pin 5, and the module will then go into sleep mode, only drawing 22uA. to wake up the module, pulse pin 5 low for at least 40mS.

btw, are you really sure that you need to use more than one channel? what if every message sent started with a 2-character header consisting of a letter that identifies the sender followed by a letter indicating the intended recipient? so if module 'A' wanted to send a message to module 'C' it would transmit something like "AChello there"; every module would see the message, but only module 'C' would take any notice of it. send any periodic messages with a small random time delay to help avoid message collisions, and define that the receiving module should respond with an acknowledgement message back to the sender.



cheers,
rob :-)
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1676
Posted: 02:49am 18 May 2016
Copy link to clipboard 
Print this post

It's basically remote temperature monitoring for fridges/freezers
I thought about having a Micromite in or attached to a fridge/freezer monitoring the temperature.
Powered by an "AA/R6" battery with a boost converter and a HC-12 on every fridge/freezer
The fridges are in different parts of various rooms so one Micromite/HC-12 is not realistic.

The sleep command would have been great as it would greatly reduce power consumption from the battery, However I fear it won't actually work.

To wake the HC-12 from sleep the Micromite would have to pull the "set" pin low when I wanted to talk to that HC-12 from the "master Micromite"

As the master communicates via HC-12's then I can't see any way of making this happen.
The HC-12 would be sleeping until it's told to wake by a command from the Micromite, however to get this command, the Micromite needs to be woken up by a signal on the HC-12 module.


The only other option I can see is maybe get the Micromites to "wake up" at regular intervals of maybe 15 minutes, turn the "set pin" low and see if wait for it to be interrogated by the master Micromite.
Then after the temperatures have been sent, the master can tell the remote HC-12 to pull the "set pin" low, "go to sleep" then tell the micromite to start it's timer again and sleep

Not sure if that would work or not... but worth more thought I think
 
manuka
Newbie

Joined: 18/12/2006
Location: New Zealand
Posts: 19
Posted: 12:24am 16 Jun 2016
Copy link to clipboard 
Print this post

In NZ (at least) a SDR spectrum slot between 471.0000 - 471.5000 MHz now allows 100mW power. Conveniently this suits two HC-12 channels
of Ch.95 (471.0000 MHz)& Ch. 96 (471.4000 MHz). At 458.6000 MHz (HC-12 Ch.64 ) 500 mW power is now legally allowed.

Refer => https://gazette.govt.nz/notice/id/2016-go446 Edited by manuka 2016-06-17
 
     Page 3 of 8    
Print this page
© JAQ Software 2024