I am a beginner at using Arduino. I tried a glucometer to communicate with Arduino Uno.
Pls read the following aspects to understand my project:
This is the model of glucometer that I used: VivaChek ino (Ino Blood Glucose Meter | VivaChek Biotech). This glucometer has a micro USB port. This device can store 900 readings, with time and date. Later, these stored data can be imported by a PC-software, "SiDiary" (VivaChek Ino (En) - sidiary.org). We need to connect the device using "any" micro USB cable with a PC. Then, in the software (SiDiary), we need to select the model of the glucometer. Here, it is VivaChek ino.Then, we need to click "import".Then those glucometer readings stored in the device will appear in a textbox with the date and time.
Now, what I did is, I have taken a micro USB cable and cut it at the center of the cable. So, I got following by cutting.
One part, with normal USB head(usually we connect it to PC USB port) .
Second piece was with micro USB-Head(The part, we should insert into the glucometer).
I selected second piece(The part with Micro USB-head) and threw away the 1st piece.
There were 4 separate wires(Tx,Rx,GND,VCC) inside the one terminal of the cable(cutting end). Another end was with Micro USB -Head.
So, I connected the micro USB-head of the cable to the micro USB port of the Glucometer. On the other side, I connected those separate wires to the Rx, Tx,VCC,GND pins of Arduino Uno, respectively. Then I tried coding with the aid of SoftwareSerial library and tried to read the data stored in the glucometer. But nothing appeared in my serial monitor of Arduino IDE.
Now, my questions are,
Would I be able to read the stored readings of glucometer using Arduino board, finally?
Can I get a sample code for this project?
Sorry for the inconvenience in advance. I am in the beginner stage. Your suggestions will be highly appreciated. Thank you.
USB does not use Serial/UART protocol inside. The physical layer is completely different. USB uses a differential signal. The bits are sent in serial order, but the bits are encoded as voltage difference between two wires. Additionally, there is a protocol stack which sends a lot of additional information.
You would need to use a board that has USB Host support. As a beginner, I am afraid you currently likely do not have the skills to implement this.
I would recommend you start with a simpler project e.g., work through the examples. Build up your skills and then start more complex projects.
Dear Klaus,
Thank you very much. I am beginner, but little advance. I have done few arduino projects and familiar with SPI, I2C and analog communications. USB, TTL are new to me. So, kindly give the instructions, how to use USB host shield to communicate with glucometer.
Thanks in advance
First try to figure out how the USB device works with your PC before you by a USB HOST shield. There are a few USB standard devices specified. e.g., the Arduino create a virtual COM port.
If it does not, it will be difficult to figure out how the glucometer communicates with the PC software. USB is very flexible and not many developers work with USB Host (This is usually your PC). Even USB device (e.g., keyboards, flash drives ...) is not used very often by makers.
If the glucometer creates a virtual COM port, I would try to reverse engineer the protocol on a PC first. You could also use a Raspberry Pi.
End goal is reading the data from glucometer and uploading it to cloud. If possible, no problem at using rasperry pi.
And as I said in very first description,
in order to import data from glucometer to the software(SiDiary) provided with vivaChek ino - glucometer , I have installed PL2303 driver on my windows PC.
Then only that PC software (Sidiary) communicated with glucometer and imported data.
Maybe you are lucky. It looks like they use a virtual COM port. I would first try the two following things first.
Connect a serial terminal to the virtual COM port of the glucometer and see whether the device sends out data when you interact with it. Some devices like GPS do that. They continuously send serial data.
Connect an Arduino to your PC and connect the PC software to the COM port of your Arduino. See what serial data (e.g., instructions) the software sends to your Arduino. You will need to have a second interface e.g., LCD display to show you the serial data.
You can try a COM port sniffer. I have not used one myself. I cannot tell you which ones are safe to use.
Dear Klaus,
I created two virtual COM ports using "Virtual Serial Port Driver" from one original& physical COM.Then I accessed the software(SiDiary) of the glucometer from the PC.
For this software(SiDiary) ,I assigned one of these virtual ports and I assigned another ( 2nd) virtual port to Terminal V1.9b to sniff the communication.
After this, I clicked the "Import" button on the Glucometer-software(SiDiary).Then only, Terminal V1.9b started showing the communication.
When I tried to read the communication in ASCII, Terminal V1.9b showed some unknown box symbols.However, Terminal V1.9b showed transmitted data packets in HEX.I have attached the photos below.
From these information, can I use arduino to read the correct glucometer readings, stored in the glucometer? If so, kindly help me in Arduino programming.Thank you.
Not that easy, but you can use this information to implement your software on a PC or Raspberry Pi.
The issue is, your Windows currently hides all the USB complexity from you. You would first need to figure out how to get a virtual COM over USB on an Arduino with USB Host support. I suspect this will be a lot easier on a Raspberry Pi because USB Host support is part of Linux. Try to find out whether you need a driver for the Raspberry Pi or whether you just need to connect your glucometer.
In parallel you can work on decoding the communication between the PC software and the glucometer. This will take some detective work. Capture a couple of communications and make note what the PC software was doing at the time. Then match the information starting with data that seem obvious to you e.g., maybe dates and glucose values. Start with a long trace to get an overview, whether some patterns emerge and then use small traces to figure out each byte that is transmitted. Look at both ASCII and HEX. Get an ASCII table to get the HEX values for CR and New Line. They are often used with prints. The meter and software may also send other non ASCII values.
When you think you found some pattern, send the bytes to the glucometer and see whether it sends you the right information back.
If you then still want to use an Arduino and only then investigate USB Host support for Arduino. I think using a Raspberry Pi to send the data to the cloud will be the right solution. It will give you the best chance of success.