Question about HT-12D addre3ssing

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

433MHz Transmitter/Receiver pair using the HT-12D/HT-12E Encode/Decoder to exchange data.  Got off ebay 433MHz RF Transmitter/Receiver

 

Firstly the HT-12E transmit circuit is working with another circuit using A0-A7 tied to ground.

 

What I'm attempting to do is dynamically set the HT-12D's address to either 0 or 1.  On some datasheets it says to either tie to ground or leave open on others it says can be tied to either VDD or VSS.  So I reakon my question is will this work if I use an ATMega328P (UNO) to set the address or not.

 

I've tried setting all to LOW and variations between and can't get it to work.

The Shift register (74HC5595N) is getting set correctly, the receiver has data coming in when I xmit data but seems like the addressing is just not working. 

 

Additionally all 4 data inputs stay at HIGH level.

 

Any help much appreciated!

 

This topic has a solution.

Happy Trails,

Mike

JaxCoder.com

Last Edited: Tue. Aug 13, 2019 - 08:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When you say the Tx is working, I assume you mean that your "other circuit" is a receiver, and that it is correctly decoding the transmitted data.  If so, that's a great start, as it means the Tx circuitry is working.

Looking at the data sheet, (but not having the chips on my bench...), it would appear that the Addr signals could be driven high or driven low, in addition to floating high, and being driven low.

Do you have a by-pass cap, 0.1 uF, across the V+ / Ground pins for all of the chips, (The shift register and the HT12D)?

You mentioned that you wish to set the address dynamically?

Have you seen it mentioned that one can do that?

The point being, it the Address is read on the power up of the chip, then obviously you can't set it dynamically unless you free up another pin to cycle the HT's power on and off, as well.

Can you simply breadboard the HT Rx and watch the VT signal with an O'scope?

That would eliminate a lot of variables until you have verified the initial, basic circuit, is working.

I assume your Osc Resistor is in spec?

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

my first thought,

leaving it float or low vs high - low.... that will indicate there is a weak pull-up inside, so when you leave the line float it will be defined high else it is defined low. This way they ensured that if you do not connect the pin it will always be defaulted.

 

It might be as Doc said that the chip only read the address line during power up, it then configures its internal stuff to be that specific setting, and after that the pin is a don't care. Note that they might not tell that explicitely in the datasheet, but it a lot of the times is there in the small letters or some mysterious diagram that tells one what has to be done before what to get good operation.

you could smply take one unit lift the power pin and put a switch in series, then after you changed the address you power cycle the chip and see what happens.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the input Doc.

 

What I meant by other circuit is that I have an Rx/Tx pair working and I'm using the Tx from that pair to test this circuit.

I searched for quite a while to see if this had been done before but only found examples of static addressing. 

My idea is to create an RF scanner that can cycle through addresses looking for a signal(s) at various addresses and locking in on a channel and monitoring it.

 

I put a 10uF electrolytic capacitor across +5/GND and it didn't help, I'll try the bypass caps and see if that helps.

 

Looking at the block diagram for the HT-12D in the Holtek datasheet it reads that the addressing uses a "Transmission Gate Circuit" so I googled and found What is a Transmission Gate.

 

Basic Operation

A transmission gate, or analog switch, is defined as an electronic element that will selectively block or pass a signal level from the input to the output. This solid-state switch is comprised of a pMOS transistor and nMOS transistor. The control gates are biased in a complementary manner so that both transistors are either on or off.

 

The Transmission Gate feeds into a comparator that I assume does the comparing of incoming address to that of the  gate address,

 

So I fired up Saleae Logic Analyzer and flipped the A0 dip switch on the xmit circuit and the analyzer shows a different pattern as shown in the image.

 

 

So the way I read it, it appears like it can be done.

 

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cool.  But...

I think your test shows that the Tx will allow dynamically changing the address.

It reads the Addr data and the Data data and sends out the data burst, (three times, or whatever).

 

