Saturday, March 28, 2020

COVID-19 data -3-


Update

The filenames of Novel Coronavirus (COVID-19) Cases, provided by JHU CSSE on Github ( https://github.com/CSSEGISandData/COVID-19 ) as posted in my first blog post are changed. The csv files (on 28 March 2020) are:

https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv

https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv

https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_recovered_global.csv

Therefore i needed to adapt my Google spreadsheet.
As now also data from oversea parts of The Netherlands ( Aruba, Curacao, Sint Maarten) are in the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE) overview became available i also needed to do some additional updates.

Tuesday, March 17, 2020

Keyboard with Leds for Arduino



4X4 Matrix Keyboard For Arduino Array Module 16 Key Push Buttons Tastatur Switch Keypad Panel 4*4 Tasten 8LEDs Accessory DIY Kit
This module is advertised for Arduino, however i had plans to use it for FPGA experiments.
Just when i did think i needed to build something like this on a board as there could be a big delay in delivery due to the current situation in the world i received it this AliExpress item in my mailbag.
Small where where included, i just needed to screw them in position.




I did nit yet test it, however it seems an interesting small and cheap module to add some buttons and led's to projects or for development.

  • 16 keys in a 4*4 matrix
  • 4 keys connected to ground and with 1k resistors to VCC
  • 8 leds with 1k resistors and connected to VCC



KEY_A

KEY_B
(Photos taken with my phone, Schematic diagrams / circuits copied from AliExpress)
LED

Saturday, March 14, 2020

FPGA First steps -4- Cyclone IV (photos)

Some more photo's  of my Cyclone IV FPGA board.


Thursday, March 12, 2020

FPGA First steps -3- / Cyclone IV

