HC-12 working supply

ZOR

Senior Member
I did not want to tack this onto another running HC-12 thread, not fair on the origins.

Does anyone know a UK source of WORKING HC-12 devices. I bought 6 on Ebay, 3 from 2 suppliers and all dead? Don't know if anyone has same experience and knows trusted source. RS Components don't have.

I have seen another supplier in Jersey, photo attached. It shows what I am guessing is a crystal T300, however my boars have another number on T300 6CXK? Is this any clue why my units not work. Or is it another component ie capacitor?

Cannot load image???
 
Last edited:

Jeremy Harris

Senior Member
I've bought around 20 of them now, from two or three different ebay sellers. All have worked OK, with no failures. Having such a high failure rate from units from different suppliers suggests that there may be some problem related to your application that's killing them. One thing that I'm reasonably sure might cause damage is to try and use one without an antenna connected, for example, as they default to the maximum transmit power, as delivered.

Perhaps if you can let us know a few more details of exactly how you are programming and connecting the modules we might be able to suggest why you're having problems with them.
 

manuka

Senior Member
Jeremy echoes my (& other colonials) POSITIVE HC12 experiences, & AFAIK all ordered have worked a treat. Mine continue to effortlessly come from Satisfy Electronics,who also give free international shipping.

I strongly suspect your setup may be wonky - the quickie schematic below shows a simple 08M2 testing setup. Stan.
 

Attachments

Last edited:

ZOR

Senior Member
Thanks Jeremy. I am currently using an arduino with the device as there were many easy to grab cut and paste sketches. I am always fitting the antenna's.

I had a working TX and RX pair until I killed the receiver unit with excess voltage. The transmitter should be working okay as I get a buzz from my pc speakers when transmitting.

I just looked at the working HC-12 device in the TX unit, that has a crystal or device marked T300 C10H. The units that don not work have a website address painted on www.hc01.com but could not be foung on Google? I want to move my final project over to Picaxe when I get something sorted.

Code:
#include <SoftwareSerial.h>

SoftwareSerial mySerial(6, 5); 
int ledPin = 13;

void setup() {
  mySerial.begin(9600);
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
  
}

void loop() {
   
  if(mySerial.available() > 1){    
    int input = mySerial.parseInt();//read serial input and convert to integer (-32,768 to 32,767)    
    if(input == 1111){//if on code is received
      digitalWrite(ledPin, HIGH);//turn LED on
    }
    if(input == 0000){//if off code is received
      digitalWrite(ledPin, LOW);//turn LED off
    }
  }
  mySerial.flush();//clear the serial buffer for unwanted inputs     
  
  delay(20);//delay little for better serial communication
 
}

EDIT: The hc01 website now found? Chinese though.

Thanks manuka could not see schematic? Regards
 

manuka

Senior Member
ZOR: Whoops - rustling it up on the fly! Attached above now. Forum upload V-E-R-Y slow for me...

Almost all my 433 MHz circuitry is 3 x AA powered, although I increasingly use 3.2V LiFePO4 .

Robert Rozee translated Ver 2.3 Chinglish manual into a more lucid form. Many of these HC-xx modules derive from a firm in Guangzhou - here's their Google translated website https://translate.google.com/translate?sl=zh-CN&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=www.wavesen.com&edit-text=

FWIW (& aside form this Forum being PICAXE focused) you are making things much harder for yourself using an Arduino to tame such a device. Stan.
 
Last edited:

Jeremy Harris

Senior Member
I've just had a look at my spare modules, that I think are a mix from at least two suppliers, one probably being Satisfy Electronics. All are identical and none have a website marked on them. All have a blue component side, with the small logo "HC" under the microcontroller and to the left of the crystal. All also have the "HC" logo on the white underside.

How did you program the HC-12s to set the power, mode and baud rate? Mine are all now programmed with the very useful utility that Robert Rozee kindly made available (there are links on the main HC-12 thread).

Over-voltage would be a fairly sure-fire way to kill modules, I expect, mine have always been run from a 5V regulated supply.

It looks as if the Chinese website may well be the manufacturer, as they have this English data sheet there: http://www.hc01.com/Public/uploads/file/HC-12 english datasheets.pdf that shows modules that look the same as those I have.
 

ZOR

