3

Pulldown at Q1 addedNew Modified CircuitOld SketchI am developing a circuit with atmega328, the MCU is powered by a LM7805. The input of 7805 is given by a variable supply. Till the input of 7805 is 7volts, the output voltage is 4.9volts and current is around .75amps. Now if the input voltage of 7805 is increased, the current also increases and the MCU stops working(sometimes work with being reset after a few seconds), please help me out guys... i need to connect those circuits to my car battery, so it must work with 12volts.

I added capacitors and diodes as per Majenko mentioned. Now the situation is a) The circuit is working at 12V, b) With single C817 , output voltage of mcu is 3.5V, c)I used 56 ohms resistance, which is giving 1.2V to the input of C817, d) The Collector to Emitter resistance of C817 is 1520 ohms when turned on, this is creating a voltage drop of 3volts. e) This output is turning the led on, but being unable to switch the relay.

Circuit Upate

This the modified circuit, which solves the problem. But i have some questions, in the modified circuit if BC547 is used then its not working because the collector voltage which should be around 0.2 remains 1.8 volts, but replacing the BC547 with BC337 solves the problem(Collector voltage becomes around 0.3). The Modified Circuit

  • Have you added capacitors ? Reset problems may be attributed to inadequate current supply. Refer : http://www.circuitdiagram.org/images/12-to-5v-converter-circuit.gif – Salim Shamim Mar 21 '17 at 07:21
  • 1
    Maybe thermal protection? Voltage drop on the regulator is 2 volts if you have 7V input and that means `2V * 0.75A = 1.5W` turned into the heat. That means heatsink might be needed to work properly. – KIIV Mar 21 '17 at 07:57
  • i have uploaded the circuit diagram, please take a look, and i will try all the hints mentioned above.. – SHILADITYA DEY Mar 21 '17 at 08:32
  • Do you have a phobia of capacitors? I can see at least 8 that are conspicuous by their absence - maybe more. You seem to have an aversion to diodes as well. – Majenko Mar 21 '17 at 10:11
  • yeah, its embarrassing , i didnt think that capacitors will be that much important. Anyways i am gonna try it again after attaching the capacitors and diodes. – SHILADITYA DEY Mar 21 '17 at 11:19
  • If you are simulating (vs. real parts on a breadboard or PCB), how a BC547 works vs a BC337 probably depends on what part suffixes you specify: BC547A, B, or C vs BC337-16, -25, or -40. BC547C have higher gain at 100 mA collector current than BC337-16 and -25, but lower than BC337-40. With real parts, it depends on which you buy and use. – James Waldby - jwpat7 Mar 23 '17 at 06:14
  • okk, got you , but my new schematic is consuming all total of 840ma (with two output & relays) when they are turned on. Now if i use all six of them it will consume more than 1amps, any ways to reduce them??? may be increasing the resistances or something?? – SHILADITYA DEY Mar 23 '17 at 06:21

2 Answers2

1

It looks like the reason for the MCU drawing high current is operating the LEDs in half a dozen optical isolators without current-limiting resistors. The part number of your isolators apparently is PC817, for which the suggested LED current is 5 to 20 mA at about 1.2 to 1.4 forward volts. But if you don't limit the current, they are likely to draw 50 to 100 mA each when turned on. Add a series resistor, say 220 to 330 Ω, in series with each isolator.

At this point, it's possible you may have damaged your ATmega328 by overheating it, due to drawing too much current from its outputs. You probably should run some tests with simple sketches to see if they all work ok.

Note, it probably would make sense to use a buck regulator rather than a linear regulator in the 12 V environment. MP1584-based buck regulator boards (“Mini DC 4.5~28V to DC 3.3V MP1584 3A Step-down Converter Regulator Module”), about 2x2 cm, are about a dollar on ebay and handle 2 amps typically.

