Category Archives: Electronics

Open Bionics robotic hand for amputees

“A pro­to­type 3D-print­ed robot­ic hand that can be made faster and more cheap­ly than cur­rent alter­na­tives is this year’s UK win­ner of the James Dyson Award.” (BBC News link)

This is a fan­tas­tic idea, which has so much val­ue to peo­ple with­out limbs. Bion­ic pros­thet­ics can cost up to £100,000, and £30,000 for a sin­gle hand.

The 3D-print­ed robot­ic hand in the arti­cle costs £2,000, which is the same price as a pros­thet­ic hook, and offers sim­i­lar func­tion­al­i­ty to the top-of-the-range options.

The design­er gets to devel­op his inter­est in cre­at­ing a prod­uct, while help­ing the esti­mat­ed 11 mil­lion peo­ple who are hand amputees world­wide.

Open Bionics

Using a Cellular/Mobile Phone Network to Send Data with Arduino/Embedded

Today I used an Arduino repro­gram­ma­ble elec­tron­ics board and a GSM/GPRS modem to send data to the Inter­net. This will be use­ful for the sen­sors I intend to build.

You can see a video of it oper­at­ing below. One win­dow shows the out­put from the ser­i­al inter­face as it makes a request to my web serv­er and out­puts the response, and the oth­er win­dow dis­plays the access logs on my web serv­er.

I used a soft­ware UART (par­al­lel and ser­i­al data con­vert­er), as using the Arduino’s built-in ser­i­al inter­face caused con­flicts. Learn­ing to use a soft­ware UART is going to be very use­ful for the next step in the project.

I did con­sid­er mak­ing a Cat Facts for Arduino, but I resist­ed the dis­trac­tion.

I didn’t have any issues with pow­er spikes caus­ing a reset (the GSM board uses a lot of pow­er) as this is a ver­sion 2 board with soft start cir­cuit­ry:

Soft Start Circuitry
Soft Start Cir­cuit­ry (Source)

I also used AT codes to send SMS text mes­sages. A full list of AT codes are avail­able here, and I used these:

Send a text

Set to human read­able text mode:
AT+CMGF=1

Set phone num­ber:
AT+CMGS=“447944581307”

Enter the mes­sage

Send hex 1A to escape mes­sage.

List texts

AT+CMGL

Read a text

AT+CMGR=<index> (index­es start at 1)

Delete a text

AT+CMGD=<index>

 

The only stum­bling point I had was when the GSM modem was set to a dif­fer­ent baud rate than my soft­ware ser­i­al inter­face. To change this, I sent the AT com­mand AT+IPR=9600 to recon­fig­ure the modem.

I learnt that AT com­mands are also used to send and receive via TCP/UDP. This made it much more straight­for­ward than some kind of low lev­el sys­tem I had imag­ined. All that is required from the Arduino is to send AT com­mands (e.g. AT+CIPSEND=) and lis­ten for incom­ing respons­es.

Explanation for non-techies:

I made an elec­tron­ic cir­cuit that can send infor­ma­tion to the Inter­net. This will be use­ful for mak­ing a sen­sor e.g. a tem­per­a­ture sen­sor for an office that is acces­si­ble on any computer/smartphone.

Arduino for Atmel Studio

Atmel Stu­dio now has an exten­sion designed as a sim­ple alter­na­tive to the Arduino IDE.

The Arduino IDE is rel­a­tive­ly sim­ple. It is great to get start­ed with AVR pro­gram­ming, and has some use­ful exam­ples to get you start­ed, but lacks many of the fea­tures that expe­ri­enced pro­gram­mers call for like detailed com­pil­er warn­ings, debug­ging capa­bil­i­ties, auto-com­ple­tion and unit test­ing.

Arduino IDE
Arduino IDE

Pro­gram­ming for AVR at a low­er lev­el in Atmel Stu­dio can also have per­for­mance improve­ments. Shift­ing bits rather than using Arduino IDE’s ‘dig­i­tal­write’ can have a 10x speed improve­ment for exam­ple.

Atmel Stu­dio sup­ports a wider range of AVR microchips. This can be use­ful if you aim to pro­gram one of Atmel’s huge range of microchips. I have a ATtiny13A, which uses con­sid­er­ably less pow­er than the ATMega328 in my Arduino board (190 µA in active mode, and 24 µA vs. 0.2 mA in active mode, 0.1 µA in pow­er-down mode, and 0.75 µA in pow­er-save mode).

Atmel Studio

So if you feel you are out­grow­ing the Arduino IDE, give Atmel Stu­dio a try. You may find this tuto­r­i­al use­ful: Using Atmel Stu­dio 6 with Arduino projects, or How to Set­up Atmel Stu­dio for Arduino Devel­op­ment.

Sim­plic­i­ty can be more impor­tant though, and the Arduino IDE may be more suit­able for your appli­ca­tion. After all, projects are gen­er­al­ly rel­a­tive­ly sim­ple when you have less than 16 KB of mem­o­ry to play with. I expect I will con­tin­ue using the Arduino IDE pri­mar­i­ly, and Atmel Stu­dio for any par­tic­u­lar­ly chal­leng­ing projects.

Simple explanation for non-techies