Senior Member
Thanks Jeremy, interesting as the pictures shown in the manual have crystal marked with a number/mhz, whereas mine have other numbers. If I could find a Picaxe schematic I will try with Picaxe and look up the configuration software although I know my transmitter side should still be working okay so the unit as a receiver should not need configuring (maybe wrong)

I will google for Picaxe/HC-12 project Regards
 

Jeremy Harris

Senior Member
There are details of connecting and running a Picaxe with these modules in the main HC-12 thread, with code examples (although none are needed really, you just send data using serout and receive data with serin, pretty straightforward). For use in the UK these modules need to be programmed, as by default they are set to +20dBm, which is more power than is legal. It's also a good idea to choose a channel that's both legal and that doesn't clash with other things on the 433 MHz band. Programming the modules with the utility that Robert Rozee has written is very easy from a Windows PC, or you can add an additional connection and programme them using a Picaxe; there's code for doing this in the main thread.
 

ZOR

Senior Member
Thanks Jeremy, I will go through main thread. I am still wondering why my crystals are not marked with Mhz frequencies, don't know if there are variations in units. Just seen where manuka has put Picaxe layout, will now try out. Thanks again and manuka.
 

hippy

Technical Support
Staff member
It shows what I am guessing is a crystal T300, however my boars have another number on T300 6CXK?
I just looked at the working HC-12 device in the TX unit, that has a crystal or device marked T300 C10H.
I would guess that the extra four character code is production date and/or other manufacturer's data. Whatever it means I would not expect that to be the cause of the problem.

As to why surface mount chips use 'meaningless codes' rather than more clearly state what value component they are; I have no idea, but that does seem to be common, an industrial standard. I guess a short code allows a device to be more precisely defined when the full information required may not fit when printed on a small device.
 

ZOR

Senior Member
Thanks hippy. I have just had an email from Chinese Ebay seller, said they had others complaining their units not working. Appologised, refunded, and said because caused trouble would free issue two from other supplier he knows should work. Honest many hey?
However will play with Picaxe version when sorted plus download configuration software to stay legal.

Thanks again everyone for help
 

manuka

Senior Member
ZOR: Good to hear of their concern, but perhaps mention just who was the seller !

[Ponder mode] As Hippy has made a response it may well be worth again sounding out Rev. Ed's interest in supporting these extremely cost effective & (normally !) reliable HC-12 modules. Classic 2 module (since individual TX & RX) ASK approaches are now tending more costly, power supply picky & "footprint hogging" than a single & far more versatile HC-12 transceiver.

A simple 08M2 driven layout (such as mine-now somewhat enhanced below) & bare bones "it's working !" code may significantly assist learners. Many such folks are increasingly familar with device configuration needs too.

FWIW: A 3rd HC-12 module, placed perhaps in an elevated position & solar powered, could also act as a range enhancing "store & forward" repeater. [/ponder mode] Stan.
 

Attachments

Last edited:

premelec

Senior Member
Hi Stan, how about basic code that runs the 08M2 for your schematic and reconfigure code sent FROM 08M2 to HC12 rather than having to hookup to computer... that would complement your diagrams... and our appreciation for your prolific knowledge of these units... thanks....
 

manuka

Senior Member
Premelec: Fair comment on PICAXE command config.,although it may well be that "Rozee" preconfig may better suit many learners. Many such tender souls have enough hassles with SERIN without dazzling them with embedded AT commands !

Preconfig. is the sort of thing schools could do before issuing. Given their past support for Ciseco's now discontinued ERF/XRF/URF modules, Rev. Ed themselves -if interested- could sell HC-12 in such a preloaded form.

NOTE: As the raw module's TX work "outa-the-box" at 100 mW, preconfig is of particular significance when only 10 mW is allowed (as in UK etc). Stan.
 

AllyCat

Senior Member
Hi,

The default (factory) settings of the HC-12 do seem rather "unfortunate", particularly if Jeremy is correct that transmitting at full power without an antenna may destroy the chip. It means that Rev Ed would probably need to reprogram every module before sale; but the low cost of these modules must be at least partly because it is now such a "generic" product.

