Brooke's World The life and ramblings of Brooke.

June 2, 2017

Completed build of SensorBoard v2 for Contextual Electronics

Filed under: Contextual Electronics — Brooke @ 4:34 pm

I had time last night to work in the SensorBoard v2. I was able to laser cut the stencil, paste, place, reflow and visually inspect. Next stop will be to plug it in and test. During the fab downtime, I have been writing test applications for all the different sections. This should shorten my bring up time.

This board is a replacement due to issues  ran into where the copper was exposed outside of the pads that caused shorts to ground in many places.  It turns out that at some point, KiCAD changed a default setting which caused the issue.  You can read more about it on the CE forums.

May 6, 2017

Testing DS7505 with Bus Pirate

Filed under: Contextual Electronics — Brooke @ 4:53 pm

As part of the CE Header project from the CE Skills course , I needed to learn to work with DS7505.  I used a Bus Pirate (Dangerous Prototypes) and probes, from Seeed Studio, to iteratively poke at it until I understood how to talk to it via I2C.

Once I soldered the DS7505 to a small carrier board from Adafruit, I placed it on a breadboard and wired it up to the Bus Pirate.  Please note, the cable and connectors in the image below are from the Seeed probe cable.  Some of the other probe cables have the colors in a different order on the connectors.

I used putty to connect to the Bus Pirate via a mini usb cable.

Command What it does
Initalize the Bus Pirate
m 4 1 Mode, I2C, Speed 5khz
W Turn power on
P Turn on pull ups

 

Command What it does Output
Find the I2C address
(1) Find the slave address 0x90(0x48 W) 0x91(0x48 R)

 

Command What it does Output
Working with the Config register
[ 0x90 0x01 [ 0x91 r:1 ] Read the register 0x00 (default)
[ 0x90 0x01 0x60 ] Enable 12 bit resolution
[ 0x90 0x01 0x60 [ 0x91 r:1 ] Enable 12 bit resolution and read back current config  0x60

 

Command What it does Output
Working with the temperature register
[ 0x90 0x00 [ 0x91 r:2 ] Read the register ex:  0x19 0xE0
 

How to calculate given: 0x19 0xE0 and 12 bit resolution.

Bit 8 of MSB is the sign. 0=+ and 1=-
MSB is whole number
LSB is fraction

The most significant 4 bits of the LSB are used for 12bit precision.

MSB 0011001
25C +
Total = 25.75C
LSB 1100000
12/16=.75
Given: 0xE6 0x78

Note: negative due to the 8th bit of the MSB being 1

MSB 11100110
(NOT 11100110) +1
00011001 + 1
00011010
-26C +
Total = -25.0625C
LSB 1111000

15/16=.9375

0.9375

 

Click for full size

 

Testing MCP9808 with Bus Pirate

Filed under: Contextual Electronics — Brooke @ 3:55 pm

As part of the CE Header project from the CE Skills course , I picked an additional temp sensor to test with, the MCP9808.  I used a Bus Pirate (Dangerous Prototypes) and probes, from Seeed Studio, to iteratively poke at it until I understood how to talk to it via I2C.

Once I soldered the MCP9808 to a small carrier board from Adafruit, I placed it on a breadboard and wired it up to the Bus Pirate.  Please note, the cable and connectors in the image below are from the Seeed probe cable.  Some of the other probe cables have the colors in a different order on the connectors.

I used putty to connect to the Bus Pirate via a mini usb cable.

Command What it does
Initalize the Bus Pirate
m 4 1 Mode, I2C, Speed 5khz
W Turn power on
P Turn on pull ups

 

Command What it does Output
Find the I2C address
(1) Find the slave address 0x30(0x18 W) 0x31(0x18 R)

 

Command What it does Output
Working with the Config register
[ 0x30 0x01 [ 0x31 r:2 ] Read the register 0x00 (default)
[ 0x30 0x01 0x00 0x08 ] Enable Alert Stat
[ 0x30 0x01 0x00 0x08 [ 0x31 r:2 ] Enable Alert Stat and read back current config  0x00 0x08

 

 

Command What it does Output
Working with the Manufacturer register
[ 0x30 0x06 [ 0x31 r:2 ] Read the register 0x00 0x54  (default)

 

Command What it does Output
Working with the Device register
[ 0x30 0x07 [ 0x31 r:2 ] Read the register 0x04 0x00  (default)

 

Command What it does Output
Working with the Resolution register
[ 0x30 0x08 [ 0x31 r:1] Read the register 0x03  (default)
[ 0x30 0x08 0x00 [ 0x31 r:1] Set register to 0x00 or 1 bit resolution and read back 0x03

 

Command What it does Output
Working with the Ambient temperature register
[ 0x30 0x05 [ 0x31 r:2 ] Read the register ex: 0xC1 0xBC

Celsius = (C1BC & FFF)/16 = 24C or 75F, see P25 of MCP9808 Datasheet

Special result values

0x80 0x00, TA>TCRIT
0x40 0x00, TA>TUPPER
0x20 0x00, TA<TLOWER
0x10 0xBE ( after upper&1F ), TA < 0C, Celsius = d256 – ((( 10 & 0F ) * d16) + (BE/d16))= -245?

 

Click image for full size

 

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.

Powered by WordPress