Saturday, July 20, 2013

Youritronics highlights



This is the last post for 2009 and I promise there will be much more in 2010. In 2009 we had some interesting projects developed here at youritronics.com here is some of the highlights:

The analyzer is currently at v.2.0 and it has allot more features then it originally had. Kits are still being produced and the shop has a new look.

The idea behind this project was born when a friend asked me too take a look at he’s broken GPS unit (MyGuide 3000) to see if I can fix anything. After figuring out that the processor is the faulty part I decided to use the gps module for a stand alone gps module that you can just connect to a netbook.

I would like to wish my readers a Happy New Year and may all your wishes come true. As you may have experienced, during the holidays,  hobbyists get some free time and they like spending it building stuff. In this case the author, Infernoz, build this 8 LED POV display, which seems like a fun way of wishing a happy new year. The device is based on the Attiny26 from ATMEL and from the video we can see it works quite nice, but unfortunately I was unable to locate any source code posted on the project page, but this is not that bad as you can find POV source code from others projects(POV1 POV2 POV3) if you’re interested in building one.

That is an officer of the law holding a modified pin pad discovered in Waterloo, Ontario, Canada. You can barely see it in this image but among other mods the pin pad has a BlueSmirf module attached to it. This allows someone sitting within ~100 feet away to capture all of the information transmitted by the pin pad including credit card information and the PIN number. Now SparkFun commented on this issue , and I agree with Nate that all things can be used for good or evil including their products. I don’t believe SparkFun should be blamed in any way for this, it’s the companies that make the pin-pads that should take care more of the security of their devices.
Bad guys will always try to trick the systems but it’s the companies who make credit card processing devices that should be one step ahead of them. I’ve read the comments on SparkFun’s blog and someone who works in a company that makes this devices said that they have all kind of security features that will make the pin pad unusable once someone tried to open it without authorisation. Someone else said they even have an internal battery for monitoring even if the pin-pad is unplugged or has it’s main battery removed so I’m not sure how someone managed to mount the BlueSmirf inside the pin-pad.

Chumby One was just announced on bunnie’s blog. You can get it now for 99$ pre-order price but once they start shipping the price will go up to 119$. You can read here about the story behing Chumby One and how bunnie tried to keep the price low by using every feature of this new processor from Freescale the i.MX233.  It turns out the i.MX233 has 3 internal switching regulators and it uses only one inductor to do the job. Next to the switching regulators the i.MX233 has even more analog features integrated like : audio codec,  speaker amplifier, USB PHY, video DAC, battery charger and more. This played out an important role in the final price of the Chumby One. You can read more about it on bunnie’s blog.

74HC4051 Analog Multiplexer

This was actually the first time I ever needed to multiplex analog channels so it was a good opportunity to learn how to use them. My task was to measure the temperature of 32 thermistors (NTC) with a microcontroller and later process that data. Obviously you cant find that much analog input channels on your common microcontroller so you need to multiplex the signals. First I looked for large analog multiplexers with 16 input channels but those are way too expensive. As it turns out its cheaper to use more smaller 8ch multiplexers(example Digikey pricing: 2pcs 16:1 mux from TI is $7.84 while 3pcs of 8:1 mux from TI is $1.53). I was able to get the 74HC4051 at a good price so I started creating the design around it.
With just four 74HC4051 I can multiplex 32 input channels to 4 outputs. The 74HC4051 has 3 select lines A,B,C and one enable line E. These 4 lines are used for control and they can be tied together like I did for controlling all 4 chips with the same 4 lines. By a combination of state (high/low) for A,B and C you can control which input gets connected to the output. In the schematic you will also find a table with the address select concerning the 3 pins A,B and C. The enable pin is used to disconnect all internal switches (when high) or allow connection (when low) by selecting the appropriate address. Each 74HC4051 got its own 0.1uF decoupling cap close to its supply pins and if you’re design is very sensitive to noise you can further optimize the layout and place more filtering on the supply lines.
To get a more stable reading at the output of the thermistor(actually at the output of the multiplexer) I also placed a low pass filter which later on after assembling and testing turned out to be unnecessary even creating problems because I was switching the lines faster than it took the filter to settle so I left the filter components out during assembly.
The PCB was manufactured at home hence the big vias and it was designed to allow a second board with the microcontroller to be stacked on top of it. Everything was tested on an Arduino and it works perfectly. The schematics and board file are released under CC-BY-SA and can be downloaded from the link bellow.
I spent the past 3 hours debugging my code that was absolutely fine. So just a quick note for everybody who’s working on pic32′s, if you’re using any math functions you have to include math.h; it is not enough to include the peripheral library (plib.h). The compiler won’t complain but you will get garbage out of your math functions.
And if you’re wondering what I was doing with all that math is just computing the temperature for a thermistor using the Steinhart–Hart equation.

I bought this multimeter(Minipa ET-870C) a while ago for $17, great value. I got it because its nice to have around multiple meters for when you wanna measure both input and output voltage/current. I believe it was advertised to have an auto-off feature for 15 mins but it didn’t. This eventually lead to many drained batteries because I often forgot to turn it off after using it. So during a boring weekend when the weather outside was bad I decided to add this nice feature to the meter. I knew it had to be a small circuit to be able to fit inside the multimeter so I picked the tiny25 the smallest micro I had around.
I quickly put together a simple schematic in Eagle, just the mcu, a voltage regulator a npn transistor and the associated capacitors and resistors. The circuit is powered from the multimeter 9V battery and cuts off the ground path to the meter to turn off its power. No ISP connector was placed on the board to save space but extra long pads were added so I can solder some wires for programming the mcu.

The npn transistor has its base pulled down so when there is no signal coming from the mcu the transistor is off. The pcb was made using the photo etching technique and it was assembled with some solder paste and hot air gun. I also soldered some wires to connect to my MKII programmer and I started writing the code.
To keep track of the time I used Timer0 to generate an overflow interrupt. Knowing the CPU frequency and the prescaler we can find out how often that interrupt will occur. Knowing how often the interrupt will occur we know how many times we need that interrupt to trigger to account for a given time in seconds. This is all calculated inside main.h where you can also specify the time in seconds.
To start the counting process I’m using a tact switch connected on INT0. When the button is pressed the level changed interrupt will trigger on INT0 and we change some flags to start counting as well as turning on the transistor to turn on the multimeter. When the counting reaches the setpoint, the flags reset and the transistor is turned off, thus turning off the meter. At this step the code was running ok except that for a 15 mins period there is ~12s error. I suspect this is because I’m using the internal oscillator which is not very precise.
Since the circuit was intended for extending the battery life, itself had to consume as little as possible. All measurements were made right before the voltage regulator at the battery leads. With no optimization the current draw at 9V was 3.67mA. The tiny25 has 3 sleep modes: Idle, ADC Noise Reduction and Power-down mode. The Idle mode would be good for when we are counting until the setpoint is reached, and the power-down mode for when we are waiting for the button to be pressed(INT0 interrupt trigger). So I’ve added some new lines of code to set the processor into Idle mode when the button is pressed, and to set it to power-down mode the the setpoint is reached and the transistor is turned off.