IMHO for real novices it may be better to reprogram the HC-12s directly by the PICaxe application, rather than have to load (and make connections to) other software (e.g. Robert Rozee's) on a PC. Then, their PICaxe program could simply CALL an "init" subroutine (which they needn't understand in detail) in the same way that they may CALL an init subroutine for an OLED/LCD display.

So, whenever possible, I would design the hardware to accommodate the AT commands (i.e. SET pin connected). Of course the number of pins is limited with a an 08M2, but cant' the "TXD" (received) data pin be connected to the "Input Only" pin (c.3, leg 4), leaving c.4 (leg 3) available to be connected to the SET pin? Then I'm sure some kind soul will soon contribute a suitable initialisation routine for more "wireless- (and battery-) friendly" short-range applications in the UK and elsewhere.

Cheers, Alan.
 

hippy

Technical Support
Staff member
IMHO for real novices it may be better to reprogram the HC-12s directly by the PICaxe application, rather than have to load (and make connections to) other software (e.g. Robert Rozee's) on a PC. Then, their PICaxe program could simply CALL an "init" subroutine (which they needn't understand in detail) in the same way that they may CALL an init subroutine for an OLED/LCD display.
I believe it has been said before; that if anyone wants to create a program to do that, or have any other initialisation and usage example code for HC-12 modules, they are more than welcome to post that here or in the finished projects section of the forum.
 

Jeremy Harris

Senior Member
Hi,

The default (factory) settings of the HC-12 do seem rather "unfortunate", particularly if Jeremy is correct that transmitting at full power without an antenna may destroy the chip. It means that Rev Ed would probably need to reprogram every module before sale; but the low cost of these modules must be at least partly because it is now such a "generic" product.

IMHO for real novices it may be better to reprogram the HC-12s directly by the PICaxe application, rather than have to load (and make connections to) other software (e.g. Robert Rozee's) on a PC. Then, their PICaxe program could simply CALL an "init" subroutine (which they needn't understand in detail) in the same way that they may CALL an init subroutine for an OLED/LCD display.

So, whenever possible, I would design the hardware to accommodate the AT commands (i.e. SET pin connected). Of course the number of pins is limited with a an 08M2, but cant' the "TXD" (received) data pin be connected to the "Input Only" pin (c.3, leg 4), leaving c.4 (leg 3) available to be connected to the SET pin? Then I'm sure some kind soul will soon contribute a suitable initialisation routine for more "wireless- (and battery-) friendly" short-range applications in the UK and elsewhere.

Cheers, Alan.
I agree, that a simple bit of Picaxe code to program and verify settings does avoid the need to use an FTDI or similar. It doesn't need an extra pin, as the "set" pin could just be linked to 0V whilst the HC-12 programming code was run. A bit of code that echoed the confirmation transmission back from the HC-12 to the terminal, using sertxd, would seem easy enough to put together.
 

ZOR

Senior Member
I will wait to see if any code comes alongfor the configuration application. I downloaded it, unzipped it, but when clicking on the application it said it could not find a path or anything, finally deleting itself after saying I had no permissions.

My application is to talk to an outside camera to pan/tilt, through walls of house to outside. When I did earlier tests it went through walls like butter, however then finding it's output power was illegal. I did consider carrying on with high power as the number of times it would change the camera position was so infrequent. Also with memories of how longwinded and often aborted traces were done on pirate radio stations. Never the less it would be nice to reduce the power to maintain its use but nearer to being legal if neccesary. So hopefully somone will be a good souled donor of a Picaxe program.

EDIT:
Looking at the Picaxe layout, what does the uunusual inverted supply pinouts mean, pins 1 and 8 normal. Also if using the Picaxe AXE lead to program, the juction of the 10k and 22k does not exist under the basic wiring requirements for the 08M2. Is the layout correct for using the Picaxe programming cable. Thanks
 
Last edited:

premelec

Senior Member
In an earlier thread PhilHormby referred me to: http://www.picaxeforum.co.uk/showthread.php?29089-Demonstration-of-HC-12-radio-module-configuration&highlight=configuration - he actually had the SET pin of HC12 driven by PICAXE. My idea is to have various configurations available for field testing of range etc - using an ADC input pin that would be read on startup and then leave existing config or setting a new one if SET pin LOW in accord with . ADC select pin... I haven't yet got it together but Phil's post shows the way... if I get it going I'll post something...

