Aaron's Homepage Forum
Aaron's Homepage Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Projects/Inventions
 Computers/Electronics
 USB contraption

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an Image File (GIF, JPG, JPEG, BMP, ZIP, PNG)

   

T O P I C    R E V I E W
codingplanet Posted - May 24 2011 : 6:01:15 PM
I started making a USB contraption that would report temperatures and voltages to a PC and also alter fan speeds with PWM. It's my first time using a PIC 18F and also my first time working with USB but it's gone well so far.

Temperatures will be read with thermocouples but I've yet to arrange the hardware to interface them to the PIC. I've done it before with a 16F + LCD but I used an all-in-one chip that costs about £20 each. This time I think I will implement coldpoint compensation and such myself along with an instrumentation amplifier for the main amplification. Something I've yet to think about properly.

The firmware was written with Microchip's C18 and is based off one of Microchip's HID examples. The software is written from scratch by me using VB.net.

The reason behind this is that I have 2 very high speed fans (rated at 3A, 190CFM) on the radiator in my watercooling setup and I would like to run them at a lower speed most of the time but be able to ramp them up when needed.

Also when I'm benching with LN2, sometimes 2 temp meters and 4 voltmeters are needed and the desk gets a little cramped :P This would also give me the ability to log the data if I wanted to.

Thread can be found on my site here: http://www.benchtec.co.uk/forums/threads/8170-Owl-s-Contraptions
15   L A T E S T    R E P L I E S    (Newest First)
codingplanet Posted - Aug 24 2011 : 10:22:13 AM
Update :) http://www.benchtec.co.uk/forums/threads/8170-Owl-s-Contraptions?p=102119&viewfull=1#post102119
codingplanet Posted - Aug 13 2011 : 1:04:20 PM
Hi jnewman,
Yes, I am using Microchip's software USB stack. Interesting project there. Some similarities to mine.

Johnny, I have since spoken to a senior engineer at work about this (he specializes in instrumentation amps). He told me that the 0 - 3.3V specifies only the magnitude. The voltage can be in either direction. ie. It won't be a problem applying -6mV across the differential inputs. I also discovered by myself that the offset on the Vref pin will be added after the amplification stage.

I have used Altium at work, but only for drawing schematics. I found it intensely annoying.
wasssup1990 Posted - Aug 13 2011 : 07:16:16 AM
quote:
Originally posted by codingplanet

Hi Johnny :D I've done a bit since we last spoke.

I bagged a few diodes from where I'm working. They are SBRs "super barrier rectifiers". SBR2A40 to be exact. They are rated for 2A continuous and are fast switching like schottkys.

I have found that for reading voltages on my PIC's 12bit ADC, a 10uF cap makes a good filter across the input. The wire that I am using between my voltage source and the PIC is about 0.5m long and seemed to be picking up a small amount of noise. The cap fixed this while making a negligible effect on the voltage reading response time.

I have also decided that I will use an instrumentation amplifier, probably an AD8553 to amplify my thermocouple's voltage. And I will use a linear digital temperature sensing IC to provide cold-point compensation within the PIC software. However, as I wish to measure temperatures down to -200C using a single 5V supply, I need to offset the input by 6mV. Looking at the AD8553 datasheet (http://www.analog.com/static/imported-files/data_sheets/AD8553.pdf) can I use the Vref input for this purpose? The problem I see is that the differential input voltage is spec'd between 0-3.3V and the Vref correction would happen after the input stage. If I can't use the Vref pin I guess I will have to provide the offset on the inverting input.

Oh, and I started using Eagle for my Schematics and PCBs as DesignSpark was starting to piss me off (libraries aren't logical and the program wouldn't start on one of my machines).



Hi Adrian, buddy.

I've been pretty busy lately so please forgive me if I miss anything.

VREF, according to the equation given on page 13 of your datasheet will offset the voltage of the output. If I understand you and the datasheet correctly, you will need to positively offset the VIN- by your predetermined voltage of 6mV.

So,
quote:
Originally posted by codingplanet

"the Vref correction would happen after the input stage"

Is correct.

quote:
Oh, and I started using Eagle for my Schematics and PCBs as DesignSpark was starting to piss me off (libraries aren't logical and the program wouldn't start on one of my machines).

I have given Eagle a try on several occasions. It's good but I am not paying for it, so I am left with a cut-down, free licence which sucks. It wont let me use multiple sheets. I tried to crack it with initial success but then I gave up. I have used Altium; it is very good but it is a huge program and I wanted something a little more simple to use that isn't as resource hungry. Now I am using Kicad; it ticks all the boxes for me so far. I always use a pen an paper or a Tablet computer to get ideas out of my head quickly though. Then I use a "schematic capture" program and expand upon my design. I used MS Paint once... yeah, I don't need to say any more.

See ya.
jnewman Posted - Aug 09 2011 : 7:34:25 PM
You using something like PL2303 USB to TTL serial to bridge the PC to the pic or implementing a USB stack in software (if I remember the PIC from my PICAXE days you are using is really just a PIC, no hardware USB?).

I am, or have now finished a similar project, using an AVR ATMega8 with a PL2303 USB/Serial and a DS1307 RTC over I2C. A computerised irrigation system where you can program all your timings along with the current time using a VB.NET frontend, hit save, it sends it over serial, the AVR saves it to it's EEPROM and sets the clock on the DS1307. The AVR then polls the time on the RTC every couple of seconds or so and compares it with the timings in the EEPROM in simple terms. The valve is simply connected to a MOSFET, along with a protection diode, then into the AVR with a pullup resistor.



on the dev board, the valve there not connected though. The AVR is on the STK500 dev board wired to the RTC which is on the breadboard.

codingplanet Posted - Aug 07 2011 : 10:38:54 AM
Hi Johnny :D I've done a bit since we last spoke.

