Review my circuit - Page 1
Forum section: electronics / beginners

author: redgear
author_rank: Frequent Contributor
timestamp: August 11, 2020, 04:55:05 am
content: I have designed a simple circuit to control a electronic ballast using relays and mcus. Can someone please review it?Questions that I have:1) Does the output from powersupply need caps?2) Is the 5v to 3.3v conversion done properly?Please feel free to point out any other mistakes or give suggestions.Thank You

author: ledtester
author_rank: Super Contributor
timestamp: August 11, 2020, 03:46:19 pm
content: Quote from: redgear on August 11, 2020, 04:55:05 amYou should use a voltage regulator to get the 3.3V rail. Is the voltage divider working for you?

author: ledtester
author_rank: Super Contributor
timestamp: August 12, 2020, 12:35:15 am
content: Some more comments:- Please post the actual PDF file - the text is very small and hard to read. In particular, I can't read the part number for the power supply. Also number your components so it's easy to refer to specific components -- e.g. R5, or C6.- All of the chips can run at 3.3V so that is another option.- Consider using an unused gate of the ULN2003 to control the buzzer - eliminates the need for the transistor.- VSS on the touch sensor chip should be connected to ground.- MT01 is a digital output and shouldn't be connected to ground.- You need to indicate which output pins on the MTCH1 chip are connected to which GPIO pins on the Atmega. Since they are running at different voltages you'll need some sort of level conversion.- What's the point of the SW_Push switches? To hook up switches to a microcontroller, the GPIO pin should be either 1) pulled up to Vdd and the switch connects the GPIO to ground or 2) pulled down to ground and the switch connects the GPIO to Vdd.https://www.brainy-bits.com/arduino-input-pullup-tutorial/

author: newbrain
author_rank: Super Contributor
timestamp: August 12, 2020, 08:08:50 am
content: First thing that jumps out are the connections to the touch controller, they seem to be shifted or in some way messed up.The push button use is also probably wrong, as ledtester says.The multiplexed display could also be directly controlled by the MCU, using the available ULN2003 drivers for common cathodes and a free port for segments (depends on current requirements).

author: redgear
author_rank: Frequent Contributor
timestamp: August 12, 2020, 09:16:33 am
content: Quote from: ledtester on August 12, 2020, 12:35:15 amSorry, Im including the pdf with this reply.Quote- Won't the micro run at lower clock speeds on 3.3v? I would anyway need 5v for relays. So, I'm adding a LDO.- Made the change.- Just checked, I must have flipped the symbol without knowing. Changed it.- Same as above.- Made the change.- That was stupid. I corrected it.Thank You! Please review the updated schematic.Quote from: newbrain on August 12, 2020, 08:08:50 amYep, It must have got flipped by mistake.Corrected the push button.There is a arduino library for the TM1637, so gonna stick with it.Thank you

author: ledtester
author_rank: Super Contributor
timestamp: August 12, 2020, 11:04:18 am
content: QuoteThis is the first time I've ever looked at the datasheet for the atmega1608, so bear with me.From the datasheet I see that at 3.3V you can run the atmega1608 at least at 8 MHz and possible 10 depending on which speed grade chip you have.The internal RC oscillator is either 16 or 20 MHz and you can set the Main Clock Prescaler to 2 to get 8 or 10 MHz which is plenty fast.To convert the 3.3V outputs of the touch sensor to 5V you can use the unused ULN2003 gates... just enable the internal pullups on the atmega1608 side.QuoteYou didn't post the schematic.

author: redgear
author_rank: Frequent Contributor
timestamp: August 12, 2020, 02:43:59 pm
content: Quote from: ledtester on August 12, 2020, 11:04:18 amThanks. I'm also considering the CAP1206 which runs on 5v.Oops. Sorry. I'm attaching it with this post.

author: ledtester
author_rank: Super Contributor
timestamp: August 13, 2020, 01:33:53 am
content: The TTP223 modules has gotten a lot of attention recently in the hobbyist world, i.e.:https://youtu.be/XBHgJi6smls