#199 post in http://www.picaxeforum.co.uk/showthread.php?28893-HC-11-and-HC-12-transceiver-modules/page5 was where Phil's ref was obtained

maybe there should be an HC12 forum... ;-0
 

JPB33

Senior Member
I had similar problems trying to configure the HC-12 until I got the correct Prolific Serial lead as reccomended. Clicked exe on the downloaded config file, said yes to security messages, double clicked on the select serial port for Prolific Serial and it was away---brilliant!

Really easy to change anything after that, thanks to manuka for all the advice.
 

The bear

Senior Member
Looking forward to seeing some 'simple' code to get me started. I was able to get the cheap RF modules working.
Thanks to everyone involved.
Regards, Bear..
 

manuka

Senior Member
srnet: CRC apparently not a HC-12 feature -refer comments here.

ZOR: My unusual 08M2 supply mention relates to numerous DIP ICs having +V supply at their "last leg" & GND on the "dot" side. Such alerts arose from my lengthy e-educational career, during which hands on learners wrestled with the likes of logic IC's, 555s, 741s etc. Much lab. time was spent 1970s-80s supervising breadboarding of diverse DIPs,with foggy assumptions abounding. I well recall an early 2003 PICAXE class where one poor soul even assumed a 555 was a PICAXE-08 ! You can imagine the associated frustration ...

Hippy: My point relates to Rev.Ed themselves actually supporting the HC-12. Nottingham's 365Agile/Wireless Things/Ciseco closed 2016,yet their more costly CC1110 based XRF seems still listed at the PICAXE Store...

All: Point taken about PICAXE control of "SET" -especially on the fly. Diagram below tweaked for this at PICAXE Pin 4, with SERIN now at Pin 3 (which of course is input only)

Stan.
 

Attachments

Last edited:

ZOR

Senior Member
Thank you Stan, that answered that. Does one have to have two modules up and running to just set one HC-12 to different power output levels. I want to just slowly go down in power levels until the concrete/brick walls of the house prevent a simple remote control to the outside house stops working.
 

manuka

Senior Member
ZOR: Quick reply as late here,& past concentrating. Best you clarify this concrete wall need please !

HC-12 modules adjust power using AT+Px, with the x range 1(weak) to (strongest). You can embed AT commands within "quotes" like this - SEROUT pin, data rate, ( "AT+P1", CR) The SET pin will need pulling low prior to the command being issued, then taken high again after so normal SEROUT data can be sent.
N.B. That's my assumption as -preferring Rob. Rozee's GUI- I've yet to try such at the AT level.

Code one module to send while the other just confirms reception somehow (LED flash etc).

Perhaps grab some stepped power ideas from Andrew Hornblow's far more involved LoRa based approach ? Stan.
 
Last edited:

ZOR

Senior Member
Many thanks Stan. I will put together an 08M2 board and just try and reduce the power output in steps. I will see by the receiver outside if it is receiving okay. The house has 3-4 walls between the tansmitter and receiver, and the HC-12 is the only device I have found to transmit through walls so well, although due to illegal power. I have not checked if all the neighbours cars have unlocked themselves and planes seem to be still flying past. (laugh)
 

Jeremy Harris

Senior Member
My experience is that at low baud rates the HC-12s can easily communicate through a couple of 400mm thick walls to a shed around 35m away at the end of the garden, just using the rather poor coil antennas supplied with the modules. They aren't so good at higher baud rates. The best (UK legal) range for me is when the modules are used in mode FU3 at a baud rate of either 1200 or 2400 (range is the same with both), with the power set to +8dBm.

At 1200 and 2400 baud the actual transmission baud rate is 5000 baud, but when the baud rate is increased to 4800 or 9600 the transmission baud rate increases to 15,000. Range is reasonably proportional to transmission baud rate, so using 1200 or 2400 baud pretty much doubles the effective range over using the default 9600 baud.
 

ZOR

Senior Member
Thanks Jeremy, very useful to know. So hopefully when I finish my 08M2 board to take Plug in HC-12's for future configurations and redownload the config editor I should be able to play with settings.

1) Does SET have to be permanently grounded, or just momentarily grounded?
2) Would the receiver HC-12 have to be set for the same baud rate?

Thanks again
 

Jeremy Harris