I bagged a few diodes from where I'm working. They are SBRs "super barrier rectifiers". SBR2A40 to be exact. They are rated for 2A continuous and are fast switching like schottkys.

I have found that for reading voltages on my PIC's 12bit ADC, a 10uF cap makes a good filter across the input. The wire that I am using between my voltage source and the PIC is about 0.5m long and seemed to be picking up a small amount of noise. The cap fixed this while making a negligible effect on the voltage reading response time.

I have also decided that I will use an instrumentation amplifier, probably an AD8553 to amplify my thermocouple's voltage. And I will use a linear digital temperature sensing IC to provide cold-point compensation within the PIC software. However, as I wish to measure temperatures down to -200C using a single 5V supply, I need to offset the input by 6mV. Looking at the AD8553 datasheet (http://www.analog.com/static/imported-files/data_sheets/AD8553.pdf) can I use the Vref input for this purpose? The problem I see is that the differential input voltage is spec'd between 0-3.3V and the Vref correction would happen after the input stage. If I can't use the Vref pin I guess I will have to provide the offset on the inverting input.

Oh, and I started using Eagle for my Schematics and PCBs as DesignSpark was starting to piss me off (libraries aren't logical and the program wouldn't start on one of my machines).
wasssup1990 Posted - Jun 15 2011 : 12:10:57 PM
quote:
Originally posted by codingplanet

Don't worry, I have fixed it now :D Device manager was reporting an issue with the hub. After disabling and re-enabling it, there are no issues and the front USB ports work again :D



That's great news Adrian. Hard to imagine damage can be caused merely by shorting out the 5V on a USB port.
wasssup1990 Posted - Jun 15 2011 : 12:08:30 PM
quote:
Originally posted by paulh

I think this can be really useful as you can see the temperature and voltage on the fly. I have tried a similar project before where in there is an extra bread pan I made use of to handle the meter. USB was still taboo back then and was just mainly used for storage devices. 1N4001 is a good multi purpose diode. You might want to check that out.



The 1N4001 is a good general purpose diode. However in the case of snubbing the inductive kick-back (flyback) of an energised coil of wire (a fan in this case), the need for a more specialised type of diode is required. The 1N4001 is not suitable because the need for a very quick transition from being reversed biased (most of the time) to becoming forward biased is required. Obviously the diode is only forward biased when it is snubbing the flyback. If you are so inclined and if you are fairly good at calculus, you can estimate the energy that will be wasted as heat through the snubber diode and maybe even guess at how hot it will get. I would do this kind of calculation because I am a N.E.R.D. (Not Even Remotely Dumb).

About Flyback Diodes:
http://en.wikipedia.org/wiki/Flyback_diode
codingplanet Posted - Jun 15 2011 : 11:56:16 AM
Don't worry, I have fixed it now :D Device manager was reporting an issue with the hub. After disabling and re-enabling it, there are no issues and the front USB ports work again :D
wasssup1990 Posted - Jun 15 2011 : 11:48:51 AM
quote:
Originally posted by codingplanet

Johnny, my USB ports were damaged to some extent. While a USB stick works, my contraption still works if plugged into a different set of ports.

I put a cap across the 12v rail (100uF, I will use larger value when I find one). And as you predicted, the spikes are greatly reduced. I expect they will be gone if I use the suggested 470uF.

Here is the result of the 12v rail added to the voltage on the other side of the fan: http://i547.photobucket.com/albums/hh471/UnknownReactionz/100_1457.jpg

2v/div, 50uS timebase.



I hate hearing about computers being damaged - it breaks my heart. Hehe.

Good to see you reduced your spikes.
codingplanet Posted - Jun 15 2011 : 11:02:43 AM
Johnny, my USB ports were damaged to some extent. While a USB stick works, my contraption still works if plugged into a different set of ports.

I put a cap across the 12v rail (100uF, I will use larger value when I find one). And as you predicted, the spikes are greatly reduced. I expect they will be gone if I use the suggested 470uF.

Here is the result of the 12v rail added to the voltage on the other side of the fan: http://i547.photobucket.com/albums/hh471/UnknownReactionz/100_1457.jpg

2v/div, 50uS timebase.
paulh Posted - Jun 15 2011 : 10:20:05 AM
I think this can be really useful as you can see the temperature and voltage on the fly. I have tried a similar project before where in there is an extra bread pan I made use of to handle the meter. USB was still taboo back then and was just mainly used for storage devices. 1N4001 is a good multi purpose diode. You might want to check that out.
wasssup1990 Posted - Jun 10 2011 : 06:43:11 AM
quote:
Originally posted by codingplanet

The USB +5v shorted to ground. The USB port is still functional and the PIC is to some extent but I get no USB communication with it. I have a spare PIC I can swap in at some point.



Crap! I think all compliant USB ports/chipsets should be current limited to 500mA continuous, so there shouldn't be any damage to the USB chip on your motherboard. Hopefully there's no damage done to your contraption though. Happy problem solving!
codingplanet Posted - Jun 10 2011 : 06:13:01 AM
The USB +5v shorted to ground. The USB port is still functional and the PIC is to some extent but I get no USB communication with it. I have a spare PIC I can swap in at some point.
wasssup1990 Posted - Jun 09 2011 : 11:42:26 PM
quote:
Originally posted by codingplanet

I seem to have inadvertently killed my device. I will have to debug it some other time.



Oops! Shit happens mate. Good luck with your debugging.
codingplanet Posted - Jun 09 2011 : 3:10:34 PM
I seem to have inadvertently killed my device. I will have to debug it some other time.

Aaron's Homepage Forum © 1995-2020 AARONCAKE.NET Go To Top Of Page
This page was generated in 0.12 seconds. Snitz Forums 2000