Arduino refers to a few types of tiny elec­tron­ic board with a repro­gram­ma­ble microchip. Pro­grams can be sent from a com­put­er to this microchip to per­form what­ev­er task is required.

A fun exam­ple is Leah Buech­ley’s Turn Sig­nal Bik­ing Jack­et project, shown in the video below:

Software Defined Radio (SDR) and Field-Programmable Gate Arrays (FPGA) — A Free Radio Scanner

When I was grow­ing up, one of my favourite birth­day presents was a Uniden UBC3000XLT radio scan­ner. I enjoyed find­ing and lis­ten­ing to var­i­ous radio trans­mis­sions, and I had some suc­cess decod­ing data trans­mis­sions and morse code using my PC and Sound Blaster sound­card.

Uniden UBC-3000XLT Radio Scanner
Uniden UBC-3000XLT Radio Scan­ner

I was inter­est­ed to read about a tech­nique called Soft­ware Defined Radio (SDR), which can sam­ple the entire short­wave spec­trum, and use the pro­cess­ing pow­er of a com­put­er to vir­tu­al­ly ‘tune’ in to trans­mis­sions.

A home-built SDR board oper­at­ing at the Uni­ver­si­ty of Twente in the Nether­lands (pic­tured below) and a receiv­ing ele­ment around 5cm x 10cm is capa­ble of receiv­ing a fre­quen­cy range of 0 — 29.160 MHz.

It uses a Spar­tan XC3S500E Field-Pro­gram­ma­ble Gate Array. FPGAs can be pro­grammed using a hard­ware descrip­tion lan­guage, and arrays of pro­gram­ma­ble log­ic blocks which can be vir­tu­al­ly inter-wired. The most impor­tant advan­tage over a micro­con­troller like a Atmel/Arduino, is these oper­a­tions can hap­pen in par­al­lel, which is crit­i­cal to cre­at­ing a soft­ware defined radio, as a typ­i­cal AVR micro­proces­sor sim­ply doesn’t have the nec­es­sary clock speed. The sam­ple rate must be at least twice the max­i­mum fre­quen­cy of the sig­nal (Nyquist the­o­rem).

PA3FWM Software Defined Radio
Soft­ware Defined Radio at the Uni­ver­si­ty of Twente

Tak­ing this a step fur­ther, Soft­ware Defined Radio can allow mul­ti­ple users to share the same receiv­er. At time of writ­ing, 184 users are lis­ten­ing to dif­fer­ent fre­quen­cies using the receiv­er at the Uni­ver­si­ty.

You can lis­ten for your­self at the Wide-band Web­S­DR at Uni­ver­si­ty of Twente. It’s essen­tial­ly a free radio scan­ner any­one can access for free. You might enjoy stum­bling upon a vari­ety of trans­mis­sions from all over the world, and you may have suc­cess using tools like Sor­cer­er to decode data trans­mis­sions, weath­er fax trans­mis­sions, and morse code.

With the ever-con­tin­u­ing advances in data stor­age capac­i­ties and scal­able clouds, one day it may be a triv­ial mat­ter to archive the entire radio fre­quen­cy spec­trum.

DIP switch with Arduino

Here is a use­ful func­tion to read DIP switch­es with Arduino. Wire the switch­es to ground, as this uses pull-up resis­tors:

Photograph of a DIP switch

 

  1. int myDip­Pins[] = {2, 3, 4, 5, 6}; //DIP Switch Pins
  2. void set­up()
  3. {
  4. Serial.begin(9600);
  5. for(int i = 0; i <= 4; i++)
  6. {
  7. pinMode(myDipPins[i], INPUT);       //Set DIP switch pins as inputs
  8. digitalWrite(myDipPins[i], HIGH); //Set pullup resis­tor on DIP switch pins
  9. }
  10. delay(100);
  11. }
  12. void loop()
  13. {
  14. byte DIP­Val­ue = readDIP(myDipPins, 5);
  15. Serial.print(DIPValue, BIN);
  16. Serial.print(“\n”);
  17. switch (DIP­Val­ue)
  18. {
  19. case B00000:
  20. Serial.print(“Match 00000\n”);
  21. break;
  22. case B00100:
  23. Serial.print(“Match 00100\n”);
  24. break;
  25. case B11011:
  26. Serial.print(“Match 11011\n”);
  27. break;
  28. case B11111:
  29. Serial.print(“Match 11111\n”);
  30. break;
  31. case B01001:
  32. Serial.print(“Match 01001\n”);
  33. break;
  34. case B10000:
  35. Serial.print(“Match 10000\n”);
  36. break;
  37. }
  38. delay(1000);
  39. }
  40. //Read bina­ry from DIP switch­es
  41. byte readDIP(int* dip­Pins, int numPins)
  42. {
  43. byte j = 0;
  44. //byte j;
  45. //Get the switch­es state
  46. for(int i = 0; i < numPins; i++)
  47. {
  48. if (!digitalRead(dipPins[i]))
  49. {
  50. j += 1«(numPins — 1 — i);
  51. }
  52. }
  53. return j; //Return result
  54. }

 

 

Be sure to check ” and ’ sym­bols haven’t been made fan­cy by Word­Press, or you’ll have errors in your code.