Senior Member
The SET pin has to be connected to 0V to allow programming, then left floating or high to allow normal operation. Yes, both HC-12s in a link must have the same settings to work. I've found that 2400 baud is fast enough when only sending a dozen or so bytes, so tend to use that speed on all the units now. The over-the-air transmission baud rate is really 5000 baud when either 1200 baud or 2400 baud are set, and the receiver sensitivity is about 5 dBm better at this speed than it is for the 15000 baud over-the-air transmission baud rate that's used at 4800 or 9600 baud. 6dBm difference is equivalent to a doubling or halving of effective range, which is why the range is so much better at the lower baud rates.

If you need very long range then you can use FU4 mode, which has a long latency time and low baud rate (1200 baud only) but gives a range of up to around 1.8km in open air. My experience of using mode FU4 is that it easily works from one end of our village to the other, through several houses on the way.
 

ZOR

Senior Member
Thanks a lot Jeremy, one end to the other of a village with power set to +8bBm makes my transmission look a walk in the park. Should be able to reduce parameters down to achieve what I want. I am just sending four number numeric codes 1001 or 1002 or 1003 etc to act as remote control functions, so nothing long in length or duration.
 

ZOR

Senior Member
Got my board set up, and now the configuration editor appears. However I set my configurations and press Send, but get error?
I am only using 1 HC-12 with an 08M2
Also keeping SET held to ground.
Using AXE027 Cable

ERRORS.jpg

What am I doing wrong? Thanks

EDIT: Just clicked logo, says Release 1 12 Jan 2016. Is this current version?
 
Last edited:

Jeremy Harris

Senior Member
How are you connecting your PC to the HC-12? To work with Robert Rozee's utilities, you need to connect it with a non-inverting USB to serial adapter, like the FTDI module, with the Tx of the FTDI connected to the Rx of the HC-12, and Rx of the FTDI connected to the Tx of the HC-12. The SET pin needs to be connected to 0V to put the HC-12 into AT mode, so it can accept programming commands. There should not be a Picaxe connected to the HC-12 when using Robert Rozee's programming utility.

Alternatively, you can programme a Picaxe to send the AT commands to the HC-12 if you wish. This needs a bit of code to send the various AT strings for the settings that you want, plus some code to verify that each string has been received and acted on before sending the next. I'm pretty sure there are example bits of code to do this in the main HC-12 thread, although it's not something I've tried, as I've programmed all mine using an FTDI and Robert Rozee's utility.
 

ZOR

Senior Member
Thanks Jeremy. I just built Stans test setup. The setup diagram shows Robert Rozee's on the right hand side. So I put it together, used the AXE027 cable and that was it.

Whether what I have built now will be any good for doing what I wanted by sending commands via the Picaxe, don't know. I think the HC-12 is too easily bought by people like me who did not know the output was default to being illegal. I might go back to see what can be done with the dirty word Arduino. https://rydepier.wordpress.com/tag/hc-12/
Shame as I wanted to use the Picaxe. Thanks for your help.
 

AllyCat

Senior Member
Hi,

[Jeremy beat me to the answer! But here's a little more detail. Don't give up on HC-12 / PICaxe just yet.]

How have you connected the AXE027 to the PICaxe board / HC-12 ?

If I'm reading Stan's diagram correctly, the HC-12 needs to be driven from a "RS232-TTL" signal, which is inverted relative to the serial/programming signal from an AXE027. That's why I suggested that novices might be more comfortable programming via/from the PICaxe. But it does need somebody to provide some simple code:

But perhaps we should come to some consensus of what would be appropriate settings for a "novice" user (as a simple alternative to the ubiquitous "dumb" modules). Jeremy has given some very good indicators and I agree that "Power level 4" would be a good choice, but level 5 is probably "legal" because the regulations refer to Effective Radiated Power (10 mW) and those little spring antennas aren't very efficient. But I do think the frequency should remain within the "433MHz" band, probably "Channel 1" (433.4) or "Channel 3" (434.2), avoiding the very commonly-used 433.92 MHz centre frequency. However, I'm not sure about the "FU" mode; 2400 baud is probably "good enough" for most PICaxe applications, so with battery operation in mind, I'm tempted to suggest the low power FU2 mode. But that does use a very high "air" bitrate, so perhaps FU3 is preferable?

