Monday, December 23, 2019

ATTiny85 RGB led

An RGB Led with DuPont connectors from a previous post was tested with the attiny85 with Dupont female wires. the wire without resistor was connected to ground and the other led pins with the resistors to P0, P1 and P2.
As program i used the Example DigisparkRGB program. ( Examples \  DigisparkRGB \ DigisparkRGB  ).

#include <DigisparkRGB.h>
/*
 Digispark RGB

 This example shows how to use soft PWM to fade 3 colors.
 Note: This is only necessary for PB2 (pin 2) - Blue, as Red (pin 0) and Green (pin 1) as well as pin 4 support the standard Arduino analogWrite() function.

 This example code is in the public domain.
 */
byte RED = 0;
byte BLUE = 2;
byte GREEN = 1;
byte COLORS[] = {RED, BLUE, GREEN};

// the setup routine runs once when you press reset:
void setup()  {
  DigisparkRGBBegin();
}


void loop ()
{
//direction: up = true, down = false
boolean dir = true;
int i = 0;

while(1)
{
fade(COLORS[i%3], dir);
i++;
dir = !dir;
}
}
void fade(byte Led, boolean dir)
{
int i;

//if fading up
if (dir)
{
for (i = 0; i < 256; i++)
{
DigisparkRGB(Led, i);
DigisparkRGBDelay(25);//1);
}
}
else
{
for (i = 255; i >= 0; i--)
{
DigisparkRGB(Led, i);
DigisparkRGBDelay(25);//1);
}
}
}


A video of the result was posted on my YouTube channel :
(At that time this blogpost was not yet ready for publishing.)

As i was not very happy with the recorded colors, i tried to improve it by putting a white paper below the led. However the improvement was only minor and the real colors are different. I hope the video will at least give a little impression of the changing colors.
As all the colors are faded in the program i did not specially select the led color pins to be matched to the colors in the program (  RED = 0;  BLUE = 2;  GREEN = 1; )


Sunday, December 15, 2019

SMD Leds breadboard friendly -2-

Mailbag
August 2019 i published how to make SMD leds breadboard friendly with Dupont connectors.  https://blog.jeronimus.net/2019/08/smd-led-breadboard-friendly.html

Another option to make SMD components more breadboard friendly is to using a PCB. I found some SMD PCBs on Aliexpress and ordered 3 lots with 10 PCBs. (30 PCBs in total)
The PCBs arrived some days later in my mail in a small envelope. See "Mailbag" picture on the right. They match DIP 8 format and you need to break them apart yourself.
Besides for DIP 8 IC's these PCBs can also be used for other SMD components.
For a test I soldered some different SMD leds on them. To solder the Dupont pins to the PCB i used a small breadboard to temporary fix the Dupont pins at the right positions.


