I’ve been looking to upgrade the way that I have been sending SMS’s which is through a Nokia phone using F-Bus and came across the SIM900A module. If you can spare the cash, I would recommend it over Nokia F-bus as it’s easier to use.
It’s a relatively cheap module for $20 on Ebay but you need to check that the SIM900A works in your country before buying it. By using AT commands, we can send and receive SMS quite easily and I was going to cover this but there are already tutorials around that cover it quite well.
So instead I’ll be explaining how we can use the SIM900A’s GPRS to fetch a file from a webpage and print it out so we can process the data. Potentially you could use this instead of waiting to receive an SMS, for greater data transfer rates vs price per SMS or better yet for control of a device such as a remote control car/quadcopter as long as you have mobile reception.
SIM900A Hardware
The one I bought is the “SIM900A Mini V3.0.2, 2014.10” which comes with an external antenna. The PCB has a MAX232 on board if you wish to hook it up to your computer directly.
Today we’ll be taking a look at the D-Link Wireless N300 ADSL2+ Modem Router (DSL-2750B), an ADSL2+ wireless N router with 4x 10/100 network ports, a USB port for device/printer sharing and dual antennas.
4 screws later and we’re in.
We’ve got quite a few 25V 1000uF caps but they are CapXon branded ones and 2x Lelon 10V 470uF caps too. The antennas are soldered directly to the PCB and glued down, one of them has an RF choke and they’ve skipped the shielded can on the Wifi chip.
There is a header near an inductor which could be a serial header and instead of placing a thermal pad or paste on the main chip they’ve just placed glue and the heatsink on top, eh I guess they wanted to save cost.
I’ve been playing around with the idea of rebuilding the temperature loggers I’ve done in the past (SATVL / A25TTL); both have their advantages and disadvantages. I’m looking at going a little bit larger than the A25TTL so it would have a proper SMD battery holder, combine the logger and reader into one again like the SATVL and look at having an option to use the TMP102 temperature sensor (0.5C accuracy), upgrading the EEPROM to 1Mbit and possibly look into adding a RTC later on.
Recombining the logger and reader into one means the ATtiny13/25 that I’m using won’t do the job so an ATtiny44/84 or ATtiny841 should have enough pins however if we do go with the TMP102 its supply voltage is 1.4 to 3.6V which means we’ll need to use an 3.3V LDO or similar when connecting up to the USB. With 3.3V to the MCU we’re limited to a 12 MHz which is just enough to run V-USB.
I did a quick mock up of how the PCB could look like (29×15.5mm). To keep the PCB as small as possible, I’ll be using all SMD parts and going with a SOT23 LDO (Richtek RT9166) and a small 12MHz crystal (3.2 x 2.5mm). The MCU will still be using the watchdog timer (for the time being) when it’s doing the delay time so the accuracy is still going to be around 10% -/+. I’ll have the battery holder on the back like the SATVL does and the TMP102 (which is smaller than I expected) on the bottom right without the ground plane near it to reduce any effect it might have on the temperature reading.
From our last part we added trigger options/sample rates, made small hardware changes and came up with possible design changes which could give us an 100MHz logic analyser. It’s been 6 months since my last update – I’ve just been working on little improvements and have enough that I can report on them all now. In this part we’ll take a look at our PCBs, move from MiniLA to Sigok Pulseview, a simple GUI interface and a few software modifications.
First things first, the PCBs arrived so I built one up quickly, the SRAM was a little tricky to solder and I reflow soldered the oscillator and Mini USB connector (I seem to always have issues with the pins bridging on the Mini USB when using an iron). Both the ATmega and CPLD were programmed successfully however the logic analyser just didn’t work properly. The CPLD was getting quite hot and turns out that some pins were stuck at VCC or GND no matter what I did and 1 pin on the ATmega also had an issue.
I found that the 1.5K resistor used for the USB was connected to 5V instead of the 3.3V regulator so potentially this could have caused the issue, good thing a cap with 3.3V was close by so I soldered it to that. I replaced the CPLD and jumper wired another pin on the ATmega to it and everything worked this time around. Just to be sure that everything was really ok, I built up a second PCB and confirmed it all worked.
I tested the logic analyser on a Gameboy cartridge and found that even when using 100K resistors, you could see a pretty bad load that its applied. I increased the resistors to 1M and then I settled with 4.7M.
Faster USB transfer
Previously I was using 2 bytes when transferring the 8 bits worth of data, the main reason being that I wasn’t able to use “0” as an actual result as it would mark the end of the string.
Today we’ll be taking a look at the Feeltech 12MHz DDS Function Generator (FY2100S), it’s function generator that can do square, sine and triangle waves with sweep plus it’s a 1Hz to 60MHz frequency counter. It seems to work reasonably ok however there is a bit of jitter. Once you go over 8-9MHz – square waves don’t look like they should and the sine / triangle waves look similar too.
Once I picked up the case, it was very light so there’s probably not a lot going on inside.
A few notches later and we’re in, this thing is pretty much empty with all the components being on the front panel – I might just remove the case and make a small back panel for it. We’ve got 5V input from USB, an MC34063 to invert the voltage to -6V (which gives us 12Vpp) and an AMS1117 3.3V LDO.
The Gameboy Cart Shield has now been updated to v1.3 which allows us to increase our speed by using SPI to communicate to the 74HC595 shift registers and also features a power button which allows us to switch cartridges without having to unplug the USB cable and supports the Gameboy Camera now. Previously I used to only provide the PCB / assembled version but I’ve decided that I’ll also start providing the kit version too now that there’s a bit more parts to it (will be in stock in 1-2 weeks).
I’ve had two users contact me with various improvements that could be made – the biggest ones were using SPI, increasing the baud rate, a cartridge sensor idea and a bug fix for reading the cartridge title so I updated GBCartRead to v1.6 to included these improvements.
Instead of using shiftOut, digitalWrite and the delay, we’re able to use hardware SPI to increase the speed and after testing the latch timing, 1 nop wait is all we need. I’ve replaced all digitalWrites and changing the DDR/PORTs directly for switching between inputs/outputs and high/low.
Today we’ll be taking a look at the HP 1410 16 Port 10/100 Switch (J9662A), it’s a 100Mbit 16 port switch so it’s nothing special but it’s suited more for the business environment due to it’s metallic casing.
5 screws later and we’re in.
The layout looks neat and there is a lot of via stitching, date code is 7th week of 2013. We’ve only got 1 electrolytic capacitor on the board (at the input) and they skipped the need for inductors at the input. We have 2x MP1482 SMPS with 1uH unshielded inductors and they are relatively large considering that the input is rated for 12V @ 300mA, so the maximum current that could be used say ~95% efficiency at 5V is ~700mA. Also there’s 4x FPE H40520MN transformer modules and 14 transistors driving the 8×4 front panel LEDs.
A while ago I built a simple constant current dummy load for testing my SMPS however the maximum load was about 1 amp and 2 amps with a fan on it and I always had to use a multimeter to measure the current. I’m looking at having a load of up to 4 amps or more, adding an ATtiny to control a 4 digit LED display to show the current, use a proper potentiometer and use a bigger heatsink.
https://www.youtube.com/watch?v=tWYfkr0ul5w
Originally I was planning to have it all powered by input voltage like before however at low voltages the STP22NF03L N mosfet that I had lying around didn’t switch on enough with the MCP6242 op-amp so after thinking about how I could do it – use 2x coin cell batteries, 9V battery, etc, I went with a Lipo battery. An upside of using a battery is that this allows us to use any input voltage between 0V to 30V to test our load with.
Before I had 1 ohm resistors which were almost getting as hot as the mosfet so I’ve gone down to 0.1 ohm 3W resistors – I added the option of another resistor in parallel if need be. I used a 1.5K resistor on the op-amp on the non-inverting side of the op-amp for a bit more fine tuning of the pot.
It was all working well until I decided to charge up the Lipo batteries to full which was just enough to voltage to fry (and catch fire) one of my high side mosfets from the voltage doubler (should have used boost strapping instead). Now it’s time for me to re-visit this project – use P & N mosfets, change the wireless to 433MHz for more range and add some controllable front/rear lights.
Originally I was going to use the ATtiny85 but since I want the lights to be controllable I need a few more pins so I’ll be using the ATtiny84. Most of the 433MHz receive/transmit code can be re-used from my Alarm system – Remote control upgrade and most of the rest could remain the same.
DDRB |= (1<<PB2); // Motor forward control
DDRA |= (1<<PA7); // Motor reverse control
TCNT0 = 0;
OCR0A = 0; // Sets motor forward duty cycle to 0%
OCR0B = 0; // Sets motor reverse duty cycle to 0%
TCCR0A |= (1<<COM1A1) | (1<<COM1B1) | (1<<WGM00); // PWM, Phase Correct and OCRA/B outputs
TCCR0B = (1<<CS01); // 8 prescaler
I decided to simplify the PWM to the motors and have it done all in hardware rather than using timers with interrupts like I did before.
From our last post we revisited the MC34063 circuit to see if improvements could be made in which we found reducing the turn off time helped quite a bit and we also made a constant current dummy load for testing. Also there was a user who left a comment about using a NPN, diode and resistor to improve switch off time, it reduced it by more than half and I saw 40C on the FDC365P mosfet. The MC34063 circuit has become a bit much as it stands in terms of the components/size so I went looking around for another DC-DC chip which costs around the same and is more modern.
I found the Richtek RT8293A on special for 40c which is step-down converter, 4.5V to 23V input, 0.8V to 20V output, 340KHz operation and up to 3 amp output. There is a heatpad on the bottom of the SO-8 package for better heat dissipation.
We adjust the output voltage by the resistor divider like before and since we are at a higher frequency we can use a small inductor though there are a few extra components to the RT8293A circuit too but they only add a few cents more to the cost. There is the 3.3nF and 13K for the error amplifier compensation, a soft start feature which uses a 0.1uF capacitor to slowly increase the output voltage, another 0.1uF capacitor to bootstrap the high side driver, a 100K for the chip enable and they recommend 2x 10uF input and 2x 22uF output ceramic capacitors.
PCB Test
So I went ahead and bought everything that the datasheet said and started designing the PCB around the layout that they provided but looking around there is a reference board made more recently and the layout made a bit more sense so went with that.
AdvanceVGA – Play your GBA on the big screen! Swap out the LCD for our board, solder some wires, connect 5V USB and VGA and you’re ready to go.
GBxCart RW allows you to backup GB/GBC/GBA ROMs, save or restore game saves and re-write supported flash carts. Mini RW option available for GB/GBC only.
Wireless Gameboy Controller – Use your Gameboy, mGB, GBC, GBA, GBA SP, GB Micro, NDS and NDS Lite as a wireless controller on Windows, Linux, Raspberry Pi, etc, and on your NES, SNES, N64, Gamecube and Wii.