Components:
Melexis thermometer MLX90614ESF-ACF-000-TU
Consumables:
Solder
Glue
Drill bits
Wire. 24 gauge. (20 to 26 gauge is fine) Solid or stranded.
Sticky paper
Tape
Tools:
Phillips screwdriver
Soldering iron
Drill press or hand drill
Project:
The Arduino is the head and heart of the project. Everything connects to it one way or another. Oddly, it is not the most expensive thing in this project. Arduinos are ordinary microprocessors with an extraordinary community.
This project was intended to be very modular. Everything can be unplugged and swapped for a different version. Instead of being stuck with a pair of cheap headphones you may plug in your favorite pair. If you decide to build this one on the cheap and upgrade to a better thermometer later you just solder up the brand new thermometer and plug it in.
Arduino and Melexis temperature sensor as hooked up by bildr.
Note: I did not use this model of Arduino and my temperature sensor connects through a plug/socket/cord. The reason for this was size. Building a circuit the same was as bildr will still work.
The most expensive component is the Melexis infrared thermometer. The first prototype featured a much less expensive model, also made by Melexis. This thermometer was chosen because other people had successfully used an Arduino to interface with it and because the entire line uses the same interface. If you can talk to one, you can talk to all the others which use the same voltage.
The thermometer was put on a repurposed iPhone headset wire. This was done for a very specific reason. The cords on these headsets tends to be limp and flexible which is desirable. Since this can be worn on the head, having a stiff wire trying to bend at the same time is a bad idea. Four conductors are needed so a stereo headphone with microphone is perfect and easy to find cheaply on eBay.
The thermometer has a few components soldered to the leads in back. There are two pull-up resistors which are necessary for the communication with an Arduino and a capacitor to filter out some noise. These were sealed under ordinary black shrink tube after reinforcing the wires with hot glue. It felt like a shame to put a $26 thermometer on a $1 cord but it seemed like the best solution.
The Arduino and thermometer are the most expensive and complex parts of this project. Due to the modularity of this project, the rest is compartively simple.
There are five ports on the ESPeri.IRBud. The first is the 3.5mm socket for the thermometer. It doesn't need to be switched since there must always be a thermometer plugged in or it will not function properly.
Pinout of the TRRS 3.5mm socket
Wires inside the scrapped iPhone headphones
Connections behind the temperature sensor to the TRRS cord
The next port is a switched 3.5mm socket for the headphones. The two 3.5mm ports can get confused which is why it's important to apply a label to the bottom. Plugging the wrong device in could cause damage. It is switched so the Arduino knows when to bother computing a frequency for the headphones.
Underside and numbered view of the 2.5mm and 3.5mm sockets.
Numbered connection diagram of the 2.5mm and 3.5mm sockets.
The 3.5mm headphone socket accepts any standard 3.5mm (1/8") headphone. There is a potentiomter between the socket and the Arduino to keep the volume from hurting a user's hearing. If you seal the potentiometer inside the device like is shown, it is recommended to use headphones with volume control built into the cord or purchase an inline volume controller.
The third port is a 2.5mm stereo socket. This is for extra hardware. This port sets the second prototype apart from the first and allows a wider range of output devices. The tip of the 2.5mm is negative so the built-in switch can accurately judge when a device is plugged in. If no device is plugged in then the extra math associated with it isn't performed.
Advanced users can freely program their own devices and power them right off the same port. The stereo plug provides a power connection, ground connection and one data pin capable of PWM.
The processor reads the four DIP switches at start up to know which type of hardware is plugged in. A different arrangement of the switches is used for a NeoPixel as opposed to a servo motor. Changing the switches while power is applied is ineffectual.
This was not the final arrangement. Do not follow this image.
These DIP switches could be elimnated and replaced by simply soldering the pins to Vcc or GND. Advanced users can alter the programming to select which hardware is being used.
Power for the unit is supplied through a coaxial barrel plug. The specific diameter isn't important for this project so long as the mating end matches. A 9 volt battery makes for a good power supply but a 23A battery is a smaller and lighter alternative. Both are acceptable power supplies. An AC adapter could also be used but DO NOT use an unregulated power supply. If you don't know what that means, just stick to batteries or you could damage the Arduino.
The final port is the data port for the Arduino. This is a six position, 90 degree, female header. This allows the Arduino to be easily reprogrammed without opening the enclosure. This port is not used in normal operation. It is the equivalent of an exposed USB port on a wireless router.
The enclosure was the smallest ABS enclosure that could fit everything. An Altoids Mini tin is roughly the same size but mounting the ports on a metal clamshell like that would prove difficult.
Code for the tone generation wasn't changed from the first prototype to the second. The bulk of the code writing for the second version, and the bulk of the code in general, was related to the external devices that can be used with this model.
At first all the devices used a mapped or scaled relationship to temperature. For example, if the temperature was -10º Celcius a vibrating motor would operate at 0%. If the temperature was 250º Celcius a vibrating motor would operate at 100%. If the temperature was 130º Celcius it would operate at 50%. This turned out to be a huge problem because there was not enough variance to sense a small change in temperature.
To fix the problem the scaling was reined in so that the upper and lower limit were bound by the maximum and minimum temperatures seen by the device since start up. This way a bedroom with cold windows and a hot computer exhaust would show the temperature extremes. The cold window provided the lower bound of temperature and the vibrating motor operated at 0% when facing the windows. The computer exhaust provided the upper bound and vibrated at 100%. The vibrations were low when facing a wall and a bit higher when pointed at a human or a cat.
This method of bounding was used for all the externals. It is useful whether the probe is being used in a hot kitchen or a walk-in cooler. The only drawback is that the probe should be allowed to see the highest and lowest spots in a room so that a good estimation of what is hot and what is cold can be determined. The bounds do not stop updating so walking from a warm room to go outside and shovel will reset the lower bound to the temperature of the snow.
The vibrating motor is the least flashy external but probably the easiest to understand. It uses a simple pulse width modulation (PWM) output and goes from 0% to 100% duty cycle. A vibrating motor isn't the only thing that can be used here, an electrode could be used to shock the wearer. Harsh, but there are no moving parts to break. A solenoid which presses a plunger into the skin at different pressures could also be effective.
The devices I made were all proof-of-concept so they do not have fancy enclosures. I happen to have a 2.5mm to 3.5mm stereo cord lying around and a lot of extra 3.5mm stereo sockets so I used what I had lying around. Finished externals would probably have wire soldered directly to them.
The next device is a simple 5V relay. When a relay chatters that vibration can be felt easily. The cost of a 5V relay is a small fraction of the cost of a vibrating motor. As an attempt to save money for a user a relay can easily act as a haptic sensory external.
One of the devices which inspired me to build the IRBud was a wrist mounted sonar unit. The idea of applying pressure based on machine-read data was so intuitive that it caught my eye. Unfortunately the small voltage regulator built onto the Arduino couldn't push a servo motor so an external arrangement was made which allowed a USB battery to power the servo as well as the IRBud itself through one plug.
There are two settings for the servo. One which rotates the servo a maximum of 90º and another which uses the full rotation spectrum of the servo. Actually, only 176º since I don't want to bottom out a servo.
The last external is a NeoPixel. The color changes from blue to red. Pure blue is the coldest and pure red is the hottest. This was inspired by Max at Maxjusticz. He created a light painting of his house by using RGB LEDS and a Melexis IR thermometer in the same product line. His light painting showed hot and cold spots the same way a thermal imaging camera would but used a regular digital camera. It's not live video but it will tell you where your windows are draftiest.
A flashlight body with a focusing lens was used for this project but only one NeoPixel. Max used nine RGB LEDs. This was really a way of learning how to implement a NeoPixel which are neat little toys.
The code for the project must give credit to bildr's Is it Hot? project. They supplied the code for the Melexis thermometer. If you want to replicate the IRBud read their article. They're not as long-winded as this.
Many projects ago was a musical instrument. From that musical ratios were learned. From music the concept that humans don't hear tones in a linear form was learned. Humans hear according to an exponential increase in tone. Human can tell the difference between 30Hz and 35Hz. Easily. But the difference between 15,000Hz and 15,100Hz is almost negligible.
To accommodate this quirk the scaling of tone for the IRBud increases exponentially. There are small shifts in tone for low frequency and low temperature. There are wide shifts for high temperatures. While experimenting with different tones I found that after 5KHz the tone sounds "urgent" or alarming. That frequency was used as the border between cool and hot temperatures. 5KHz corresponds to 100º Celcius. After that temperature you probably don't want to touch the surface with your bare skin for more than an instant. It should be alarming.
The IRBud is meant to be accessible to many people. It can be implemented in a variety of ways just by attaching different externals. A wrist-mounted temperature sensor with a vibrator would allow a person to feel surface temperatures before touching them. That could be a huge safety boon. A shoulder mounted unit with a pressure asserting solenoid could allow wait-staff to sense when a patron's coffee is cold or soda is warm.
So far, I haven't thought of a bad way to implement this.
Schematic of the Arduino circuit
This is a demonstration of the tone identifying a cup of hot tea, room temperature grapefruit and an identical cup of ice water
This demonstration uses a very warm stairwell in my apartment. The windows are drafty and the baseboard heaters are running. The first ten seconds are hard to hear
Here is a sauna in my building. It had only been turned on a few minutes prior to recording
The NeoPixel shining colored light on the tea cups and grapefruit
Here is that same example but done in the dark
Here is a video of the stairwell as painted by the NeoPixel
Here is a sauna in my building. It had only been turned on a few minutes prior to recording
The NeoPixel shining colored light on the tea cups and grapefruit
Here is that same example but done in the dark
I look forward to trying this out. An excellent idea.
ReplyDeleteLet me know how it goes!
Delete