Business Card PLUS (#003)

In this post a detail views of my this first version of my PCB business card. One side is more the business card side with contact information.
Also two rulers are in included. One on the bottom with cm divided in mm.
The division on the right can be used for counting PCB pins.
Text on the PCB is aligned with the holes in the PCB. (E.g. the o in Jeronimus. However in linkedin i needed to put the hole over the e.



The other side of the PCB is for the electronic circuits that can be build. It is more a development type board than one circuit and can also be used as a breakout board. So not all items need to be placed on the board. For several components the SMD or thru hole version can be used by placing the SMD pads between the holes for the thru hole version. The PCB can be used as an Arduino Uno shield / Arduino breakout board. In the white rectangulars long dupont pin holders can be placed. The two Arduino pin holders are not at "Dupont" distances. The good thing about this is that this prevents some mistakes when connection a shield. The disadvantage is that it is not easy to connect cheap prototype pcbs like the {} 5cm*7cm pcb.
By adding female pin holders vertical on the two columns where the small white line at the top this PCB can connect an Arduino pins to the 5cm*7cm PCB. Also on the top two blocks for 2*4 connectors are marked ESP01.
The right one is for "normal use" and the left one can be used to program an ESP01. The ESP01 can be used without an Arduino. An connector for an CR2035 can be used as power source, LA0 and LA2 are locations for 2 leds (SMD or thrue hole) with corresponing resistors ( PL0 and PL2),

On the bottom are three metal pads. 5V , 3V3 and GND for crocodile clips. Above the GND pad is a an SMD IC 8 SOP can be soldered. ( e.g. 555 or memory chip.)the pins of this SOP8 are only connected to the nearby holes. On the right side are holes for two push buttons.C1 and C2 are locations the corresponding capacitors. Between the two buttons is a location for a jumper (or wore bridge) to program ESP01 1  (top right). In up coming blog posts more details will follow.





Friday, December 13, 2019

Business Card PLUS (#002)

PCB Business Cards
Yesterday I posted a short quick message on my blog to show my Business Card PLUS have arrived.
I decided that my (classic) Business Card needed an update. I still have several of this paper business cards. As the information on them is still up to date i don't like to throw them away as waste. So will still use them but, if i become more happy with the Printed Circuit Board  - Business Cards i expect not to order new paper cards. I wanted a business card that can be used.
The price of manufacturing this PCBs in China is low. To get PCBs in low quantities relative cheap best stay under the size of 100 mm * 100 mm and the minimum order is 5 pieces. By "panelizing" the PCB you can even get more PCBs. I don't like to throw away unused PCB's. Perhaps if i need a PCB for future project perhaps i will design them so the PCB can also be used as a business card.
However a few weeks ago i started designing a (test) PCB especially to be used as a business card.
'classic' Business Card
Panelizeing the PCBs gave multiple PCBs with a break line for easy separation. As the manufacturer needs to add some text to your PCB to identify the order between all other orders i a added borders and asked the manufactured to place there ID on the boarder. I even changed the size of the PCBs a little from the standard size. This way two PCB/Business cards can be placed on one 100*100 mm PCB. As the minimum order is 5 (< 100*100 mm) PCB you will get after separating them 10 cards. ( In fact 10 panelized PCBs where ordered ,so i now have have 20 new business cards / PCBs that can be used different ways.
The disadvantage of my new card is that it is not possible to write something on the back.As i also have plans to add RFID with a sticker (also usable with classic paper business card) this can change).
To quick start, this first PCBs contain no QR. code. However i did add a ruler to the design.
The PCB can be used for electronic circuits in different ways. On my blog i will post some examples with test results and hope it will work in this first batch of PCBs. If not i can still use this batch as 'regular' business cards. If you get one of my PCB business cards and want to dispose it, consider giving it to someone else who perhaps can use it.
Also i would be happy to know how my PCB business cards are used (or only the [complex] PCB). Comments on this blog, mail, about this topic is welcome. I will share the Gerber files so you can (adapt and) order your own PCB if you don't get one from me. New blog post about this PCB will be published soon.


Thursday, December 12, 2019

Business Card PLUS (#001)


Quick update :
"My Business Card PLUS - Printed Circuit Boards " arrived from China.
Not only some different (example/demo) circuits that can be made with my Business Card need to be tested (and published).
I am now testing these cards and also did give away some. Test how the PCB with text will degrade after some time also seems important.
More details about this PCB follow.

Tuesday, August 20, 2019

ATTiny85 Mouse

The ATTiny85 can not only act as a keyboard, it can also act as a mouse.
Extreme caution if you use this as the program does not only mouse movements, it also clicks!
( Examples \ DigisparkMouse \ Mouse )

// DigiMouse test and usage documentation
// CAUTION!!!! This does click things!!!!!!!!
// Originally created by Sean Murphy (duckythescientist)

#include <DigiMouse.h>

void setup() {
  DigiMouse.begin(); //start or reenumerate USB - BREAKING CHANGE from old versions that didn't require this
}

void loop() {
  // If not using plentiful DigiMouse.delay(), make sure to call
  // DigiMouse.update() at least every 50ms

  // move across the screen
  // these are signed chars
  DigiMouse.moveY(10); //down 10
  DigiMouse.delay(500);
  DigiMouse.moveX(20); //right 20
  DigiMouse.delay(500);
  DigiMouse.scroll(5);
  DigiMouse.delay(500);

  // or DigiMouse.move(X, Y, scroll) works

  // three buttons are the three LSBs of an unsigned char
  DigiMouse.setButtons(1<<0); //left click
  DigiMouse.delay(500);
  DigiMouse.setButtons(0); //unclick all
  DigiMouse.delay(500);

  //or you can use these functions to click
  DigiMouse.rightClick();
  DigiMouse.delay(500);
  DigiMouse.leftClick();
  DigiMouse.delay(500);
  DigiMouse.middleClick();
  DigiMouse.delay(500);

  //for compatability with other libraries you can also use DigiMouse.move(X, Y, scroll, buttons)
}

I have tested this script on with my digispark and it worked. The movements are relative to the current position. I did not dare to experiment and move it to bottom left on a windows computer and use Microsoft start to start programs.

Monday, August 19, 2019

ATTiny85 Keyboard

One of the scripts that works on my attiny85 is a keyboard emulator.
All is done  with the next simple script that was available as a sample script in the library;
(   File \ Examples \ DigisparkKeyboard \  Keyboard )

#include "DigiKeyboard.h"

void setup() {
  // don't need to set anything up to use DigiKeyboard
}

void loop() {
  // this is generally not necessary but with some older systems it seems to
  // prevent missing the first character after a delay:
  DigiKeyboard.sendKeyStroke(0);

  // Type out this string letter by letter on the computer (assumes US-style
  // keyboard)
  DigiKeyboard.println("Hello Digispark!");

  // It's better to use DigiKeyboard.delay() over the regular Arduino delay()
  // if doing keyboard stuff because it keeps talking to the computer to make
  // sure the computer knows the keyboard is alive and connected
  DigiKeyboard.delay(5000);
}


After uploading the script the program starts so watch out where to put the cursor when uploading the script.
The Digispark USB reacts if it is a keyboard where the  "Hello Digispark!" is typed over and over again (with a delay  5000 ).

Hello Digispark!
Hello Digispark!
Hello Digispark!
Hello Digispark!

An application could be reading some sensor data on the attiny85 and outputting it e.g. in a spreadsheet.

Saturday, August 17, 2019

ATTiny85 USB module prepared for experiments

Recently received some ATTiny85 USB (Digispark Digistump) boards from Aliexpress.
I already experimented earlier with these small boards with chip that can be programmed easy by putting it in the USB connector of your computer.
These boards come (standard) with Dupont connectors (male or female) that you can solder on these small boards to conello Digispark!
nect it easy in experiments. I wanted a not connecting each time Dupont wires, a little bit more protection for the USB module more distance from my computer,.
To prepare a module i cut some wires with female Dupont connectors and soldered this directly to the module. (To prevent shortcuts i used female not the male).
With transparent heat shrink i added some protection for the board.

ATTiny PINs

On the side (bottom of the picture) are three connections (starting from USB)
5V(Color of my wire: )  Red
GND      (Color of my wire: ) Black
Vin(Color of my wire: ) Brown
Opposite to the USB connector are 6 holes
Digital-AnalogPWMI2CPSIColor
of my
 wire
P0(LED on
 model B)
ArefPWM0SDAMQSIWhite
P1(LED on
 model A)

PWM1
MISOViolet
P2
A1
SCLSCKBlue
P3USB+A3

xxGreen
P4USB-A2PWM4
xxYellow
P5(Reset on
some models)
A0

xxOrange

A simple blink script to test the module is
// the setup routine runs once when you press reset:
void setup() { // initialize the digital pin as an output. 

//  pinMode(0, OUTPUT); //LED on Model B
     pinMode(1, OUTPUT); //LED on Model A or Pro }

// the loop routine runs over and over again forever:
void loop() {
//  digitalWrite(0, HIGH);   // turn the LED on (HIGH is the voltage level)
     digitalWrite(1, HIGH);
     delay(500);               // wait for a second


//  digitalWrite(0, LOW);    // turn the LED off by making the voltage LOW
     digitalWrite(1, LOW);
     delay(500);               // wait for a second
}


The led on my module reacts on P1. So I expect i have a model A.

Wednesday, August 14, 2019

SMD led breadboard friendly.

I wanted to do some easy prototyping with SMD leds (and other components).
SMD components are available in different (small) sizes.
One of the ways I made the SMD leds breadboard friendly is as follows:

1) Put an SMD led and a long Dupont pin connector on your workbench,
2) If the SMD led is somewhat bigger remove a pin (the second pin) from the connector.
3) Tin the Dupont connector where it needs to be connected to the led.
4) Push the Dupont connector on the led and solder by heating the connector. If needed add a little solder.
5) Cut the connector on the desired size (2 or '3' ) pin.
6) Test the led and the connections using a led tester.