James Waldby - jwpat7
  • 8,800
  • 3
  • 16
  • 32
  • thaks for your reply, i tried using 220E resistors, but its not working, 56E seems to work fine in the sketches. Also i connected 100E at the sketch, output LED, is glowing , but dimmed, what should i do? – SHILADITYA DEY Mar 21 '17 at 10:03
  • @SHILADITYADEY, do you have an oscilloscope? If so, check if regulator oscillation (as mentioned by Majenko) is an issue. And/or, use a DVM to check output voltages on several IO pins, on load and off. Also detach an isolator from its IO line, and drive the isolator with different voltages to test if the isolators+relays work by themselves. Also detach 4 isolators+relays from the circuit and see if you have enough current to drive the remaining 2 (to check if problem is just too much load, or some wiring error, or a design problem). – James Waldby - jwpat7 Mar 21 '17 at 15:13
  • Also, a 'glowing , but dimmed' LED either is at low current or is turning on/off rapidly. Easy to check with a scope, not so easy with a DVM; possibly detectable by sweeping it across your field of vision. Low current may be a result of high resistance (eg damaged IO lines) or low voltage. Low voltage can be caused by shorts or low-resistance loads, or by power-supply oscillation. – James Waldby - jwpat7 Mar 21 '17 at 15:24
  • gonna do it today and let you know – SHILADITYA DEY Mar 22 '17 at 12:44
  • found out it was problem with the excessive current 817Cs are taking from controller. New modified circuit solved it. Thanku for the help. – SHILADITYA DEY Mar 23 '17 at 05:52
1

There are a number of basic but vitally important components missing from your schematic. Namely input and output capacitors on the voltage regulators, which would result in oscillation and thus overheating (which would then shut them down through thermal overload), decoupling capacitors on the main chip, reverse biased diodes across the relay coils (maybe as well a small capacitor would be beneficial in parallel), and resistors to limit the current through your opto isolators.

Here is a version of your schematic with the missing components added in red. I have omitted the values - your job is to read the datasheets and work out the correct values to use.

enter image description here

Majenko
  • 103,876
  • 5
  • 75
  • 133
  • Thanks @Majenko for your help, I am gonna try it and give you feedback.. thanks again. – SHILADITYA DEY Mar 21 '17 at 11:20
  • I added capacitors and diodes as per Majenko mentioned. Now the situation is a) The circuit is working at 12V, b) With single C817 , output voltage of mcu is 3.5V, c)I used 56 ohms resistance, which is giving 1.2V to the input of C817, d) The Collector to Emitter resistance of C817 is 1520 ohms when turned on, this is creating a voltage drop of 3volts. e) This output is turning the led on, but being unable to switch the relay. – SHILADITYA DEY Mar 22 '17 at 05:48
  • @SHILADITYADEY Have you got your diodes the right way round? – Majenko Mar 22 '17 at 07:49
  • yes i have, and i have changed the circuit. There is some issue with the modified circuit tough, please check it – SHILADITYA DEY Mar 22 '17 at 10:10
  • @SHILADITYADEY Are you relying solely on simulations for this, or do you have an actual real physical circuit? – Majenko Mar 22 '17 at 10:11
  • @SHILADITYADEY Re your new circuit: you should have a pull-down resistor on the base of Q1. – Majenko Mar 22 '17 at 10:12
  • I have not implemented the new circuit physically yet, what should i do? Should I use pull down? – SHILADITYA DEY Mar 22 '17 at 10:17
  • @SHILADITYADEY I'd get breadboarding. Simulations are all very well, but you may find that in real life with real components it behaves very differently. – Majenko Mar 22 '17 at 10:18
  • So i am going to make it with pull down at base, sounds ok? – SHILADITYA DEY Mar 22 '17 at 10:21
  • @SHILADITYADEY Without that pull down, when the opto turns off the base is left floating. 10K should be a reasonable value. – Majenko Mar 22 '17 at 10:21
  • Pulldown is not doing any change in simulation, but BC337 solving it – SHILADITYA DEY Mar 22 '17 at 10:27
  • That's because your simulation isn't real. It's lacking the noise the base would pick up from the environment while floating. You need the pulldown even if your simulation says it works. Personally I prefer an n-channel MOSFET instead of a BJT. – Majenko Mar 22 '17 at 10:29
  • ok, but adding pulldown is not reducing the collector voltage, it still is at 1.8 volts – SHILADITYA DEY Mar 22 '17 at 10:31
  • Try it in real life. I never trust simulations to get it right. – Majenko Mar 22 '17 at 10:51
  • okk, I am gonna try it tonight and let you know – SHILADITYA DEY Mar 22 '17 at 10:53
  • Hello @Majenko, I made the new schematic i had uploaded yesterday, and its working fine, right now i did it for only two outputs, gonna do it for all six of them today, also added the pulldown. Thanks for your help. Really appreciate it. – SHILADITYA DEY Mar 23 '17 at 05:50