Brooke's World The life and ramblings of Brooke.

February 24, 2015

Contextual Electronics Current Sink or Swim Project – breadboard

I have been taking an online course in electronics called Contextual Electronics with Chris Gammell as the instructor.

We currently are working on a small board that acts as a current sink.  The idea is that by using a potentiometer, op amp, and N channel Mosfet, we can control the amperage that goes into a load ( LED, battery testing, etc. ).

So far we have been creating the schematic, picking parts, and laying out the PCB.  We have been able to get this done in about a month so far.  Next step is to order the boards, probably via OSH Park, order the parts ( Digikey ) for me, assemble, and then test.

My desire to understand how this works better and my eagerness to see something in the physical got the better of me this past weekend.  As a result, I replicated the current control portion of the schematic on a breadboard.

The “active” parts I used are:

Type Part
 Op Amp MCP601 
 N Channel Mosfet  IRF510

These are not the same parts we are using for the course, but they are what I had on hand and wanted to try to understand how the circuit works by being able to probe for voltages, measure current, and “twiddle” the power supply knob to see the impact of higher and lower input voltages.

What I learned is that  by adjusting the input voltage to the Op Amp, it would cause the FET to allow current ( and voltage ) to pass through.  Once the return voltage to the Op Amp reached the input voltage, the Op Amp would not need to let current through.  Then, the return voltage would decrease and the Op Amp would need to let more voltage through again.

From what I can tell, this happens so rapidly you can’t really tell just by using a voltmeter.  I have yet to put it on my oscilloscope to see if I can visualize what is going on.

But, this cycle of the op amp allowing voltage through, the feed back voltage increaseing to meet the input voltage to the op amp and then the op amp decreasing voltage, the feed back voltage decreasing until the op amp increases voltage, just keeps going in a loop….

Until of course, I change the input  voltage via the potentiometer.  This process lets me control the amount of current flowing through the FET by controlling the amount of voltage passing through the op amp.  In effect, I can use low voltage ( like a digital signal ) to control a very high amperage.

In my test, I was only testing from 0 to 135mah.  But, what mattered was that I could see the potentiometer that controlled the op amp input voltage control the FET output amperage.

 

Breadboard mess with small perfboard for my .1 ohm resistor

csos_bb

 

Supply voltage
csos_bb_tenma

Milliamps passing through FET at near maximum voltage supplied to op amp v+
csos_bb_mastech

 

Voltage making it to v+ ( I have a voltage divider that decreases the voltage from the supply before going into the potentiometer – that is part of another divider).

csos_bb_rigol

Video of my hand adjusting the potentiometer to see the current going through the FET decreasing and increasing.

October 3, 2013

Using the tymkrs “Turn Me” with an Arduino

Filed under: Uncategorized — Tags: — Brooke @ 11:24 pm

Here is a quick write up on how to use the tymkrs “Turn Me” rotary encoder.  This supports the “push down” feature of the tymkrs kit.

RotaryEncoderDemo_bb     output_window

DSC_0249_for_web

Fritzing Rotary Encoder Part: Rotary Encoder with Knob bth.fzpz

Fritzing Project: RotaryEncoderDemo.fzz

Arduino (1.5) project: RotaryEncoderDemo.ino


 /* Read Quadrature Encoder
  * Connect Encoder to Pins encoder0PinA, encoder0PinB, and +5V.
  * http://playground.arduino.cc/Main/RotaryEncoders
  * Sketch by max wolf / www.meso.net
  * v. 0.1 - very basic functions - mw 20061220
  * Sketch updated by Brooke Hedrick / www.millamilla.com
  * v. 0.2 - Added the "S" pin for encoders with push-down support - bth 09292013
  *        - Put a limit of 255 and 0 in place.  It rolls over automatically at the limits - bth 09292013
  *
  */

 int val;
 int encoder0PinA = 3;
 int encoder0PinB = 4;
 int encoder0PinS = 5;
 int encoder0PosUp = 0;
 int encoder0PosDown = 0;
 int encoder0PinALast = LOW;
 int n = LOW;
 int encoder0UpDown = LOW;

 void setup() {
   pinMode(encoder0PinA,INPUT);
   pinMode(encoder0PinB,INPUT);
   pinMode(encoder0PinS,INPUT);
   Serial.begin (9600);
 }

 void loop() {
   encoder0UpDown = digitalRead(encoder0PinS);
   n = digitalRead(encoder0PinA);
   if ((encoder0PinALast == LOW) && (n == HIGH)) {
     //Serial.print("up down:");
     //Serial.println(encoder0UpDown);
     if (digitalRead(encoder0PinB) == LOW) {
       if (encoder0UpDown == LOW) {
         encoder0PosUp--;
         if (encoder0PosUp < 0) {
             encoder0PosUp = 255;
         }
       } else {
         encoder0PosDown--;
         if (encoder0PosDown < 0) {
             encoder0PosDown = 255;
         }
       }
     } else {
       if (encoder0UpDown == LOW) {
         encoder0PosUp++;
         if (encoder0PosUp > 255) {
           encoder0PosUp = 0;
         }
       } else {
         encoder0PosDown++;
         if (encoder0PosDown > 255) {
           encoder0PosDown = 0;
         }
       }
     }
     Serial.print(encoder0PosUp);
     Serial.print(" ");
     Serial.println(encoder0PosDown);
   }
   encoder0PinALast = n;
 }