By cutting the connector after soldering it is more easy to push the connector on the led and making the solder join.

On the picture you see at the left some end results and at the right a "standard" red led as size reference.
On the bottom left a " big" SMD led with a Dupont connector with the middle male pin removed.
The other 3 SMD leds are smaller leds that fit on two pins.

Tuesday, August 13, 2019

Flexible USB led light -1-

Making a custom flexible USB led

Building a flexible USB led.
It is possible to buy a cheap flexible led (or fan or other device) with an USB connector. It is more fun to build your own where you can use some special led's.  I created several different flexible USB devices. A fast flashing RGB led gives a nice effect.
The USB connector provides 5 Volts. After selecting a  led your own choice add a small resistor to limit the current. Shortened the legs of the led and added long red and black wires for power connection.
Led and resistor with red and black cable
 and  flexible hose.
With transparent heat shrink it is possible to isolate the wires and keep the resistor (value) readable.
A flexible oil hose (also available on Aliexpress) is used as a housing to make it flexible and stable at the same time. In this version i removed the connectors from the hose. It is also possible to change the hose length.
 For the power connector i used also some USB connectors from Aliexpress, an USB connector from an old cable can also be used.
USB
At the USB side of the hose cut away some of the plastic of the hose to make later a better connection. Take care to connect the + to plus and - to minus. By pushing wires and the led inside the hose you can cut the wires easy to the desired length.
After soldering i pushed in the USB connector back in the hose. With the correct wire length the led will just pop out of the other end of the hose. With hot glue the USB connector is glued to the hose.
USB connector and USB chassis part
 for testing and checking plus and minus.