Update about my FPGA adventures.
I also received my second FPGA experimenting board with a Cyclone IV
The Cyclone II board is a nice development board with a lot of IO pins. To do real experimenting and leaning how to use FPGAs you need to add some additional hardware as the button and led on the board. I did this using a breadboard, some Dupont wires leds resistors and buttons. I also have plans to make a pcbs with some hardware for this board.
The Cyclon IV board has more on board IO. (Displays, buttons, leds, buzzer, dip-switches, video a ps2 keyboard and several pins. Below a photo of my Cyclone IV board in action,
On the left is the USB blaster connected to the board for programming. It is possible to power the FPGA board using the power connector on the topleft. (On the photo below the USB cable of the USB Blaster. I used the alternative method with an USB cable (connector above the 7 segment display).
The software worked when i selected Cyclone IV GX and EP4CE6E22. Also i include a video from my YouTube channel. You see a 4 digit counter. After a few seconds i loaded a new FPGA program / configuration file using the USB Blaster. (the demo program led_test.sof )


Wednesday, March 11, 2020

FPGA First steps -2- (General procedure & Resetting the screen)

As mentioned in my previous blog post i started experimenting with a Cyclone ii FPGA. There are several steps involved. It can look complicated. Therefore before diving into details i will explain the big picture in this blogpost.

  •  Install the software
  •  Create the FPGA logic
  •  Connect inputs and outputs to physical ports (Pin Planner)
  •  Compiling the created logic
  •  Upload the project to the FPGA  (Program) 
  •  Test the project in the FPGA

Install Software:
To use my Cyclone ii FPGA
i installed Quartus ii  version 13.1 software on my computer (Windows 10)
and the USB blaster software
Quartus is a big program so downloading and installing will take a long time. It is more a interface connecting different parts for managing the FPGA. As it are different modules sometimes saving before switching to another module is needed.

Create the FPGA logic
To create the FPGA logic there are several options in the Quartus ii package e.g.
Graphical interface
VHDL
Verilog
As the graphical interface looks intuitive and i found a YouTube instruction about it. Therefore i started my first experiments with this.

Connect inputs and outputs to physical ports (Pin Planner)
To connect the logical inputs and outputs a part in Quartus named Pin Planner can be used.
Before this can be done the logical inputs and outputs needs to be present. These logical ports can be created easy by compiling the design. This first compilation will not output something that will work as at that moment the physical outputs are not included in the compilation.
However it will prepare the logical ports for the Pin Planner. In the Pin Planner these ports can be manual assigned to to physical ports.
After the assignment of the physical ports another compilation needs to be done to include information about the physical ports.

Compiling the created logic
Compiling is relative simple and can be started different ways:
Using the menu 
Processing - Start Compilation
Ctrl+L
The button with a triangle
The compilation can give Errors when the compilation was not successful. Otherwise there can (and will) be Warnings. 

Upload the project to the FPGA  (Program) 
To upload the result to the FPGA ("Programming") there are two options
Store it temporary 
Store it permanent
When storing it permanent it can be overwritten later by storing something else. The difference is that the settings are erased after powering the system down when storing it temporary. 

Test the project in the FPGA
Details how to test depends on the created logic.
It is also possible to test the created FPGA logic before uploading using a simulator.
This simulator requires some configuration.

Help
An important file with links to the software Handbook and other resources is can be found in Quartus ii under
  Help
     Readme File

During testing it you can easy change the displayed screen in Quartus II
It is possible to reset the windows to the setting during installation without repeating the installation process.
See https://www.intel.com/content/www/us/en/programmable/support/support-resources/knowledge-base/solutions/rd07092001_1535.html for two options to do this:

Using a menu option in the Quartus II Graphical User Interface (GUI):
Choose Tools and then select Toolbars.
Click the Toolbars tab.
Click Reset All.
Click OK.

Using a Windows Command (DOS) Prompt:
Close the Quartus II software.
Open a Windows command prompt or DOS window (Start -> Programs -> Command Prompt).
At a command prompt, change directory (using the cd command) to the Quartus installation directory/bin.
Type the following: quartus -reset_desktop

During my experiments/testing/learning i needed to use the second option (using the Windows Command prompt as i did not find another way to get the screen back in a reasonable status.

Tuesday, March 10, 2020

COVID-19 data -2-

After my first post about COVID-19 data i did find another interesting data source
Nextstrain is an open-source project to harness the scientific and public health potential of pathogen genome data. They provide a continually-updated view of publicly available data alongside powerful analytic and visualization tools for use by the community. Their goal is to aid epidemiological understanding and improve outbreak response.

It contains interesting graphs about COVID-19 and the different genomes found in the samples. This nCoV data was generously shared to Nexstrain via GISAID.  From the data on GISAID nCoV genomes are not included as part of that repo as many of them are protected by the terms of GISAID sharing. Also due to some sharing agreements not everything is made public.
As i only see a limited number of cases not all the data about all cases is available. I don't know if this is due to the time needed for analysis or perhaps not in all cases genome data will be analysed and/or shared. However in the Nexstrain github page https://github.com/nextstrain/ncov you can find interesting data to use in your own graphs. Also an api for the data and json seem to be available on the Nextstrain website.
The data can be imported in your spreadsheet using =IMPORTDATA(<url>) as mentioned in my first post about COVID-19 data.

Constant current load

In my electronic toolbox i did not yet have a nice constant current load.
(Almost) finished constant current load in my enclosure.
This simple device that can be used to check power supplies was a long time missing for my electronic experiments and projects. When i needed a (dummy) power load for testing or development i used a 12V car lamp or some high current resistors. I did also buy a simple very cheap USB discharge device with two resistors on Aliexpress. A constant current load was for a long time on my wish list. When i did see the video https://www.youtube.com/watch?v=D5SsvbCBD6o on the YouTube channel of learnelectonics i was impressed by the small relative cheap constant current load module with a color display. According to the video description the manufacturer is TKXEC and the model is WEL3005.
I did order one and even in this period with Chinese new year and other things that could cause delays did receive it relative fast. The price without enclosure is below 20 euro's. As i already had an enclosure that i could use i did not order it. 

Items needed

Items is used for this project:

  • Constant current load module (see below)
  • Enclosure
  • Power supply for the module (
    • I used an 9 volt battery,
    •  with a switch and a battery holder clip snap on connector to connect the 9 volt battery 
    • and a tie-wrap to fixate the battery in the enclosure )
  • Binding posts / Banana clips female
  • Some wires
You can find a photo of the (almost) finished constant current load in my enclosure in the beginning of this blog post.

I tested the device with another 9 volt battery. (So i needed 2 x 9 volt batteries with battery holder clip snap on connectors). See result at end of this post.

Also some simple tools are needed to make this project. (Screwdriver, something to make fitting holes in the enclose [dremel] and a soldering iron if you want or need to solder the connections)

The module description

(Text and photos from AliExpress)

1, can display voltage, current, power, ampere-hour, watt-hour, discharge time, internal resistance, temperature
2, can set the discharge current, constant current discharge
3, discharge safety, discharge time automatic statistics
4, can be suspended, can accumulate discharge data
5, fan intelligent temperature control, more than 45 degrees fan start
6, a variety of protection mechanisms, anti-reverse protection, over-current protection, under-voltage protection, over-power protection, over-heat protection

Product parameters:

Supply voltage: 6V-30V
Measuring voltage: 0-30V
Discharge current: 0A-5A continuously adjustable
Discharge power: up to 30W (Note: Do not use super power!!)
Working temperature: -10~+75 degrees
Resolution: voltage 0.01V, current 0.001A
Accuracy: voltage 1% ± 1 word, current 1% ± 1 word
Undervoltage protection: Yes (1.5-30V)
Over power protection: Yes (1-30W)
Overheat protection: Yes (more than 45 degrees fan start, overheat protection is 75 degrees)
Input anti-reverse: Yes
Wiring method: small screen printing B+B- for measuring voltage, large screen printing B+B- for measuring current
Fan: 4010 double roller fan, speed 8000
Module size: length 79mm width 43mm height 70mm
Opening size: length 76mm width 39mm
Weight: 95g

LOCK: Under non-discharge, press the LOCK button to measure the internal resistance of the battery and automatically disconnect for three seconds. Measuring internal resistance (please use four-terminal wiring method)

Setting instructions:
P1: Press the P1 key to switch to the interface shown below: (Note: long press the P1 key to clear the test data, short press the code switch to pause)

P2: Press the P2 button to switch to the interface shown below:
SET: Press the SET button to switch to the interface shown below: After entering the SET menu interface, rotate the "Encoding Switch" to adjust the data, and then "Code Switch" to switch the coarse adjustment and fine adjustment data, and then connect the SET button again. Menu items can be switched.












Result

As mentioned in the "learnelectronics" video and some comments about the product a strange thing is that you need to remove the fan (and also pull out the top pcb) to connect the wires using a screwdriver.
I did fit the module in a small (metal) enclosure. On the front panel i added two female banana plugs for the load and an on of switch for switching the power to the module on or off. The power supply needed is 6-30V. I powered it using a 9 volt battery and it seems to work oke. 
Unfortunate the required current for powering the device is not mentioned. I also did not measured the power consumption myself (with and without the fan running and with different voltage inputs. 
When power connectors i ordered in China come i want to add these power connectors on the backside of the box. This way i can use another power supply than the 9 volt battery that i placed temporary in the box.  
I tested it using a second 9 volt battery and after some experimenting it worked well when setting the current below 0.900 A and the voltage limit at 1.5 Volt. I higher current will try to drain the battery fast and turns the load off after a few seconds as the voltage will drop rapidly. After the module has switched off the load you can see the battery voltage rise again.
When i revered the polarity of the 9 volt battery  that i was testing the display the display showed an input voltage above 30 volts.  This is as the module has an anti-reverse protection to protected against this connection of the load with switched polarity.

Monday, March 9, 2020

SDR# Radio on Windows 10

Recently i installed SDR# Radio software on my Windows 10 computer.

What is SDR?

Software-defined radio (SDR) is a radio communication system where components that have been traditionally implemented in hardware (e.g. mixers, filters, amplifiers, modulators/demodulators, detectors, etc.) are instead implemented by means of software on a personal computer or embedded system.
While the concept of SDR is not new, the rapidly evolving capabilities of digital electronics render  practical many processes which were once only theoretically possible.

What is needed for SDR?

To use SDR you need 3 things

1) SDR Dongle
I have an RT820T dongle  ( DVB-T+DAB+FM  USB2.0 dongle ) Most documentation i found is not about the RT820T but about the R820T dongle, however my dongle worked fine.

2) Antenna
With the SDR dongels most times comes a small antenna. This will work fine for the first experiments and testing the SDR dongle.
However the SDR can process frequencies in a broad frequency range. For good reception the antenna needs to be matched to the frequency.
The antenna that came with my dongele works resonable in the FM range but can not replace a real good antenna suitable for a specific frequency, frequency range.     
 The optimal antenna will depend on the frequency and project you are interested in.

3) A computer (with audio sound output and USB input) running the SDR Software.
With the dongle came a cd with software to receive some audio and TV signals.
A quick investigation on internet shows that it is not advised to install this software as it will interferes with SDR# software.
I installed the SDR# ( SDRSharp ) software and it worked fine. However i epect with a better antenna, or a better location for my antenna a lit can be improved.

Advantages of SDR over traditional radio?

A lot of the receiver is replaced by software. This makes that it can be used over a very wide frequency range and also use  different modulation modes (FM , AM , SSB and TV) by software settings.
As limited hardware is needed it is relative cheap. A simple SDR USB dongle can be bought for around 20 euro. There are more expensive and advanced devices available however a cheap dongle will be sufficient to do a lot of experiments. For advanced experiments perhaps better use a part of your budget for your antenna.
SDR can be used to check radio frequencies e.g. 433MHz radio remote controls for switching lamps, garage doors, car, WiFi and more.
It seems SDR data can also be shared over the (local) network. There us also software that can be installed on Android or on a Raspberry Pi.

Installing SDR#

Installing SDR# ( SDRSharp) is not extreme difficult. However it is (currently) not just plug and play.
Installing the (limited) software that comes with the dongle even makes it more difficult to full use the dongle with a program like SDR#
Therefore i decided to post this summary how to install SDR# on Windows 10 on my blog.

Steps involved are
- Download and extract the software.
- Run some installation scripts (also to install the USB driver).
- Then test and start using SDR#.

The complete installation instructions can be found on
https://www.rtl-sdr.com/rtl-sdr-quick-start-guide/

Go to www.airspy.com and find the downloads button on the top menu.
Next to the "SDR Software Package" heading click on the download button to download sdrsharp-x86.zip.
Extract (unzip) sdrsharp-x86.zip to a folder on your PC. (Important! Many people who have issues forget this step! Do not run the files from within the zip file or the following steps will fail). (Also, do not extract into a folder within the Program Files directory, or installation may fail as these folders are often automatically made read only by Windows).

Run install-rtlsdr.bat

Plug in the dongle. (Do not install any of the software that it came with !! )

In the folder where you extracted the sdrsharp files find the file called zadig.exe.
Right click this file and select "Run as administrator".
The program Zadig to add your USB device starts.

In Zadig, go to "Options->List All Devices" and make sure this option is checked. If you are using Windows 10, in some cases you may need to also uncheck "Ignore Hubs or Composite Parents".
Select "Bulk-In, Interface (Interface 0)" from the drop down list.

To install the WinUSB driver, ensure that WinUSB is selected
Click Replace Driver

Open SDRSharp.exe and set the "Source" drop down box to 'RTL-SDR (USB)'. This "Source" tab is on the top left.

Press the Play button (the right facing triangle). Your RTL-SDR software radio should now be set up and ready to use! If everything has worked you should be able to start tuning to frequencies.

Two important FAQ i copied also to this blog post as i never know how log the original resources will stay available:

Remote control
Some sellers opt to include the remote control that is used for changing TV channels. It is only useful for when the dongle is used for its original purpose - as a DVB-T HDTV receiver. The remote control has no purpose when the dongle is used as an SDR.
(I did not check/test if the remote sends radio or IR signals.)

DVB-T TV
The original purpose of the dongle was for DVB-T TV, and it can still do this. But please note that the DVB-T drivers and the SDR drivers are different, and they cannot both be installed at the same time. You can download the DVB-T drivers here. It is recommend using Prog-DVB as the TV software. 
(For me this was a little disappointment. I did not tested DVB-T on this Windows 10 system yet.)

User guide

As many things can be (wrong) configured using SDR radio read
https://www.rtl-sdr.com/sdrsharp-users-guide/  to make full use of the device.
Also on YouTube instructional videos can be found.

Conclusion

For me using SDR# in the FM band worked with the included antenna after running install-rtlsdr.bat and Zadig. To find radio stations or scan a frequency range some fine-tuning of the RF gain was needed.
As already mentioned in some articles found on he internet VHF antennas like the provide antenna do not pick up HF signals very well.
It would be interesting to experiment also with some other antenna's.

The post on https://oneguyoneblog.com/2016/09/15/sdrsharp-sdr-installing-windows-10/ helped me a lot!

Friday, March 6, 2020

Shopping trolley lock

I always wondered how these gatekeeper shopping trolley locks work.
After watching Dave Jones EEVblog #1287 i decided to post some photo's of the trolley lock system of a shop in The Netherlands, Almere.
The lock mechanism in Dave's video is inside one wheel. The system in this shop uses a red block mounted near a wheel.

The range for the trolley is indicated by a red line on the street.
It is amazing to see how far a way is the limit for a trolley this relative small shop.
According to Dave's video there should be a wire with an active signal at this red line.

Some years ago i had a trolley with a locked wheel and a shop employee unlocked it. Recently i noticed this device and also include
a photo of it.

It contains a link to interesting the website https://rocateq.com/ of the company Rocateq who makes  this device.
I also did some searches on internet and found a user manual
https://fccid.io/2AGTS-MRU/User-Manual/User-Manual-2850312 a download page of the company
http://www.rocatequsa.com/rocatequsa/Rocateq_USA__Useful_Downloads/Rocateq_USA__Useful_Downloads.html
with several interesting documents.
and YouTube is this video of the company
https://www.youtube.com/watch?v=ZRIqaB1ooF8

In the documentation two frequencies are mentioned
Frequency for locking & unlocking is 8.13KHz.
Frequency for mute is 318.06MHz











Monday, March 2, 2020

Car 12V interface

As (most) electronic projects need some power source i decided to create some tools for projects regarding power.
A long time ago i made a lab regulated power supply using a B3603 power and current regulator having a plus and minus banana-plug outlets. I also made some cables and connectors.
Recently i 'hacked' a car cigarette lighter socket containing 3 car power sockets and two USB connectors. I just cut the connection cable between the socket and the plug.


To the cables of the plug i added crocodile clips so i can use it to power projects from a car cigarette socket.



To the cigarette lighter socket cables i added banana clips. I also added a small box with a small DC voltage meter and female banana plug sockets. I can put the banana plugs in a 12 volt source. Check the voltage and use it on the sockets, the cigarette sockets or the USB power connector.
The reason that i added a small cheap voltmeter is that i not only want to use my lab power supply as voltage input. I also want to test batteries and other power sources perhaps with buck/boost convertors.