Another advantage of having active (i.e. PICaxe) control of the SET pin is that the HC-12 can be put into Sleep mode (then woken by taking SET low). The (active) power consumption of the HC-12 is much higher than simple dumb modules, so power-saving measures may be needed for some battery-powered applications.

Cheers, Alan.
 

Jeremy Harris

Senior Member
Just to try and make things clearer, there are two fairly easy ways to programme HC-12s:

The first is to use a USB to serial converter that has normal (not inverted) logic level outputs, like an FTDI, but I am pretty sure others would work. The USB to serial converter plugs in to the PC and can also power the HC-12, as well as programme it. The SET pin needs to be connected to 0V, the HC-12 Tx is connected to the USB to serial Rx, the HC-12 Rx is connected to the USB to serial Tx. Robert Rozee's utility should find the USB serial port and then allow the HC-12 to be both programmed and verified.

The second way is to connect an HC-12 to a Picaxe chip (any one would do) and then write a simple sequence of instructions to send AT commands to the HC-12, with the SET pin connected to 0V. There are code examples in the HC-12 thread that show how to change HC-12 settings, and reading those should give you a good idea as to what to do. All that is needed is to write a sequence of serout instructions, with serin instructions and sertxd instructions to echo back the module verification. All the commands are listed in the HC-12 data sheet. For example, to program an HC-12 to operate at +8dBm instead of the default +20dBm then the following code should be executed once (assumes a Picaxe operating at the default 4MHz, with TxPIN being the transmit pin from the Picaxe, RxPIN being the receive pin):

serout TxPIN, T9600_4, ("AT+P4") 'sends the "AT" command to set the power to +8dBm
serin RxPin, T9600_4, b0, b1, b2, b3, b4 'receives the verification from the HC-12, 5 bytes, "OK+P4"
sertxd (b0, b1, b2, b3, b4) 'sends the verification string to the terminal

(the above hasn't been tested!)

Using an Arduino won't make any difference to this, it just means using more complex code to do the programming.

These modules are sold from China, and aren't set for any particular countries power limit. They are almost certainly OK to use at the default settings in some countries, but the UK has a 10mW limit for unlicensed use in this frequency band.
 

ZOR

Senior Member
Thanks both. I will persue sending AT commands using the Picaxe with serout and serin as you are suggesting. All very useful information and appreciate the time being taken to help. Certainly want to make things work as this is the first device I have played with that seems able to get through walls to the outside world unlike all the other 433mhz devices that I have tried in the past. Many of those failed to work inside let alone outside.
 

srnet

Senior Member
srnet: CRC apparently not a HC-12 feature -refer comments here.
Well given the intended market for PICAXE devices, I would suggest that for someone like Rev Ed to adopt the HC-12, the lack of CRC problem needs to be solved internally in the HC-12 or with extra firmware.

Novice users would not expect that if they send '123' over an RF link that they then need to do a lot of extra programming to ensure that its '123' that is actually received.
 
Last edited:

Jeremy Harris

Senior Member
In practice errors seem to be very rare. In around 6 months of running a pair that handshake and transmit a dozen bytes every 6 minutes, 24/7, I've not yet had a single error. I suspect that for the vast majority of users the lack of a CRC won't be a practical issue at all. I accept that for those pushing the boundaries with range, then these modules aren't the best solution, but if wanted to get very long range operation I'd not use these (or the now obsolete Ciseco modules) but would use something like a LoRa solution.
 

ZOR

Senior Member
Sorry guys, I took the easy way out using the Arduino in #34. Set my AT codes in the serial terminal window, made my power legal 8dBm 6.3 mW. Will see what happens on distance.

My earlier tests were done with Arduino only because there are many articles with cut/paste coding. I was sending numbers 1001-1010 to a camera for pan/tilt and OSD camera configuration settings. It never seemed as though the wrong codes were ever sent/received. I will move back to Picaxe serout/serin as my package inside a camera will be much smaller and familier. I tried setting baud rates but kept getting errors (gobaldegook) in serial window that made me having to enter AT+DEFAULT to get back factory default. So for now keeping 9600 baud rate and see if it causes transmission problems.

EDIT: Works the same with legal setting, excellent. From one side of house through 4 walls to garden, perfect.
 
Last edited:
Top