|
Written by Oleg Mazurov  Fan regulator
This simple mod, originally described by tinhead on EEVBlog forum, is intended to make built-in cooing fan quieter. Typical problem with cooling fans is the noise they make and typical solution is to decrease voltage (and therefore current) to the fan to make it rotate slower. Hantek DSO5000-series oscilloscopes have 3 terminal 12V regulator dedicated for the fan (pointed at by an arrow on the title picture). To change the fan voltage I simply need to replace the regulator marked U7 on the power supply PCB.
Tinhead’s original mod was to replace 7812 (12V) regulator with 7805 (5V). It will work assuming good quality fan. Mine refused to start from 5V so I used MC7808 – a 8V regulator. Another good candidates were 7806 and 7809 but after first try I decided 8V is good enough – the fan is spinning well and the noise level is low.
The following picture shows power supply PCB unscrewed from the chassis and turned upside down. Again, an arrow shows the regulator. The PCB is single layer; replacing the regulator is a simple matter of removing solder with a solder wick, pulling the original regulator out and soldering on the replacement. If everything is at hand, the mod takes about 15 minutes to complete, including testing.
Enjoy!
Oleg.
 Bottom side of the PCB
Written by Oleg Mazurov  Hantek DSO5000 screen
Some time ago I realized that I need to add digital oscilloscope to my set of instruments. DSO is handy for measurements and taking screenshots and this is what I have been doing a lot lately. After comparing specs of current models from several manufacturers I picked Hantek DSO5102B scope. The main reasons to choose this model were cost, screen size, and rich potential for hacking – in no particular order.
Hantek DSO5000-series scopes come in 3 bandwidth variants – DSO5062B(60MHz), DSO5102B(100MHz), and DSO5202B(200MHz). They are identical or nearly identical (early production scopes of different bandwidth had different value resistors soldered in analog front end but that’s the only difference), and making one from another is a simple matter of editing certain configuration files inside the scope. In addition to that, many other modifications can be made, including fan speed, low jitter ADC clock, low noise power supplies, and many others (see the EEVblog thread – the first link in the list at the end of this post). Newer benchtop DSO/MSO oscilloscopes from Hantek are based on the same hardware and there were successful attempts to make a MSO from this scope by adding a logic analyzer PCB.
As is often the case with Chinese products, the oscilloscope is also available under brand names Tekway, Voltcraft and some others with model numbers different from Hantek. The firmware has been originally developed by Tekway and uses Tekway model numbers – DST1062B(60MHz), DST1102B(100MHz), DST1202B(200MHz). Out of many brand names, Hantek seems to be the cheapest. Also, where I live (the US) Hantek can be bought locally. When I was shopping around, 60MHz models were more expensive than 100MHz so I ended up buying DSO5102B from Hong Kong for $388.88 shipped by UPS Global Express.
After receiving the instrument I checked the functionality. The scope worked well, the screen was large, and bugs were tolerable. I then proceeded to “modify” the device to 200MHz model; what follows is the detailed description of the steps I took to implement the mod outlined in EEVblog thread (Tinhead, you are the man!) – proceed at your own risk! The instrument has no “warranty void” stickers and I’m assuming that from the warranty standpoint opening the case is OK but I never bothered to actually check this assumption. In the worst case the instrument would have to be shipped to the seller/manufacturer for repair or replacement. Also, the procedure involves operating the device with power supply exposed – please be careful!
Continue reading Hantek DSO5000 series oscilloscope modifications. Part 1 – doubling the bandwidth of DSO5102B.
Written by Oleg Mazurov  pcDuino board out of the box
At the end of February I received an e-mail from Jingfeng Liu of Linksprite informing me that they are launching a new product called pcDuino and offering a free sample. Two days ago I got a package in the mail containing the board, a WiFi dongle and a bag of cables. In ten minutes, most of them spent looking for spare keyboard and mouse, the system was up and running.
pcDuino is a mini PC platform based on 1GHz ARM Cortex A8 processor. It has 1GB of RAM, 2GB of Flash, 2 USB Host ports, 1 USB OTG port, HDMI video, Ethernet and Micro-SD slot. It comes with Ubuntu pre-installed and its graphic desktop is surprisingly responsive for such a small machine.
After an uneventful start – all you need to do is connect a keyboard, mouse and HDMI monitor – I started looking into ways to control my pcDuino remotely. Ethernet worked out of the box so physical connectivity was not really an issue. However, I haven’t found any access control tools and even root account is set up with no terminal password (and in KDE, the root password is ‘ubuntu’ – I managed to guess it at first attempt without ever looking in the doc). No remote access tool were installed either, which was actually a good thing since I needed to secure the root account first.
Even though pcDuino comes with graphic desktop, I prefer working with command line. I launched the LXTerminal application from the desktop and typed sudo su . This command switches current user to root. Now it’s time to give it a password. The command for it is passwd . It will prompt for a new password and then will ask to confirm. The root is now password protected.
Now I needed an account for myself. On Linux machines my nickname is ‘felis’ so I typed:
Continue reading Installing SSH server on pcDuino
Written by Oleg Mazurov  Bit reversal code
This is Part 3 of 3-part series of articles. Part 1 talks about ways of tweaking SPI code while Part 2 talks about hardware modifications.
After finishing hardware modifications for my three-SPI-device setup I started coding and hit a snag. Any device would happily work by its own, WiFi and SD were also happy together, however, adding NFC Shield to the mix would disable other two. If I moved NFC initialization to the beginnig, other two devices would work but NFC would not. At the same time, if a device was just present on a bus and not initialized, other two devices were not affected. It became clear that initialization itself was the source of error.
Seeedstudio NFC Shield uses NXP PN532 transmission module. This module supports several communication interfaces, namely SPI, I2C, and HSU. In SPI mode the data format is ‘LSB first’, i.e., transmission starts from bit 0. Such format is uncommon; all other SPI shields I’m aware of – Ethernet, WiFi, USB Host, etc., are using ‘MSB first’ format – the transmission starts with bit 7.
A quick look into NFC library source code revealed the following line in PN532::begin() function:
pn532_SPI.setBitOrder(LSBFIRST);
This line sets the data format. In Atmega microcontrollers the default SPI data format is ‘MSB first’ – all other SPI devices don’t have to set it during initalization. Initial revision of PN532 code ( written by Adafruit ) was using software SPI and awkward bit order was dealt with in write() and read() functions. When Seeedstudio modified the code to work with hardware SPI, they just switched SPI to ‘LSB first’ format without much thinking, breaking compatibility with the rest of the world. Surely, when I commented out this line, NFC initialization stopped breaking WiFi. Predictably, NFC also stopped working.
Luckily for me, the SPI is pretty basic protocol and bit order setting in SPI controller doesn’t mean much. It really doesn’t matter how the bit order is set; if we need ‘MSB first’ for the majority of the devices we can initialize SPI in a normal way and then modify write() and read() functions for ‘LSB first’ device to serve it reversed bytes. This is exactly what I did. Below is modified version of Seeedstudio PN532 library (also presented on a title screenshot) – lines 6 and 16 perform bit reversing:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| /************** low level SPI ********/
/*Function:Transmit a byte to PN532 through the SPI interface. */
inline void PN532::write(uint8_t _data)
{
/* bit reversing code copied vetbatim from http://graphics.stanford.edu/~seander/bithacks.html#BitReverseObvious */
_data = ((_data * 0x0802LU & 0x22110LU) | (_data * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16;
pn532_SPI.transfer(_data);
}
/*Function:Receive a byte from PN532 through the SPI interface */
inline uint8_t PN532::read(void)
{
uint8_t data_ = pn532_SPI.transfer(0);
/* bit reversing code copied vetbatim from http://graphics.stanford.edu/~seander/bithacks.html#BitReverseObvious */
data_ = ((data_ * 0x0802LU & 0x22110LU) | (data_ * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16;
return data_;
} |
After making these modifications, commenting out the ‘LSB first’ setting in the PN532:begin() and also modifying WiFi code to stay away from pin 9 (see this article for discussion) all three devices are happily working together without conflicts. The library mod for PN532 can be left there permanently – the chip will never know that it is communicating with “misconfigured” SPI host. I’m hoping Seeedstudio will fix their code eventually; in the mean time, if you have SPI compatibility issues, simply make code modifications presented in this article.
Enjoy,
Oleg.
Written by Oleg Mazurov  WiFi and NFC shield stack
This is Part 2 of 3-part series of articles. Part 1 talks about ways of tweaking SPI code while Part 3 explains how to deal with incompatible data formats.
Add-on boards AKA “shields” greatly expand the capabilities of standard Arduino platform. Typically, a shield adds a specific peripheral interface; if you need several peripherals you may need to use several shields. The biggest problem in this approach is shield compatibility. Shield developers don’t care much about interoperability and sometimes making several shields work together is difficult. In the previous article on the topic I described a project where USB Host and WiFi shields were made to share the same SPI bus. I have been recently tasked with similar project which required rather heavy hardware modifications. This article shows the necessary steps to build a system consisting of Arduino board, official WiFi Shield and Seeedstudio NFC Shield.
Here is the hardware configuration. Both shields come with stackable headers so they can be plugged into each other. Both shields use ICSP for SPI but connectors are non-stackable so at least one of the shields must have its ICSP connector replaced with the stackable variant ( I sell them). Also, both shields use pin 10 for CS so this pin needs to be re-assigned on one of the shields.
NFC shield has offset female connectors therefore if another shield is placed on top of it ICSP connector won’t mate. It means that stackable ICSP connector shall be placed on WiFi shield. At the same time, since NFC Shield does have a second row of contacts re-assigning pin 10 on this board is easy.
Before we start cutting traces and desoldering connectors, let’s establish a baseline or “a known good state”. I simply grabbed an example from NFC shield library distro called readMifareMemory , compiled, loaded and ran it. I was able to read the card and now I know that my NFC shield is functional.
One other note – both shields are assembled using lead-free solder which has higher melting point. Don’t forget to set the temperature of your soldering iron accordingly – between 700F and 750F.
Continue reading Running multiple slave devices on Arduino SPI bus – hardware modifications.
Written by Oleg Mazurov Allan Caplan sent me a write-up and pictures of putting together headers on USB Host Shield 2.0. The post can be used as an assembly guide for the shield. The following text and pictures were taken straight from Allan’s Evernote which he kindly shared with me and gave me permission to repost. I just wanted to add that after assembly is is a good idea to load and run the quality control routine to make sure the shield works.
Enjoy!
Assembling the USB Host Shield (v2.0) is pretty well straight forward, even without instructions. Some people have complained about the lack of instructions, so here goes. This guide assumes you are familiar with basic soldering techniques, and basic Arduino know-how.
1. Unpack the shield. You should see something similar to this: two 8 pin headers; two 6 pin headers; one 2X3 pin header
 Kit
2. Insert the pins. It should be explanatory where they go – along the outer rows, one side has two banks of 8 and the other has 2 banks of 6. Now, if you have a third hand this may get easy. When I do soldering like this I like to insert all the headers and turn the card upside down, like this:
 6x and 8x headers from the bottom
3. Before you start soldering, make sure the header you are working on is straight!
4. Did you check that your header is straight?
5. OK, go ahead and solder. I like to work on each header at a time, making sure it’s straight before starting. Once done, you should have something that looks like this (from the top)
 6x, 8x headers from the top
6. Time for the 2×3 header. Insert it like so. Again if you have a third hand this will be easier, if you don’t make sure your header is straight before soldering!
 2x3 header
7. That’s it! If you did things correctly you should have a functioning USB Host Shield! Go ahead and fit it on your Arduino board (make sure it’s straight, I didn’t realize mine was crooked in the picture)
 Final alignment check
8. You just soldered, clean up your workspace and go wash your hands.
9. Find the instructions for uploading software and running the QC program.
Written by Oleg Mazurov  USB Host Library Documentation
This is short but very important announcement. Kristian from TKJ Electronics started a documentation project – here is the link to the post on his blog. Kristian configured Doxygen and set up the framework to build the documentation from the source code of the library. In addition to all that, Kristian documented all the code he has contributed to the USB Host library 2.0. Results can be seen here.
Documenting a function is now as easy as adding a specially-formatted comment at the beginning of the function. In the near future, I will start adding comments to the core USB functions as well to help people understand the internals of the library. It is going to take a bit of time to document everything but even what is available now is a very good beginning – thank you, Kristian!
Written by Oleg Mazurov  The product being tested on animals
To make my growing season preparations more high tech I built a grow light with more than 25000 lumens light output while spending less than US$300. During the build I posted pictures/short notes on Makers, Hackers, Artists and Engineers Google+ community and received a lot of questions concerning LED choice, drivers, build of materials and construction details. This article is intended to answer these question and hopefully generate others – please don’t hesitate to ask!
The goal of this project was to produce a decent grow light for personal indoor gardening – mainly starting vegetables for subsequent transplanting outside some time in May and possibly extending the grow season in the autumn. While trying to determine necessary light output I realized that good numbers are impossible to find. By reading numerous indoor gardener’s forums I learned that people are having good results with light sources ranging from household-type compact fluorescent bulbs to high pressure sodium street lights. After analyzing pros and cons of all available light sources I decided to use high-power white LEDs. Here’s why:
- They are low-voltage devices therefore they are much safer to work with than HID/fluorescent light sources. Low-voltage (<60V) LED drivers are also inexpensive
- They are efficient as grow lights. Photosynthesis in plants occurs differently under different wavelengths of light; the “good” light is known as Photosynthetically active radiation (PAR). White LED emits most of its light in PAR – out of all light sources it produces most “PAR lumens” per unit of electricity used to produce these lumens. In addition, LED outputs all its light from one side therefore a light fixture doesn’t need a reflector.
- They can last long time. LED manufacturers specify 50000 hours at some pretty high emitter temperature (75-85C) – it’s 11.4 years if lights are on 12 hours a day. At the end of 500000 hours a LED maintains 70% of its light output. The main factor here is temperature of the LED – if it is kept lower than specified the LED will last longer (and produce more light, see below).
Continue reading High-power LED grow light – a build log
Written by Oleg Mazurov  Discovering Arduino Bluetooth
This is a second article about Bluetooth connectivity using USB Host library for Arduino. Previous article described Android connectivity; today, I will show how to connect an Arduino to a Windows machine using USB Host Shield ( available at the store ) and USB Bluetooth dongle.
The biggest issue with Bluetooth on a Windows machine is third-party Bluetooth stacks. They all work well but behave slightly differently and it is not possible to write a step-by-step walkthrough valid for any Windows PC. My setup is 64-bit Windows 7 with Broadcomm Bluetooth stack; other Windows versions and Bluetooth stacks will be slightly different.If you have any difficulties following the text, leave a comment and I’ll try to help. Also, Bluetooth protocols time out very quickly – 5-10 minutes, sometimes less. If you get a timeout at any step simply start over again; sometimes, resetting Arduino may be necessary.
First thing that needs to be done is to make a working Arduino setup. Previous article on the topic gives plenty of information about necessary gear, compatible Bluetooth dongles and expected terminal output. Once this is done, install Bluetooth on Windows. On Win7, the installation consists of plugging in a Bluetooth dongle to USB port and watching the progress of installation process which will start automatically. At the end of the installation system will give you the warning that your PC is not discoverable – ignore it. If installation is successful a Bluetooth icon will appear in the system tray.
The next step is to pair Arduino to a PC. At this point, an Arduino-USB Host Shield-Bluetooth dongle combo shall be put together as described earlier, tested, and set up as follows:
- Powered from external supply – optional but highly recommended, at least for the first attempt. If you decide to use external supply, connect it before USB cable
- Connected to a PC with USB cable. It could be the same PC to which you are going to pair your Arduino via Bluetooth
- Terminal to Arduino opened. It can be Serial Monitor in Arduino IDE or third-party terminal program such as Putty or Teraterm. If everything is wired correctly and Bluetooth dongle is good you should see the following output in the terminal window:
Continue reading Using USB Bluetooth dongle on Arduino to connect to Windows PC
Written by Oleg Mazurov While making some measurements today I noticed a strange reflection in the signal generated by my Tektronix 7S12 TDR sampling plugin. At first, it looked like a bad connection at the output of the loop-through S-6 sampling head, however, after further testing it turned out to be more serious flaw. The following two screenshots show the reflection: the left one shows the step into terminated S-6 and the right one shows the same step with terminator removed to give me the reference for the distance. Apparently, the reflection occurs inside the head itself!
 Reflection with upper connector terminated by 50 ohms
|
 Reflection with termination removed
|
 S-6 sampling head disassembled
I pulled the head out and took it apart. It was rather easy – after removing 3 screws on the back the head internals slide forward from the case. The picture on the right shows the guts of the sampling head with preamplifier board removed. The square metal box next to the faceplate with two SMA females sticking out of the back is a hybrid sampling bridge and according to the distance to the reflection this is the place where I need to look.
Further disassemby is easy. First, 3 socket head screws need to be removed along with the board they are holding. After this is done, both male SMA connectors need to be unscrewed. Lastly, after unscrewing two nuts on the faceplate the bridge can be freed from all obstacles and taken apart.
 S-6 sampling bridge
Luckily, taking the hybrid apart was not necessary this time. I discovered that one of SMA connectors (upper left on the picture) came loose so I simply tightened it up, assembled the head, placed it back into 7S12 and observed a nice step with good corners and no extra reflections. The whole project took less than an hour, most of the time spent taking pictures.
I’m a happy time-domain reflectormetrist again, writing this article hoping it will be helpful for someone. Next time your sampling head starts acting funny don’t run to eBay for the new one (and I checked – they are out of S-6 at the moment). Take it apart and look inside – you may be able to fix it, even though in my case it was more by luck than judgement.
 Correct step waveform
|
|