Slow rise and fall on ATtiny 85v

Hi everyone

I am currently trying to create small 433Mhz remotes.

These remotes self-power themselves once a button is pressed (to keep the tiny on during the transmission) and then shuts down completely.

This function is working properly but I have a problem with 433Mhz transmission : on the breadboard, it works perfectly. On the PBC, it does not work, plus the signal rises and falls slowly ONLY on this pin (3rd picture).

Any idea what is causing that ?

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  pinMode(PB4, OUTPUT);
  digitalWrite(PB4, HIGH);

  mySwitch.enableTransmit(PB3);
  mySwitch.send(1234, 32);

  digitalWrite(PB4, LOW);
}

void loop() {
}


(Yep, I use audacity as a scope because poor)

Thanks

Ok nevermind the problem of slow rise and fall, the problem appeared on the breadboard

But the transmission is still ok so it's not the problem. From where could my problem come from then ?

Thanks

JeanneD4RK:
it works perfectly

I'm sorry to be pedantic, but as your post later indicates, using the phrase "it works perfectly" is dangerous. The circuit may be working, as expected, but without measurements and verification plan that tests for failure, you cannot verify it is "perfect." A minor issue on a breadboard can manifest itself into a non-working circuit board.

So be careful not to trap yourself in that mindset. It worked "as expected."

JeanneD4RK:
on the breadboard, it works perfectly. On the PBC, it does not work, plus the signal rises and falls slowly ONLY on this pin (3rd picture).

You say "the signal" and "this pin" but you never identify the actual pin. Your code refers to the Tiny's pin/port identify but without comments (or reasonable variable name) it isn't clear to me which traces on the schematic/PCB refer to your code. (Sorry, I don't know the Tiny's pinout by memory.)

Also, what you mean by "radio" in this context. Are you using a 433MHz radio module? If so, which one? What are the B1, B2, and B3 connections for? What is the frequency of the signal you're measuring?

JeanneD4RK:
Ok nevermind the problem of slow rise and fall, the problem appeared on the breadboard

That drifting could be a result of the input-filtering of your audio input and not related to the behavior of the circuit.

JeanneD4RK:
Any idea what is causing that ?

Keep in mind that breadboards have very lousy ground paths. From your PCB diagram, I can't tell how you did your ground plane. Without one, any signals operating at a relatively high frequency (10KHz+) is going to suffer quite a bit of noise and ground loops. Did you fill the unused top side and the bottom side of the board with a ground plane?

Also wondering where in that pretty blue on grey image you see a "slow rise and fall". Actually, I wonder what that image even tries to show. Based on the general forum topic I guess it's some kind of signal, but what??

For the PCB: the few designs I've done so far I gave a ground plane on the bottom (largely unused - a few traces that really couldn't be routed on top) and Vcc plane on the top side (where most of the traces are as well) - all also based on SMD components. For through-hole designs maybe do this upside-down, don't know what'd be better.

Hi,
You need bypass capacitors and place a 10uF capacitor across the power pins of the Tx at the radio pins on the PCB.

Why do you need D1, D2 and D3?

Have you measured the voltage on pin8 of the Attiny to see what your supply voltage is?

You may need to program in a delay between power up and when you send your data.

When designing a PCB remember, you have bought a completely clad PCB and you are paying someone to remove the cladding, so try and leave as much on your board as possible, cos you own it.

All your PCB tracks can be a lot wider for a start.

Tom.. :slight_smile:

Hi,
This might help.
Note the change to R3, it doesn't need to be that low, 2K2 will be bypassing current away from Q2 base.
In fact R3 may not be necessary.

Tom... :slight_smile:

cmiyc:
I'm sorry to be pedantic, but as your post later indicates, using the phrase "it works perfectly" is dangerous. The circuit may be working, as expected, but without measurements and verification plan that tests for failure, you cannot verify it is "perfect." A minor issue on a breadboard can manifest itself into a non-working circuit board.

