EmbeddedRelated.com
Forums
Memfault Beyond the Launch

UART connection between ATSAMD20 and ATtiny4313

Started by pozz April 26, 2023
On 07/05/2023 23:27, Rick C wrote:
> On Sunday, May 7, 2023 at 5:17:55&#8239;PM UTC-4, pozz wrote: >> Il 05/05/2023 22:16, Grant Edwards ha scritto: >>> On 2023-05-05, pozz <pozz...@gmail.com> wrote: >>> >>>> The critical installations often have cables that gives mains >>>> power (230Vac) to coils, for example relays or door ring bell. >>> >>> People use 230VAC for _doorbells_?!?! Are they trying to wake the >>> dead? >>> >>> Here in the US doorbells are usually 16VAC, though 24VAC is also >>> used. I've also seen 10VAC and 12VAC mentioned, but I think >>> that's uncommon. >> They are very common here (for example [1]). 230Vac is the common >> mains voltage so the doorbells are connected to mains, through a >> momentary switch out of the door. >> >> [1] >> https://comenzielectrice.ro/pdf/Bticino%20-%20Matix%20Catalog.pdf >> Search for AM5048 > > I don't know about where you live, but doorbells in the US are > powered from low voltage, so they don't require all the safety > precautions. A device on a high voltage circuit has to be mounted on > a box or has to be a box rated for such wiring. A door bell uses > much simpler wiring and needs no special boxes or precautions. I > have seen no small number of doorbell buttons mounted directly in the > door frame, having been drilled out to 1/2 inch for mounting the > button. >
Guessing from the URL, he could be in Romania, or a country near enough to use Romanian webshops. I have no idea about the regulations here in Norway, but I know our doorbell has a transformer in the fuse cupboard, so it does not have high voltage mains out to the bell. Driving mains to the doorbell sounds like a safety nightmare. (Mind you, it's one way to deal with annoying kids that ring the bell and run away...)
On 07/05/2023 23:21, pozz wrote:
> Il 05/05/2023 20:37, Rick C ha scritto: >> On Friday, May 5, 2023 at 12:03:04&#8239;PM UTC-4, pozz wrote: >>> Il 05/05/2023 12:59, David Brown ha scritto: >>> [...] >>>>> The critical installations often have cables that gives mains power >>>>> (230Vac) to coils, for example relays or door ring bell. >>>> >>>> The current used for door bells - even modern monstrosities with >>>> cameras >>>> - is tiny. >>> In my installations they don't use that kind of door bells that are >>> digital circuits with digital audio output. I don't know what's their >>> exact name, similar to high power buzzers. >>>> I really think something must be wrong with the card if it >>>> is susceptible to interference from such cables.&nbsp; Oscillators - crystal >>>> or ceramic - usually need load capacitors and a damping resistor. >>>> These >>>> are small loads (perhaps 15-20 pF and 10 M&Omega;), and are sometimes built >>>> into the microcontroller.&nbsp; But if these are missing, your oscillator >>>> could be unstable and easily affected by outside influence. >> >> You are talking about exactly like a buzzer, but with a clapper for >> the bell.&nbsp; A mechanical switch interrupts the current to the coil and >> very likely arcs on opening and closing, generating significant EMI. >> Perhaps you could convince them to add a capacitor like they used in >> automotive spark systems?&nbsp; The spark should be in the right place. >> > > Ok, thanks for suggestion.
Another thing to check is exactly where the noise gets into your system. Maybe it is actually coming in through wires (such as power supply wires) connected to your box, rather than directly from the bell wire to the PCB traces. Do you have any connecting wires that might be run parallel to the bell wire, acting as antenna? If so, try a capacitor on those lines as a simple EMC filter.
Il 08/05/2023 08:37, David Brown ha scritto:
> On 07/05/2023 23:21, pozz wrote: >> Il 05/05/2023 20:37, Rick C ha scritto: >>> On Friday, May 5, 2023 at 12:03:04&#8239;PM UTC-4, pozz wrote: >>>> Il 05/05/2023 12:59, David Brown ha scritto: >>>> [...] >>>>>> The critical installations often have cables that gives mains power >>>>>> (230Vac) to coils, for example relays or door ring bell. >>>>> >>>>> The current used for door bells - even modern monstrosities with >>>>> cameras >>>>> - is tiny. >>>> In my installations they don't use that kind of door bells that are >>>> digital circuits with digital audio output. I don't know what's their >>>> exact name, similar to high power buzzers. >>>>> I really think something must be wrong with the card if it >>>>> is susceptible to interference from such cables.&nbsp; Oscillators - >>>>> crystal >>>>> or ceramic - usually need load capacitors and a damping resistor. >>>>> These >>>>> are small loads (perhaps 15-20 pF and 10 M&Omega;), and are sometimes built >>>>> into the microcontroller.&nbsp; But if these are missing, your oscillator >>>>> could be unstable and easily affected by outside influence. >>> >>> You are talking about exactly like a buzzer, but with a clapper for >>> the bell.&nbsp; A mechanical switch interrupts the current to the coil and >>> very likely arcs on opening and closing, generating significant EMI. >>> Perhaps you could convince them to add a capacitor like they used in >>> automotive spark systems?&nbsp; The spark should be in the right place. >>> >> >> Ok, thanks for suggestion. > > Another thing to check is exactly where the noise gets into your system. > &nbsp;Maybe it is actually coming in through wires (such as power supply > wires) connected to your box, rather than directly from the bell wire to > the PCB traces.&nbsp; Do you have any connecting wires that might be run > parallel to the bell wire, acting as antenna?&nbsp; If so, try a capacitor on > those lines as a simple EMC filter.
My board is not so sensitive. You need to put the cables near my plastic enclosure, exactly over the resonator. If you route the cables far from the resonator/oscillator pins, the problem disappears, even if I tie all the cables together (ring cables and 12Vdc power supply cables of my board).
Il 07/05/2023 23:27, Rick C ha scritto:
> On Sunday, May 7, 2023 at 5:17:55&#8239;PM UTC-4, pozz wrote: >> Il 05/05/2023 22:16, Grant Edwards ha scritto: >>> On 2023-05-05, pozz <pozz...@gmail.com> wrote: >>> >>>> The critical installations often have cables that gives mains power >>>> (230Vac) to coils, for example relays or door ring bell. >>> >>> People use 230VAC for _doorbells_?!?! Are they trying to wake the dead? >>> >>> Here in the US doorbells are usually 16VAC, though 24VAC is also used. >>> I've also seen 10VAC and 12VAC mentioned, but I think that's uncommon. >> They are very common here (for example [1]). 230Vac is the common mains >> voltage so the doorbells are connected to mains, through a momentary >> switch out of the door. >> >> [1] https://comenzielectrice.ro/pdf/Bticino%20-%20Matix%20Catalog.pdf >> Search for AM5048 > > I don't know about where you live, but doorbells in the US are powered from low voltage, so they don't require all the safety precautions.
So you have a dedicated power supply for doorbells? Here 99% of house doorbells are 230Vac. The installation is much more easy, because you use directly the mains cables without additional hw. The pushbutton that activates the doorbells are a normal button (but momentary) that could be used to activate lights in the room.
> A device on a high voltage circuit has to be mounted on a box or has to be a box rated for such wiring. A door bell uses much simpler wiring and needs no special boxes or precautions. I have seen no small number of doorbell buttons mounted directly in the door frame, having been drilled out to 1/2 inch for mounting the button. >
In the past, the doorbells were dedicated box mounted on the wall, near the door, inside the apartment. Now they tend to install as a module inside push-button frames that are "inside" the wall ([1] just as an example). Anyway my board is not near the buzzer, but could be near the pushbutton that activates the buzzer. [1] https://www.rmelectric.it/3054-large_default/ronzatore-vimar-plana-230v-bianco-suoneria-campanello-segnalatore-acustico-14378.jpg
On 5/8/2023 9:34, David Brown wrote:
> On 07/05/2023 23:27, Rick C wrote: >> On Sunday, May 7, 2023 at 5:17:55&#8239;PM UTC-4, pozz wrote: >>> Il 05/05/2023 22:16, Grant Edwards ha scritto: >>>> On 2023-05-05, pozz <pozz...@gmail.com> wrote: >>>> >>>>> The critical installations often have cables that gives mains >>>>> power (230Vac) to coils, for example relays or door ring bell. >>>> >>>> People use 230VAC for _doorbells_?!?! Are they trying to wake the >>>> dead? >>>> >>>> Here in the US doorbells are usually 16VAC, though 24VAC is also >>>> used. I've also seen 10VAC and 12VAC mentioned, but I think >>>> that's uncommon. >>> They are very common here (for example [1]). 230Vac is the common >>> mains voltage so the doorbells are connected to mains, through a >>> momentary switch out of the door. >>> >>> [1] >>> https://comenzielectrice.ro/pdf/Bticino%20-%20Matix%20Catalog.pdf >>> Search for AM5048 >> >> I don't know about where you live, but doorbells in the US are >> powered from low voltage, so they don't require all the safety >> precautions.&nbsp; A device on a high voltage circuit has to be mounted on >> a box or has to be a box rated for such wiring.&nbsp; A door bell uses >> much simpler wiring and needs no special boxes or precautions.&nbsp; I >> have seen no small number of doorbell buttons mounted directly in the >> door frame, having been drilled out to 1/2 inch for mounting the >> button. >> > > Guessing from the URL, he could be in Romania, or a country near enough > to use Romanian webshops. > > I have no idea about the regulations here in Norway, but I know our > doorbell has a transformer in the fuse cupboard, so it does not have > high voltage mains out to the bell.&nbsp; Driving mains to the doorbell > sounds like a safety nightmare.&nbsp; (Mind you, it's one way to deal with > annoying kids that ring the bell and run away...)
Similar here (Bulgaria). When I was a kid starting to try to put together this or that a "doorbell transformer" was a popular option to make some sort of power supply. I think they had a few outputs at the secondary, starting at 6V or something. But even so if the buzzer has nasty solenoids and switches it can cause plenty of interference, who knows.
On 2023-05-08, pozz <pozzugno@gmail.com> wrote:
> Il 07/05/2023 23:27, Rick C ha scritto: > >> I don't know about where you live, but doorbells in the US are >> powered from low voltage, so they don't require all the safety >> precautions. > > So you have a dedicated power supply for doorbells?
Yes. A small transformer that costs a couple dollars. It allows use of far cheaper wiring and switches than would be required for 120V and avoids requirements for approved junction boxes, etc.
On Monday, May 8, 2023 at 3:38:15&#8239;AM UTC-4, pozz wrote:
> Il 07/05/2023 23:27, Rick C ha scritto: > > On Sunday, May 7, 2023 at 5:17:55&#8239;PM UTC-4, pozz wrote: > >> Il 05/05/2023 22:16, Grant Edwards ha scritto: > >>> On 2023-05-05, pozz <pozz...@gmail.com> wrote: > >>> > >>>> The critical installations often have cables that gives mains power > >>>> (230Vac) to coils, for example relays or door ring bell. > >>> > >>> People use 230VAC for _doorbells_?!?! Are they trying to wake the dead? > >>> > >>> Here in the US doorbells are usually 16VAC, though 24VAC is also used. > >>> I've also seen 10VAC and 12VAC mentioned, but I think that's uncommon. > >> They are very common here (for example [1]). 230Vac is the common mains > >> voltage so the doorbells are connected to mains, through a momentary > >> switch out of the door. > >> > >> [1] https://comenzielectrice.ro/pdf/Bticino%20-%20Matix%20Catalog.pdf > >> Search for AM5048 > > > > I don't know about where you live, but doorbells in the US are powered from low voltage, so they don't require all the safety precautions. > So you have a dedicated power supply for doorbells?
LOL, when you say "dedicated power supply", you mean this. https://www.amazon.com/HQRP-Transformer-Compatible-8v-16v-24v-Replacement/dp/B094DKV9NQ The high voltage side of the transformer is mounted on a proper high voltage box. The rest of the wiring is low voltage, so requires no particular safety precautions. The power is low, so even at the low voltage the wire is not heavy, typically 20 or 22 gauge.
> Here 99% of house > doorbells are 230Vac. The installation is much more easy, because you > use directly the mains cables without additional hw.
Doesn't the button require a much more substantial mounting, as well as the bell itself? That's what the low voltage is avoiding. I think my transformer is mounted in the pantry ceiling not unlike a lightbulb (which is also in the pantry ceiling).
> The pushbutton that activates the doorbells are a normal button (but > momentary) that could be used to activate lights in the room.
I don't know what that means "normal". Here, all wiring junctions or terminations must be done in an approved box. https://www.youtube.com/watch?v=6GUODvOVz10 The wire junctions shown here are valid, but not common in the US. Mostly people are used to "wire nuts", which are like this, and work well. https://www.cableorganizer.com/categories/electrical-supplies/cable-termination/tan-wire-connector/ The mistake that is often made when using them, is to not twist the wires together before twisting the nut on. The nut is not intended to be a mechanical connection, just electrical. So the insulated portion of the wire should be twisted together first.
> > A device on a high voltage circuit has to be mounted on a box or has to be a box rated for such wiring. A door bell uses much simpler wiring and needs no special boxes or precautions. I have seen no small number of doorbell buttons mounted directly in the door frame, having been drilled out to 1/2 inch for mounting the button. > > > In the past, the doorbells were dedicated box mounted on the wall, near > the door, inside the apartment. > > Now they tend to install as a module inside push-button frames that are > "inside" the wall ([1] just as an example). > > Anyway my board is not near the buzzer, but could be near the pushbutton > that activates the buzzer. > > [1] > https://www.rmelectric.it/3054-large_default/ronzatore-vimar-plana-230v-bianco-suoneria-campanello-segnalatore-acustico-14378.jpg
The bell itself is not an issue. The PITA is the button. https://www.amazon.com/doorbell-push-button/s?k=doorbell+push+button These are much easier to mount where they are most convenient. See the small button with the screw terminals? Below is a crude video of a similar button showing the minimal requirements for installation. This guy is upgrading to a video doorbell. https://www.google.com/search?q=round+doorbell+button+mounting&client=firefox-b-1-d&sxsrf=APwXEdfIYgYKthf4KothWTYEIfsvEMSPHg:1683555901893&source=lnms&tbm=vid&sa=X&ved=2ahUKEwj2l_e79uX-AhXaMVkFHVUuBuUQ0pQJegQIMBAG&biw=923&bih=497&dpr=1.94#fpstate=ive&vld=cid:1132e9ee,vid:N0H1jSUySH0 Much simpler and less expensive than running high voltage wiring to the button. I'm wondering if your doorbell has the low voltage transformer inside and the wire to your doorbell is also low voltage? It just makes zero sense to run high voltage to the button. -- Rick C. --++ Get 1,000 miles of free Supercharging --++ Tesla referral code - https://ts.la/richard11209
Il 08/05/2023 16:12, Grant Edwards ha scritto:
> On 2023-05-08, pozz <pozzugno@gmail.com> wrote: >> Il 07/05/2023 23:27, Rick C ha scritto: >> >>> I don't know about where you live, but doorbells in the US are >>> powered from low voltage, so they don't require all the safety >>> precautions. >> >> So you have a dedicated power supply for doorbells? > > Yes. A small transformer that costs a couple dollars. It allows use of > far cheaper wiring and switches than would be required for 120V and > avoids requirements for approved junction boxes, etc.
I understand a small transformer is cheap, but anyway it's cheaper and simpler not having it at all. Here cables for doorbells are routed together with other cables, for example for lightning, so they uses the same junction boxes. Moreover the push-button for the doorbell is identical to the one used to switch on a lamp. It's not uncommon to have a 230Vac frame with push-button for doorbell, push-button to activate outdoor lamps and a RFID reader to disable the anti-burglar system. All these three elements in a frame like this. [1] https://i.ebayimg.com/images/g/1q0AAOSw7Wtd4lsd/s-l1600.png
Il 08/05/2023 16:32, Rick C ha scritto:
> On Monday, May 8, 2023 at 3:38:15&#8239;AM UTC-4, pozz wrote: >> Il 07/05/2023 23:27, Rick C ha scritto: >>> On Sunday, May 7, 2023 at 5:17:55&#8239;PM UTC-4, pozz wrote: >>>> Il 05/05/2023 22:16, Grant Edwards ha scritto: >>>>> On 2023-05-05, pozz <pozz...@gmail.com> wrote: >>>>> >>>>>> The critical installations often have cables that gives mains power >>>>>> (230Vac) to coils, for example relays or door ring bell. >>>>> >>>>> People use 230VAC for _doorbells_?!?! Are they trying to wake the dead? >>>>> >>>>> Here in the US doorbells are usually 16VAC, though 24VAC is also used. >>>>> I've also seen 10VAC and 12VAC mentioned, but I think that's uncommon. >>>> They are very common here (for example [1]). 230Vac is the common mains >>>> voltage so the doorbells are connected to mains, through a momentary >>>> switch out of the door. >>>> >>>> [1] https://comenzielectrice.ro/pdf/Bticino%20-%20Matix%20Catalog.pdf >>>> Search for AM5048 >>> >>> I don't know about where you live, but doorbells in the US are powered from low voltage, so they don't require all the safety precautions. >> So you have a dedicated power supply for doorbells? > > LOL, when you say "dedicated power supply", you mean this. > > https://www.amazon.com/HQRP-Transformer-Compatible-8v-16v-24v-Replacement/dp/B094DKV9NQ
The price on this link is 23 euros, I think a 230Vac doorbell costs less.
> The high voltage side of the transformer is mounted on a proper high voltage box. The rest of the wiring is low voltage, so requires no particular safety precautions. The power is low, so even at the low voltage the wire is not heavy, typically 20 or 22 gauge.
Here they usually route the doorbell 230Vac cables together with other cable of electrical system (lightning...) using the same junction boxes.
>> Here 99% of house >> doorbells are 230Vac. The installation is much more easy, because you >> use directly the mains cables without additional hw. > > Doesn't the button require a much more substantial mounting, as well as the bell itself? That's what the low voltage is avoiding. I think my transformer is mounted in the pantry ceiling not unlike a lightbulb (which is also in the pantry ceiling).
See [1]. That is a 3-modules frame that can be installed in the wall. It's already compatible with 230Vac push-buttons. With one of this you can have the push-button for an outdoor lamp, a push-button for the doorbell and a keytag reader for anti-burglar system (for example). You don't need an additional substantial mounting dedicated for doorbell pushbutton.
>> The pushbutton that activates the doorbells are a normal button (but >> momentary) that could be used to activate lights in the room. > > I don't know what that means "normal". Here, all wiring junctions or terminations must be done in an approved box.
Yes, of course. The same box used for a switch that turns on a light. There's no need to add a dedicated box for doorbell.
> https://www.youtube.com/watch?v=6GUODvOVz10 > > The wire junctions shown here are valid, but not common in the US. Mostly people are used to "wire nuts", which are like this, and work well. > > https://www.cableorganizer.com/categories/electrical-supplies/cable-termination/tan-wire-connector/ > > The mistake that is often made when using them, is to not twist the wires together before twisting the nut on. The nut is not intended to be a mechanical connection, just electrical. So the insulated portion of the wire should be twisted together first. > > >>> A device on a high voltage circuit has to be mounted on a box or has to be a box rated for such wiring. A door bell uses much simpler wiring and needs no special boxes or precautions. I have seen no small number of doorbell buttons mounted directly in the door frame, having been drilled out to 1/2 inch for mounting the button. >>> >> In the past, the doorbells were dedicated box mounted on the wall, near >> the door, inside the apartment. >> >> Now they tend to install as a module inside push-button frames that are >> "inside" the wall ([1] just as an example). >> >> Anyway my board is not near the buzzer, but could be near the pushbutton >> that activates the buzzer. >> >> [1] >> https://www.rmelectric.it/3054-large_default/ronzatore-vimar-plana-230v-bianco-suoneria-campanello-segnalatore-acustico-14378.jpg > > The bell itself is not an issue. The PITA is the button. > > https://www.amazon.com/doorbell-push-button/s?k=doorbell+push+button > > These are much easier to mount where they are most convenient. See the small button with the screw terminals? Below is a crude video of a similar button showing the minimal requirements for installation. This guy is upgrading to a video doorbell. > > https://www.google.com/search?q=round+doorbell+button+mounting&client=firefox-b-1-d&sxsrf=APwXEdfIYgYKthf4KothWTYEIfsvEMSPHg:1683555901893&source=lnms&tbm=vid&sa=X&ved=2ahUKEwj2l_e79uX-AhXaMVkFHVUuBuUQ0pQJegQIMBAG&biw=923&bih=497&dpr=1.94#fpstate=ive&vld=cid:1132e9ee,vid:N0H1jSUySH0 > > Much simpler and less expensive than running high voltage wiring to the button.
If you have only a doorbell pushbutton outdoor, yes it could be simpler. However here usually installs a "normal" in-the-wall 3-modules box, so you can have multiples commodities: doorbell push-button, button for a light and so on. This box is already compatible for 230Vac signals.
> I'm wondering if your doorbell has the low voltage transformer inside and the wire to your doorbell is also low voltage? It just makes zero sense to run high voltage to the button. >
[1] https://i.ebayimg.com/images/g/1q0AAOSw7Wtd4lsd/s-l1600.png
On Monday, May 8, 2023 at 12:15:19&#8239;PM UTC-4, pozz wrote:
> Il 08/05/2023 16:12, Grant Edwards ha scritto: > > On 2023-05-08, pozz <pozz...@gmail.com> wrote: > >> Il 07/05/2023 23:27, Rick C ha scritto: > >> > >>> I don't know about where you live, but doorbells in the US are > >>> powered from low voltage, so they don't require all the safety > >>> precautions. > >> > >> So you have a dedicated power supply for doorbells? > > > > Yes. A small transformer that costs a couple dollars. It allows use of > > far cheaper wiring and switches than would be required for 120V and > > avoids requirements for approved junction boxes, etc. > I understand a small transformer is cheap, but anyway it's cheaper and > simpler not having it at all.
LOL You don't seem to understand. You either have the transformer as a separate entity, or its functionality is incorporated in something more expensive, because it is rated for 240V.
> Here cables for doorbells are routed together with other cables, for > example for lightning, so they uses the same junction boxes.
I think you mean "lighting". But you can't lump the doorbell with anything else. At least not in existing construction. It is all irrelevant. Do what you wish. Spend the money on 240V wiring at a dollar a foot and high voltage boxes. That's your choice. But the fact is, the low voltage doorbell is much cheaper to install.
> Moreover the push-button for the doorbell is identical to the one used > to switch on a lamp. It's not uncommon to have a 230Vac frame with > push-button for doorbell, push-button to activate outdoor lamps and a > RFID reader to disable the anti-burglar system. All these three elements > in a frame like this.
You put your outside lights on an outside switch? Doesn't happen here, at least not at the front door.
> [1] https://i.ebayimg.com/images/g/1q0AAOSw7Wtd4lsd/s-l1600.png
Your photo looks like an indoor switch. Outdoor switches are typically much more robust and sealed from the elements. Which one is the doorbell switch? Or is all this inside the front door and a visitor opens the door to ring the bell? -- Rick C. -+-- Get 1,000 miles of free Supercharging -+-- Tesla referral code - https://ts.la/richard11209

Memfault Beyond the Launch