author: Mr. Scram
author_rank: Super Contributor
timestamp: August 13, 2020, 01:39:43 am
content: Do you really need to break up the schematic like that? Might it fit in one single schematic? You may want to look at older schematics and how clear those can be.

author: ledtester
author_rank: Super Contributor
timestamp: August 13, 2020, 02:40:44 am
content: Some thoughts...- Not sure about putting the power switch on the low voltage side even if the power module only consumes 0.1W with no load. I think it would be nice to be able to kill the power to everything if like the relay failed.-You'll want some filtering capacitors on the output side of the IRM-10-5. I'm not an expert on such things, but from other schematics I've sen probably 0.1uF, 1uF and a 10uF in parallel would be a good idea.- Here's how to perform level translation using the ULN2003...MTOx represents an output pin of the touch sensor chip. MTOx_IN is the atmega1608 GPIO pin that will read that output. Q1 is one of the gates on the ULN2003. The pull-up resistor can be the GPIO pin's internal pull-up (so it doesn't have to exist on the PCB). This method might consume 1 mA (maybe less) while the output signal is high which is most of the time, so it isn't economical on power, but then you're not running on batteries so that's not too much of an issue.It would make things a lot simpler to find a touch sensor which runs at 5V.- You have to push both SW1 and SW2 in order to change the SWOUT line -- is that what you intended?- Are the LEDs connected to the ULN2003 just simple LEDs or something else? The atmega1608 can drive modern LEDs directly -- you get good brightness with just a few mA of current. Usually the ULN2003 is used to drive heavier loads.

author: redgear
author_rank: Frequent Contributor
timestamp: August 13, 2020, 06:24:25 am
content: Quote from: Mr. Scram on August 13, 2020, 01:39:43 amI split up because I felt it was easier to read that way.Quote from: ledtester on August 13, 2020, 02:40:44 amThanks.- Do suggest putting the switch, as the first thing after the fuse where the mains enter? I am also confused about the selecting the right fuse. The microcontroller and other electronics together consume 500mA at max, the load consumes 1.5A but the inrush current can be as high as 28A. For the micro and I guess a 1A or 1.5A fuse should be enough. What should be the fuse size for the load and the mains fuse is load fuse+electronic fuse?- I asked here in the forum many times but I did not get a reply. I will add them.- Thank you. But like you said I planning to use CAP1206 which works with 5v.- Yes, that's right. Both should be pushed.- Yes, they are simple LEDsI will post the updated schematic once I make the changes.

author: ledtester
author_rank: Super Contributor
timestamp: August 14, 2020, 12:43:44 am
content: From this page:https://www.instructables.com/id/Wire-Up-a-Fused-AC-Male-Power-Socket/it seems that the fuse it wired up before the power switch.However, how about simplifying things and have your low voltage circuitry powered from a USB adaptor or even batteries? The Meanwell power module is quite expensive -- it likely costs as much as all of the other components put together.You can also have a look at how other products power low-voltage chips from mains, e.g.:https://www.ebay.com/itm/AC220V-Delay-Timer-Switch-Turn-Off-Board-0-Second-99-Minute-Delay-Relay-Module/133285184485?hash=item1f086a83e5%3Ag%3ArHIAAOSwdOxeBF99&LH_BIN=1No detailed schematic, but it's clear they have a rectifier bridge, what looks like a zener and a voltage regulator. Might be worth buying one to reverse engineer it.

author: redgear
author_rank: Frequent Contributor
timestamp: August 19, 2020, 03:36:21 am
content: Quote from: ledtester on August 14, 2020, 12:43:44 amSorry, I was away for the week.Yes, I now have the switch on the supply input side after the fuse. And for sizing the fuses, I read up on some technical notes and I need to calculate values using the steps specified.My first design used a simple transformer but the total cost of the components (Transformers, Linear Regs, caps) were almost same as the power supply I have chosen so I went ahead with it.