So be careful not to trap yourself in that mindset. It worked "as expected."

Ok won't do that error again

You say "the signal" and "this pin" but you never identify the actual pin. Your code refers to the Tiny's pin/port identify but without comments (or reasonable variable name) it isn't clear to me which traces on the schematic/PCB refer to your code. (Sorry, I don't know the Tiny's pinout by memory.)

The binary word sent on PIN2 with RCSwitch

Also, what you mean by "radio" in this context. Are you using a 433MHz radio module? If so, which one? What are the B1, B2, and B3 connections for? What is the frequency of the signal you're measuring?

B1, B2, B3 are the pushbuttons, the tiny sends signal depending on which buttons is pressed.
I'm using the basic cheap 433Mhz module
I don't know the frequency of the default protocol for RCSwitch. PulseWidth is something like 360 micros as far as I remember

That drifting could be a result of the input-filtering of your audio input and not related to the behavior of the circuit.

Keep in mind that breadboards have very lousy ground paths. From your PCB diagram, I can't tell how you did your ground plane. Without one, any signals operating at a relatively high frequency (10KHz+) is going to suffer quite a bit of noise and ground loops. Did you fill the unused top side and the bottom side of the board with a ground plane?

We can see on the graph that the signal is perfectly clear and shows as expected, since it's taken on the radio input pin.

wvmarle:
Also wondering where in that pretty blue on grey image you see a "slow rise and fall". Actually, I wonder what that image even tries to show. Based on the general forum topic I guess it's some kind of signal, but what??

It's a binary signal, 0s and 1s. We can see that the start of the signal is lower than normal.

For the PCB: the few designs I've done so far I gave a ground plane on the bottom (largely unused - a few traces that really couldn't be routed on top) and Vcc plane on the top side (where most of the traces are as well) - all also based on SMD components. For through-hole designs maybe do this upside-down, don't know what'd be better.

Currently is through hole, I'll decide later if I want to go SMD

TomGeorge:
Hi,
You need bypass capacitors and place a 10uF capacitor across the power pins of the Tx at the radio pins on the PCB.

Why ? No schematic shows that on every tutorial I saw and it works on the breadboard

Why do you need D1, D2 and D3?

This prevents the signal from B1, for example, to go in B2 trace. Since I need all buttons to go to VCC pin and I also need to check which button is pressed

Have you measured the voltage on pin8 of the Attiny to see what your supply voltage is?

By memory 4.5 (3x new AAA) minus voltage drop by the diodes

You may need to program in a delay between power up and when you send your data.

Works normally on breadboard

When designing a PCB remember, you have bought a completely clad PCB and you are paying someone to remove the cladding, so try and leave as much on your board as possible, cos you own it.

Will do

All your PCB tracks can be a lot wider for a start.

Wanted to go as small as possible because it must fit in there :

Tom.. :slight_smile:

Thanks for your replies.
I am currently moving, all my eletronic stuff is in my new flat. I'll update you when we're done.

Regards

Still no clue on that blue image. You need to do a lot more explanation on what everything is.

For your PCB design: thicker traces don't make it larger. SMD components do help make it (a lot) smaller. You can probably go to 1/4 the PCB area you have now, if not less. The current design can also definitely made more compact - all the while having larger traces.

Hi,

,
You need bypass capacitors and place a 10uF capacitor across the power pins of the Tx at the radio pins on the PCB.

1 Why ? No schematic shows that on every tutorial I saw and it works on the breadboard

Why do you need D1, D2 and D3?

2 This prevents the signal from B1, for example, to go in B2 trace. Since I need all buttons to go to VCC pin and I also need to check which button is pressed

  1. 10uF helps to stabilize the circuit and provide some power reserve when the TX transmits.
    Bypassing with 0.1uF caps is a standard practice, especially with digital circuitry and battery supply, to prevent digital noise moving around the circuit through the power supply tracks.
    Even at this point you can add bypass caps to your PCB. 0.1uF disc ceramics.

  2. How can the B1 signal get to the B2 or B3 traces? They are wired each directly to a separate input pin and supplied from the fixed positive supply