Links to some Aliexpress items i bought (in 2019) to use in this project.

Fast RGB Flash leds
20 pcs 5mm Fast RGB Flash Red Green Blue Rainbow Multi Color light emitting diode Round Rainbow LED can change more than 7 color  (  € 0,89 for 20 pc)
Emitted Colour:RGB Rainbow Fast Flash
Rainbow LED can change more than 7 color
Size:5mm
long life 100000hrs (Voltage in the range of)
Energy saving and high efficiency
Super brightness
Operating temperature: -20 to 55°C
Storage temperature: -30 to 80°C
Forward Voltage(V):3-3.2V
Forward Current(mA):20
View Angle:About 25 degree
Luminous Intensity:Highlight
1 / 4W resistor corresponding voltage (For reference)
12V for 470 ohm/ 5V for 100 ohm/ 7.2v for 220 ohm / 9v for 330 ohm / 13.2v for 560 ohm

WSFS Hot 10PCS Round Nozzle 1/4PT Flexible Oil Coolant Pipe Hose Blue Orange For CNC Machine Lathe Milling Cooling Tube Retail    (  € 6,00 to € 7,00  for a lot with 10 pc)

10Pcs/Set DIY USB 2.0 Type A Male 4P Adapter Connector Plug Socket with Plastic Shell (10 pieces for 1,90 euro)

