Attiny2313 with MOSFET PWM Controller 18V and 9V configuration

Discussion in 'Embedded Systems and Microcontrollers' started by AgentSmithers, Sep 12, 2016.

  1. AgentSmithers

    Thread Starter Well-Known Member

    Jan 14, 2011
    Hi Everyone. I built an ATTiny2313 that sends out a PWM signle to a MOSFET motor controller to control the speed of a motor.
    The Power source for the Motor is running from a 18V (12v and 6v) source (Batteries in series)
    The controller can be found above.

    I then use a whole different power source to power my Microcontroller that is running the Attiny2313 (9V D Battery). I then have a switch that is hooked up to the 12v source that runs through a voltage regulator and then runs to a Pin on the Microcontroller as the Gas Pedal, eventually I want everything on the two batteries in series but for now I have the controller on a separate 9V.
    My main concern is that I am taking a 12V voltage source and running it to a whole another circuit that has different common grounds and may run into issues.
    Is there not any way to wire this up without shorting? Is an Optocuppler required considering The voltage signal is coming from a completely different battery source?

    The signal is running straight to the Pin on the Microcontroller and brings the signal hi and there is a 4.7k Resistor that is wired to the same pin and to ground to prevent floating.

    Thanks in advanced!!
  2. ronv

    AAC Fanatic!

    Nov 12, 2008
    All of the battery grounds need to be connected together.
    The micro won't like the 12 volts. Why not use the 9 volts.
    A schematic would be better than a description.
    Just looked at the ATtiny. It runs on 5 volts, so that should be your gas pedal voltage.
  3. AgentSmithers

    Thread Starter Well-Known Member

    Jan 14, 2011
    What happens if the grounds are not connected, Do they not conduct? The voltage regulator's does have a ground pin connected to the power source its coming from but the 5V that is filtered is running to another circuit so what's the effect without the common ground?
    Ill build a schematic. I used a voltage regulator to generate a 5v signal from the 12v that feeds into the separate circuit.