I'm not sure that test shows that the Rx can dynamically change its Addr data, on the fly.

In "normal" operation, for a garage door opener, or an RC vehicle, etc., the Rx Addr might well be settable by the user, through a banked DIP Switch, (old school), or through a smart phone interface, (new school), but once you set it you generally leave it alone.

 

In any event, it sounds like you have the hardware necessary to test this, i.e. your working Tx & Rx pair of devices, (unless they aren't configurable).

The test would be to set your working pair to Addr 00h, turn them on, and confirm that you can Transmit a data packet and correctly receive it.

 

Then, without turning off the power to the receiver, change it to Addr 01h.

Change the transmitter's Addr to 01 h also, with or without cycling its power, (or both ways...), and again see if the Rx acknowledged the Addr change, and captured the new data transmission on the new address.

That will confirm that you can change the Rx's Addr on the fly.

 

Some more trouble shooting thoughts...  As I wake up this morning, (so bear with me as I think out loud).

 

Even if the Rx won't allow one to change the Addr on the fly, that doesn't kill the project.

It just means one has to add a high side switch, (an NFet driving a PFet), to turn the HT chip on and off, as you test addresses.

This would slow the scanner down a bit, as each new test needs to await the HT's start up time before one can validly "listen" for an input signal.

That time, BTW, is probably very short, but it has to be long enough for the HT's internal oscillator to power up and stabilize.

If that spec isn't in the data sheet, then it isn't a hard one to measure, and we can work that out down the road.

 

Next, it always seems to me that Projects beget sub-projects...

By that I meant that the HT has very weak Data Output Drivers, ~ 1.5 mA per pin.

So, unless you are using very low powered LEDs it is tough to easily watch the output in real time as your test the setup, AND you still need a data latch for the VT pulse...

So I'd likely power up another Nano with 5 inputs, one for the VT signal, and 4 for the data bus, and use that to capture the VT pulse and the Data Bus data, and let it light up four LEDs for the data, and another one (with a software pulse stretcher), for the VT signal.

The code would only be a couple of lines, and nothing fancy.

No Pin change interrupt for the VT needed...

Just a loop watching the VT pin to see it change state, then read the data bus and display it.

Then have a short, 2 Sec), or whatever delay, and then turn the LEDs off and watch the VT signal again.

 

Easy to test it with your known good working pair of devices.

Then hook it up to your test bed device, so you can easily, at a glance, see the output signal.

 

Do add the by-pass cap, it is an expected part of the design, even if the data sheet doesn't say so.

Put one on both the Tx and the Rx chips.

 

How many of the HT Rx'ers do you have?

Generally, when a new chip isn't working, it is our understanding of exactly what it is suppose to do that is in error, not the device itself.

That said, at some point it is nice to verify that you don't have a dead chip...

 

What is the actual hardware lash-up for your working Tx & Rx pair?

Can you simply replicate the working Rx'er setup with your other chip, as a starting point?

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Doc thanks for the very insightful feedback.

 

After adding the bypass caps to both xmit and rcv units I went back to verifying that they still worked, they don't, kind of.  On the receiver I have a light driven through a transistor, it turns on but won't turn off.  That's one of the reasons I wanted to create this scanner to help determine if hardware/software or user error.  I'm an old software programmer with just enough knowledge of electronics to be dangerous.

 

Both the xmit and receive units have an 8-pin dip switch so I can do as you have suggested, once I get them working again.  Duh don't know why I didn't think of switching addresses dynamically to test.

 

This is the receiver unit that used to work, bypass caps not included in drawing.

Thanks again for taking your time, if you like I will keep you updated,

Mike

Happy Trails,

Mike

JaxCoder.com

Last Edited: Tue. Aug 13, 2019 - 06:09 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Absolutely keep me posted.

I wish to see you successfully resolve your problem.

 

Do keep the by-pass caps on the Tx and Rx chips, they should be there, and their presence is not why things are not working as expected.

 

I don't have the HT Rx data sheet in front of me at the moment, so bear with me if I tell you something incorrectly.