Wednesday, July 24, 2019

RGB led for experiments

For easy experimenting added resistors and a Dupont connector to a 'normal through hole' RGB led. Transparent heat shrink was added for electrical insulation and to keep the resistors (and the common pin wire) visible.

Friday, July 19, 2019

iTag Bluetooth tracker

iTag
Bluetooth iTags advertisements say you can use this cheap devices to find your keys, wallet and other items.
I ordered 5 of this iTags to see if they can really help me and my family to find items or prevent losing them. On the Aliexpress page i found 4 different colors so i received two of the same color.
The iTags came in a plastic bag with a small instruction on paper with QR code links to the software without the CR2032 Lithium (3V) battery. From the 5 iTags i received one did not work.
The cover of the battery compartment needs to be removed to put in the new battery. It is not mentioned in the manual but you can easy swap two covers with different colors. This way you can easy identify more than 4 distinct iTags without writing on it.  You can make combinations like a Black iTag with a White battery cover.
iTag with battery cover
of iTag of another color
The QR code for English android software links to the cTracing app on the Google Play Store. With this app you can use multiple iTags. In the app you can change the name of the iTag and even add a photo to identify the iTag.
Keeping the push button on the iTag pressed 3 seconds sends outs two beeps on the iTag, a led on the iTag starts flashing and the iTag is switched on and can be connected to your phone using the app.
If the distance between the iTag an the phone is to big (and the Bluetooth signal gets weaker) an alarm can go off. In the app the distance can be set to short, medium and long. Also the distance unit can be switched between meters and foot. Depending on the settings the button on the iTag can also be used to activate an alarm on the Bluetooth connected phone, switch on voice recording, take a photo or store the current location.
It also should store current the location if connection between the tag and the phone is lost. To find lost items with the iTag and the app, or use the app for preventing loss of your items will be very challenging. The Bluetooth on the iTag can switch of after a few minutes. The connection will be lost and a false alarm will be triggered. Also finding your iTag back after leaving it somewhere a few hours will be quite impossible as the iTag will be switched off and not sending a traceable Bluetooth signal.
To use an iTag to find your phone also does not work as the connection between the iTag an the phone is not (always) restored automatic if it was disconnected and the Bluetooth signal is received again by the phone. Perhaps other apps (or another phone setting) will help to overcome this problem.
Also i noticed some small differences between similar looking iTags. I have seen photo's and video's where you can only see two battery connections and a white plastic when opening the battery compartment. In my iTags can see the PCB with some connections.
Besides the color there are also some other small visual differences between the iTags i got from my seller. Some have a small battery connections at the side and others have a somewhat bigger connection at the side to the +pole of the battery.
I don't know if there are other differences (e.g. in the internal hardware or software) of iTags that look similar.

Conclusion
The iTag i received switches off automatic and triggers false lost signals. Also one of the 5 cheap iTags was dead on arrival. Perhaps there are better iTags but due to this issue i can not recommend this iTag and i doubt if it can really help you find lost items.

More info
JG iTag Alarm
https://www.youtube.com/watch?v=DvG5ymq46WI

The £1 Bluetooth Tracker https://www.youtube.com/watch?v=oYX8YKw3vGM

Tuesday, July 16, 2019

SMD project

To get more experience with SMD soldering i build this led chaser.
The circuit of this running light consists of a 555 timer to make pulses
 and a 4017 counter. Both ICs are SMD and also the two condensators C1 and C2 and the other 12 resistors.
The photo below shows the difference is size of a "standard" resistor and an SMD resistor.here are also small SMD leds, however "standard" red led lights are used.
To my surprise the SMD intergrated circuits where more easy to solder than the resistors and condensators.
I used a soldering iron, flux pen, tweezers and a magnifier glass.
The video shows the working circuit. As you can see the  wires of the leds are not cut off as i wanted to attach Dupont connectors to do some more experiments with this small cheap Aliexpress DIY circuit.