September 28, 2013

Contextual Electronics : Session 1 : Module 3 : Unit 5 : Understanding The Relay Module : Task

Filed under: Uncategorized — Tags: — Brooke @ 12:12 am

Task

  • Create a block diagram for the relay driver circuit.

Module3Unit5_schematic

Git: https://github.com/hedrickbt/ContextualElectronics/tree/Module3Unit5/Session1/MyBenchBuddy/KiCad

September 25, 2013

Contextual Electronics : Session 1 : Module 4 : Unit 5 : Choosing Components For The Current/Fan Driver Module : Task

Filed under: Uncategorized — Tags: — Brooke @ 11:57 pm

Task

Find the following types of components

Recall the following design goals:

  • Swappable components with easy to solder packages.
  • Low cost.
  • SPI DAC part with 8- 10 bits.
  • MOSFET capable of carrying half an amp in a surface mount package.
  • Moderately accurate sense resistor.

September 24, 2013

Contextual Electronics : Session 1 : Module 3 : Unit 4 : Understanding The Current/Fan Driver Module : Task

Filed under: Uncategorized — Tags: — Brooke @ 11:44 pm

Task

  • Create a current source with a voltage input, using an op amp.
  • Add in an optional DAC to control the current source with voltage readback

Schematic

Module3Unit4_schematic

Git Repository: https://github.com/hedrickbt/ContextualElectronics/tree/Module3Unit4/Session1/MyBenchBuddy

September 22, 2013

Contextual Electronics : Session 1 : Module 4 : Unit 4 : Choosing Components For The Thermocouple Module : Task

Filed under: Uncategorized — Tags: — Brooke @ 8:45 pm

Task

Find the following types of components:

Recall the following design goals:

  • 16+ bit input
  • Low cost
  • 1 degree C accurate (aim for .5 C accurate)
  • Swappable components
  • Easy to solder components

September 21, 2013

Contextual Electronics : Session 1 : Module 3 : Unit 3 : Understanding the Thermocouple Module : Task

Filed under: Uncategorized — Tags: — Brooke @ 11:37 am

Task

  • Create a block diagram for the thermocouple measurement circuit in Kicad.

Module3Unit3_schematic

 

Github:  https://github.com/hedrickbt/ContextualElectronics/tree/Module3Unit3/Session1/MyBenchBuddy

September 12, 2013

Contextual Electronics : Session 1 : Module 2 : Unit 9 : Creating A Schematic Skeleton : Task

Filed under: Uncategorized — Tags: — Brooke @ 8:50 pm

Task

  1. Create a schematic with a heirarchical page for each block in the block diagram.
  2. Add some hierarchical labels within one of the sheets.
  3. Exit the sheet and import the heirarchical pin to the top level heirarchy symbol.

SheetWithHiearchicalSheets

Github:  https://github.com/hedrickbt/ContextualElectronics/tree/Module2Unit9/Session1/MyBenchBuddy

September 8, 2013

Contextual Electronics : Session 1 : Module 2 : Unit 11: Mechanical Constraints : Task

Filed under: Uncategorized — Tags: — Brooke @ 9:02 pm

Measure or look up the dimension of an Arduino Uno. Compare against other versions of Arduino.

Verify the pin pitch of the stackable connectors on the edge of the Arduino.

Enter the board outline of the Arduino into PCBnew for a rough 2D guideline.

BoardEdgeLayout

September 5, 2013

Contextual Electronics : Session 1 : Module 2 : Unit 4: Project Creation : Task

Filed under: Uncategorized — Tags: — Brooke @ 4:32 am

If you want to participate alongside, do the following (before watching the execution video):

Older Posts »

Powered by WordPress