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 : circuitdiagram.org/images/12-to-5v-converter-circuit.gif – Salim Shamim Mar 21 '17 at 7: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 7: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 8: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
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.

  • 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 5: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

  • 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 5:48
  • @SHILADITYADEY Have you got your diodes the right way round? – Majenko Mar 22 '17 at 7: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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.