Tom... :slight_smile:

The "slow rising and falling" is purely due to you using a soundcard as an oscilloscope, soundcards
are AC coupled, as pointed out by cmiyc in #2.

You have no decoupling capacitors on the board, I note - perhaps the 433MHz module needs one?
In general a board without decoupling is an immediate red-flag.

In general if you have an issue moving from a breadboard to a PCB then you made a mistake in
the copying - it pays to double-check with electronics since only one mistake can render an entire
circuit inoperative (or cause damage).

"Check twice, buy once"

TomGeorge:
Hi,

  1. 10uF helps to stabilize the circuit and provide some power reserve when the TX transmits.
    Bypassing with 0.1uF caps is a standard practice, especially with digital circuitry and battery supply, to prevent digital noise moving around the circuit through the power supply tracks.
    Even at this point you can add bypass caps to your PCB. 0.1uF disc ceramics.

  2. How can the B1 signal get to the B2 or B3 traces? They are wired each directly to a separate input pin and supplied from the fixed positive supply

Tom... :slight_smile:

They are all connected to VCC pin to supply power initially, then transistors keep the tiny alive while transmitting and self shutdown.

MarkT:
The "slow rising and falling" is purely due to you using a soundcard as an oscilloscope, soundcards
are AC coupled, as pointed out by cmiyc in #2.

You have no decoupling capacitors on the board, I note - perhaps the 433MHz module needs one?
In general a board without decoupling is an immediate red-flag.

In general if you have an issue moving from a breadboard to a PCB then you made a mistake in
the copying - it pays to double-check with electronics since only one mistake can render an entire
circuit inoperative (or cause damage).

"Check twice, buy once"

My sound card used to detect the voltage perfectly, weird...

No decoupling capacitor one the breadboard, and it was working flawlessly.. I can try tho.

I will double check to find an error in the PCB

JeanneD4RK:
They are all connected to VCC pin to supply power initially, then transistors keep the tiny alive while transmitting and self shutdown.

Okay, my edit of your circuit needs to be re-edited.


Tom... :slight_smile:

JeanneD4RK:
No decoupling capacitor one the breadboard, and it was working flawlessly.. I can try tho.

Very often things work just fine without those caps - especially in a quick test. But for long term use they're essential for stability, as you will at times have some stronger EMI (ranging from switching on/off electrical appliances such as heaters and washing machines to nearby thunderstorms) that make your processor hang or do unexpected things.

Placement of such caps is also important. C1 goes directly to the pins of your 433 MHz module. C2 should be placed as close as possible to the Vcc pin of your ATtiny. Each chip gets one such a cap (it's good practice to add multiple filtering caps for chips that have multiple Vcc pins, one for each pin) - even though they're on the same wire, the voltage on either end of the wire is not always the same, especially noise can be very different on two ends of a wire (which is very interesting to see - I've been playing with a cap placing at different places of my breadboard and checking the levels with a scope at different places along the rail - just moving it by 5-10 cm can make a HUGE difference).

The PNP seems to be missing a pullup resistor at its base.
I might be mistaken, but when the NPN is off, the base would float, right?
If so, wouldn't that defeat the purpose?

Also: Why do you go through all the hassle of turning the Tiny85 off and on with the external transistors?

Wouldn't it be much easier to just put it into a deep sleep mode where it would consume less than a µA? The batteries would still last years and your whole circuit would become much simpler and probably even smaller than it already is...
(You'd only need the Tiny85, bypass cap, the three buttons and your RF module.)

BJT transistors don't need a pull-up/pull-down to switch them off, as they're current driven rather than voltage driven. Floating = no current = transistor off.