You appear to be monitoring one data bit.

Does the light go out if you change the data being transmitted, and send the new data?

i.e. Is the receiver displaying the last valid data until it gets new valid data?

 

I like to Keep It Simple at the start, and then expand on the project, both hardware and software wise.

 

As you have a Tiny monitoring the data bit, you really don't (yet) need the transistor if your "light" is simply an LED.

The Tiny can drive an LED if it has a resistor in series with it, day 330 ohms, 470 ohms, 510 ohms, etc., (non-critical value, but critical that it is there to limit the current).

 

Is your "light" a small tungsten filament bulb?

If it is an LED then you need a resistor in series with it.

 

The HT Receiver pulses the VT line when it detects valid data.

That was why I suggested the micro monitor the VT line, so when it sees a pulse it can turn on a "VT Pulse / Valid Data" received LED, at least briefly, and then turn it back off.

Part two of that is to read and display the data lines when the valid data VT pulse comes along.

 

Is this your PCB or breadboard?

The 7805 power supply would usually have a Cinput and a Coutput cap, and the Coutput is often a 0.33 uF and a 0.1 uF cap in parallel, or the 0.33uF cap can be larger.

The "exact" values vary from 7805 manufacturer to manufacturer, some are more particular in spec'ing Cout than others.

That's not likely the issue, but as you do more and more hardware tinkering you will want to optimize your designs.

 

As you tinker and play, make sure your batteries are good!

It is very frustrating when your batteries are marginally good, and the circuit fails as an LED turns on...

(Don't ask me how I learned that.)

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The light referred to in the schematic is a 9V flashlight head that consumes approx. 87mA, don't have the exact measure4d number in front of me but that number sticks in my head.

I know it works OK because when the tiny powers up I have it blink twice to indicate it's working.  This receiver is from another project I'm working on that turns on the light when a person walks in front of a PIR that will be at the garage door.  It's so we can put the light anywhere in the garage we need it and we can put multiple lights. 

 

Both xmit and RCV are on proto boards, I use the Radio Shack 710 pin board in a lot of my projects.

 

 

I think my problem is either a bad jumper (home made) or a loose connection because I got to wiggling stuff around and it works but haven't pin pointed exactly where the problem is. 

 

There's light at the end of the tunnel, lord I hope it ain't no train!

 

Mike

 

[update]

Yay got both units to work and the dynamic addressing works also!

Ashamed to say I had a bad jumper and a pin I hadn't soldered.  Bought half blind anymore and hard for me to see.

 

So now I can move on!

[/update]

Happy Trails,

Mike

JaxCoder.com

Last Edited: Tue. Aug 13, 2019 - 08:24 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As an aside, Google should uncover a software implementation of the ht12 protocol. This would simplify the hardware.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Kartman I'll check it out!

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Glad to hear it works!

 

Good luck with the rest of the project!

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

Glad to hear it works!

 

Good luck with the rest of the project!

 

JC

 

Thanks for all your help!  I'll be writing an article and posting to my site when finished if your interested.

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mike32217 wrote:
I'll be writing an article and posting to my site when finished if your interested.
Of course!

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

valusoft wrote:

mike32217 wrote:

I'll be writing an article and posting to my site when finished if your interested.

 

Of course!

 

+1 and don't forget to add your website to your signature, then we do not have to search, hahahahahaha

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

meslomp wrote:
+1 and don't forget to add your website to your signature, then we do not have to search, hahahahahaha

 

Done

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To those interested I got the Receiver circuit uinf an 74HC595N shift register to dynamically scan addresses to work and have written an article and post to my site RFScanner.

It goes over the basic functionality but the article is incomplete and I plan on doing a lot more to it but am going on vacation for 6 weeks so am posting now for my benefit, so I don't forget what I did and so if anyone else might be going down this road it might give them a head start.

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

am going on vacation for 6 weeks

 

OK, rub it in!

 

I'm jealous!

 

JC