Here’s a design challenge for you: make a temperature sensor for any computer. If you’re an exceptionally clever smart ass, you’ll probably write some code to report the CPU temps. Others who take the exercise seriously will probably build something with a 1-wire temp sensor, a microcontroller, and all the hardware required to do that.
[Michael] had a better idea. He did it with just two components. One of those components is a USB connector.
The only reason is project could be created is a rather new part from Microchip, the PIC16F1455. This microcontroller doesn’t require a crystal, can do USB without any additional parts, and has an integrated temperature sensor. [Michael] whipped up a project to set up a USB CDC serial device, read the temperature with the ADC (thanks to a very helpful app note), and sends the temperature to a computer once a second.
Despite being built out of only two components, this could actually be a useful device. The PIC is a USB serial device, and this can be used with any computer made in the past 15 or so years. It would hardly take any code at all to read the temperature with another program, and it’s a very inexpensive build. We have to give style points for soldering a microcontroller directly to a USB connector, too.
Neat. There was a time when a component was a resistor or transistor or a switch. We called these kinds of things “ICs” or “chips”. How many old-school “components” do you suppose are in this device?
How long ago was that? That sounds like it was before my time.
I wonder what it would take to do USB in discrete transistors, or if it would even be feasible even in the lowest speed.
At the low level, even trying to implement the state machine using a CPLD is a pain and that not considering that there needs to have some smarts to handle quite a bit of messaging even before the host would recognize it.
You mean “passives”
In fact, he meant “discretes”.
Why then is he so aggressive and indiscreet?
It legitimately looks like a 2 component solution. It doesn’t even look like he used scraps of wire.
Yeah, depends on a very fortuitous positioning of pins, also the fact that it runs @ USB voltage is convenient. I have a msp430 variant lying around, that includes a temperature sensor. Wonder if that would work in this configuration?
I was thinking the same thing. Im not sure if there are any 5V capable msp430’s though, so it would at least require an extra regulator.
I think component is a word that can be used in a variety of ways, and is quite adaptable to the circumstances.
Neat hack! How accurate is the interal temperature sensor? But I wonder… how reliable will the micro be with no bypass capacitor on its supply?
It occurs to me that if the PC has a camera, it can measure temperature with just ONE external part — a real thermometer. Write a program to use the camera to read the thermometer. Such a program could conceivably read any kind of “meter”; multimeter, micrometer, speedometer, etc. It’s “optically isolated”, too! :-)
USB with no micro? Hmm… Can a host PC somehow tell if something is plugged into the USB connector even if the thing doesn’t respond with data? Like by the fact that it’s drawing current, or putting nonsense on the data lines? If this is possible, there are all sorts of ways to sense things without data.
If you mess about in Control Panel (in Windows) long enough, you can find the current draw for your USB ports. But I dunno if that only applies to devices that are registered with the system, ie need smarts. When I find my USB reading lamp I’ll let you know.
There’s the standard for phone chargers, where a simple resistor on the data lines requests a particular current rating. Dunno if real USB ports support that, or just chargers.
well, you have three options:
a) put a resistor on the data line – that tells the port (kernel,driver,whatever :) how many mamps you need
b) put something that can actually talk over the data line – and let it tell the usb host themselves
c) don’t put none – and have either the port supply the max it can give, or the minimum it thinks is proper
note that with a) you can’t use the data lines for data – so in this case, it’s a no-go :)
The “power consumption” is simply the power budget using what the USB descriptors data structure reported by the USB (microcontroller) in the device. There are no ADC inside a regular PC to read what’s *actually* consumed. Even for the descriptor, it is a static one time read from the microcontroller during a device configuration and not constantly polled.
http://www.beyondlogic.org/usbnutshell/usb5.shtml#ConfigurationDescriptors
See 8 bMaxPower 1 mA Maximum Power Consumption in 2mA units
Yeah, I think missing the decoupling cap is a gamble, might be unstable if you try it on more PCs etc.
I came here to say the same: with the camera you can read a thermometer. And let’s not forget you can attach an I2C temperature sensor in quite a few points(mainboard, RAM, VGA).
Oh, and most new laptops have a phone style 4 pin connector for headphones, where you could directly attach a 1 wire sensor. But damn, you still need the connector so it is still 2 parts.
Now just make it a SMD version of the chip.
Didn’t we learn about a way to connect a temperature sensor directly to the i2c bus of a pc’s ram module just some posts ago? http://hackaday.com/2015/06/12/solder-any-expansion-directly-to-your-computers-memory/
Looks like that one component temperature sensor wins the game.
The wires are another component of the setup with the I2c.
Mind you as others point out, you’d want an extension of some sort in most cases with temperature measurement so then this one would also become a 3 parter.
So this will tell you thr temperature of the ic.
Its using power and its procesding which will generate heat.
Not the temperature of the room its sitting in.
Why not just stick a seial bus temp sensor on there instead?
Really need an extension cable as the USB port of a laptop conducts heat from the motherboard to the connector and in some cases near a vent exhaust.
Are we so obsess to minimize the number of components to the point of promoting bad practices? i.e. lack of decoupling caps? Do we want to make China quality hacks?
Nice. I bought a usb temp sensor off ebay but I haven’t had the balls to use the Chinese drivers…
I thought of an attiny running v-usb using its internal temperature sensor when I saw this.
Me too but after that, I realized, that it probably requires some components for the USB.
Usb supply is 5V and data is 3.3V. In VUSB you normally limit the voltage with zenner diodes. The PIC has internal regulator.
T.I.L, the clever thing here is the way the pic calibrates his clock to USB data to avoid a crystal,
i droped the PIC years ago, but i think i’m gonna give them a second chance.
many uCs do that, it’s not a PIC thing. (work with USB just by using internal oscillator)
You can calibrate to the USB Start-Of-Frame signal in V-USB (https://www.obdev.at/products/vusb/index.html). Probably all of the Tiny48/85-powered USB devices do this: Trinket, Digispark, etc.
A USB-HID to i2c like SiLabs CP2112 and you can use any of the very accurate i2c temperature ICs out there.
Crystal-less operation, HID Library so you can write a display in C# without any vcom drivers needed.
It looks like the firmware is sending the raw ADC results over USB
1. It looks easy to change this to send temperature itself
2. From the application note the temperature indicator requires at least one conversion at a known temperature for calibration purposes. Basically to let you figure out the c in y=mx+c. The m coefficient appears more stable in the figures.
Without the decoupling cap the quality of a/d conversions may be affected.