Tag Archives: ARDUINO

ESP32 DEVKIT V1

#76 ESP32 that is Arduino & MicroPython Compatible

ESP-WROOM-32 32-bit 240 MHz microprocessor

The ESP32 has already integrated an antenna and RF balun, power amplifier, low-noise amplifiers, filters, and power management module. The entire solution takes up the least amount of printed circuit board area. This board is used with 2.4 GHz dual-mode Wi-Fi and Bluetooth chips by TSMC 40nm low power technology, power and RF properties best, which is safe, reliable, and scale-able to a variety of applications.

DIY ATTINY85 ALARM

#62 SIMPLE DIY ATTINY85 ALARM

Working prototype PCB .

Upon experiencing a few break-ins on the farm I decided to look for a simple alarm system to monitor certain door. For such a simple project a full on alarm commercial alarm system would be overkill.. So I endeavored on the short and fruitful DIY journey.

My system is based on the simple circuit from Great Scott on YouTube. The brains of the circuit is the Arduino programmable Attiny85 MCU. A reset push button, notification LED, arm/disarm toggle switch, notification buzzer and magnetic read switch are the IN/OUT components used.

The project runs on 12 volts (12 volts for the siren) which is filtered down to 5 volts for the Attiny85. My plan is to use a 12 volts 7 ampere lead acid battery combined with a smart charge board to power the project effectively.

After soldering the components onto the board everything worked fine. However the siren was very soft and the 2N2222A transistor was getting extremely hot. This is because the transistor has to provide a ton of current to the siren in order to get it working at 100% capacity. A quick fix is to remove the 1k resistor between Attiny85 pin 1 and the transistors base.(replace it with normal wire) This allows the siren to be louder but the transistor is still hot. A possible permanent solution will be to just use a 5v relay or look for a transistor with a higher current tolerance.

In the end I decided to go with a 5v relay module since it’s a quick reliable solution but is more expensive than a transistor. In a future upgrade I will most likely use a BC517 darlington as referenced by this article. It will be cheaper than a relay and provides more than enough current for a 15W 1 tone siren (380ma).

DATASHEETS

WEMOS D1 MINI

#57 WEMOS D1 MINI WIFI DEV BOARD

Wemos D1 mini

The Wemos D1 mini is a small WiFi based development board. The board is based off of the ESP-8266EX MCU developed by Espressif . The dimensions are 34.2*25.6 mm which allows this small package to be used effortlessly in large scale applications. Shields are also widely available and add to the ease of use for this board.

Features

  • 11 digital IO, interrupt/pwm/I2C/one-wire supported(except D0)
  • 1 analog input(3.2V max input)
  • a Micro USB connection
  • Compatible with MicroPython, Arduino, nodemcu

Technical specs

  • Operating Voltage 3.3V
  • Digital I/O Pins 11
  • Analog Input Pins 1(3.2V Max)
  • Clock Speed 80/160MHz
  • Flash 4M Bytes
  • Size 34.2*25.6mm
  • Weight 3g

My specific board comes from a company called Farylink. It looks like they make small boards with wifi capabilitys.

According to there website:

Shenzhen Huayulian technology co., LTD is an IOT company that integrates rd, production and sales and is technology-oriented and service-oriented. With a rich background in the IOT industry, it focuses on the research, development and production of IOT communications.

[datasheet]
Size fingers for scale.
Looks like someone rubbed of the programming IC’s serial markings. Or perhaps it was manufactured without any markings? Either way the fact remains its 100% a Chinese copy.

The link to the CH340 driver (which is required to program the Wemos D1 mini over USB) can be found here.

DIY VOLTAGE DIVIDER

#56 DIY VOLTAGE DIVIDER

In order to measure the voltage of a DC battery we will need a voltage divider sensor. I built an easy DIY voltage divider which works quite well. All we need are two resistors to measure the voltage in a certain way so our Arduino doesn’t fry.

After working out my requirements for a 12v 7Ah battery I came to the conclusion that I needed a 30k and a 7.5k resistor. This will allow me to measure DC voltage from 0.025v to 25v.

I built 2 sensors
Top of the board

I only had to break the connection on the trace where the screw terminal was soldered to.

After creating a simple Arduino sketch I was able to output the data to the serial monitor. I had to add the correction factor of -0.150 to get an accurate reading after checking with two multimeters.

voltage read sketch
Serial monitor display

I used the Arduino pro mini as the MCU of this project.

MADUINO ZERO SIM808

#48 MADUINO ZERO SIM808 GPS TRACKER

The Maduino Zero SIM808 GPS Tracker is an IOT (Internet of things) Solution based on the 32-bit Atmel’s SAMD21 MCU and GPRS/GSM GPS module SIM808. It intergrates a micro Controller ATSAMD21G18, GRRS/GSM module SIM808, which is the upgrade version of SIM900, power management and storage, to make the SIM808 GPS Tracker ready for IOT projects such as smart-home, outdoor monitoring, shared bicycle, etc. The Marduino Zero SIM808 GPS Tracker based on the Arduino, users can program it with Arduino IDE, which is very easy especially for the none-programmers.

This is the V3.4 version, Note that to ensure the module starts up right, a lipo battery is needed to power up the Maduino Zero SIM808 GPS tracker V3.4.

Quick Spec

  • AT Input Voltage: 3.4-4.2V
  • Microcontroller: ATSAMD21G18, 32-Bit ARM Cortex M0+
  • Clock Speed: 48 MHz
  • Micro SIM connector
  • Integrated Power Control System
  • AT command interface with “auto baud” detection Quad-band: 850/900/1800/1900Mz
  • Send and receive GPRS data (TCP/IP, HTTP, etc.)
  • GPS L1 C/A code
  • 22 tracking /66 acquisition channels
  • Tracking: -165 dBm
  • Cold starts: -148 dBm
  • Time-To-First-Fix:Cold starts-32s (typ.), Hot starts-1s (typ.),Warm starts-5s (typ.)
  • Accuracy: approx. 2.5 meters
  • Interface: I2C/SPI/UART/18*GPIO
  • Arduino compatible
  • Working Temperature: -40 – 85℃
  • Size: 40 x 55mm
  • Net Weight: 23g

PRO MINI FARM ALARM V1.0

#42 PRO MINI FARM ALARM V1.0 BREADBOARD

The Pro Mini V1.0 testing for the Farm Alarm

The Pro Mini has proven to be a suitable solution. The board is very small and has more than enough specs to control the GSM/GPRS module while also sending data to a remote server via TCP.

The Pro Mini requires an FTDI programmer since there is no USB port on the board.

FTDI programmers pin out relative to the Pro Mini
Pro Mini ( ATMEL MEGA328P MU1039 )

FAILED ATTINY85 EXAMPLE

#41 A FAILED ATTINY85 EXAMPLE (GSM/GPRS)

A quick solder up to test the circuit (had issues with power sharing between GSM module and ATTINY85)

My first attempt to build a small circuit which controls a relay to an alarm speaker was a failure. Contrary to popular belief failure in electronics projects is quite common and I would argue that it is of paramount need if you want to learn anything.

Surprisingly my failure was in using the ATTINY85 instead a Pro Mini, Uno or Mega. Some problems I had were:

  • Not enough RAM to hold all my variables (I had to scrounge 😢)
  • Very limited FLASH memory.
  • GSM module interferes with the ATTINY’s 5v power source when connected using the same source with no filtering.

In a later project I created a reliably working solution with the Pro Mini as the brains.

My goal was to create a small circuit which uses the ATTINY85 as the brains. It uses the A6-GSM-Module to receive SMS’s, phone calls and sends TCP data. Finally it has a 5v relay which will switch on/off an alarm speaker. The theory is that when I’m on the farm in the fields and not near the house, I have the option of remotely starting an audio alarm at will. This should be a deterrent to potential criminals.

I made an easier to debug testing circuit with exposed copper traces (Same issues)

After making an easier to debug circuit I tried to get the ATTINY85 to work happily with the GSM module. This was going to be a bit complicated and I suspect I would have to isolate power between the ATTINY85 and the GSM module. This would require more components and the board is already looking cramped. A much easier solution is to use the Pro Mini instead of the ATTINY85.

The Pro Mini is most certainly a beauty.

DIGISPARK REV3 ATTINY85

#39 DIGISPARK REV3 ATTINY85 DEV BOARD

The Digispark rev3 USB board is an ATtiny85 based microcontroller development board. It comes with a USB interface. Coding is similar to Arduino, and it makes use of the familiar Arduino IDE for development.

BOARD SPECS

  • Support Arduino IDE 1.0+ (OSX/Win/Linux)
  • Can be powered by USB or 5v or 7-15v (automatic matching) extra power supply
  • There is a 500ma 5V regulator on the motherboard.
  • USB embedding (serial debugging)
  • 6 I/O Pins (2 for USB support)
  • 8k Flash Memory (about 6k after bootloader)
  • I2C and SPI (vis USI)
  • PWM on 3 pins (more possible with Software PWM)
  • ADC on 4 pins
  • Power LED and Test/Status LED (in Pin0)

The smallest USB Arduino

PDF Manual

UNO ATTINY85 PROGRAMMER

#38 DIY ARDUINO UNO ATTINY85 PROGRAMMER

Sometimes an Arduino pro mini is just not small enough for an electronics project. Enter the Arduino ATTINY85, this MCU comes in an extremely small package. It has only 8 pins and works with 5v.

Below are the specs of this microcontroller:

  • AVR MCU, 8K FLASH, 512B RAM, SPI
  • Controller Family/Series:AVR Tiny
  • Core Size:8bit
  • No. of I/O’s:6
  • Program Memory Size:8KB
  • EEPROM Memory Size:512Byte
  • RAM Memory Size:512Byte
  • CPU Speed: 8/16 MHz internal clock, up to 20MHz external clock
  • No. of Timers:2
  • Peripherals:ADC, Comparator
  • No. of PWM Channels:4
  • Digital IC Case Style:DIP
  • Supply Voltage Range:2.7V to 5.5V
  • Operating Temperature Range:-40°C to +85°C
  • No. of Pins:8

This is great and all but its a hassle to program the board unless you buy a dedicated programmer (expensive in SA) or if you’re happy to use a messy breadboard every time you want to program. So I decided to make a very crude but effective programming shield for my Arduino UNO.

SIM900 GSM MODULE TEXT

#30 SIM900 GSM MODULE TEXT

Hi all, recently  I was thinking about the AT command. What’s the AT command you might ask? well it’s an instruction sent to a cellular modem. for example: It’s an instruction which is sent from any suitable device (in this case and Arduino and a GSM module) to a phone/modem or GSM module. you can request something to be sent back to you or you can send something to another supporting device.

The abbreviation for ATtention is AT. each AT instruction starts with “AT” followed by the rest of the command. An easy example is:

AT+CMGF?AT=meaning that it’s an AT command, +=An extended command, CMGF= Select SMS message format, ?=Query character.

Ok enough of that lets get into the project.

The goal is to send a message from the Arduino+GSM module to a mobile cellphone. This can be quite useful.. since you can use this message as a “trigger”  for almost anything examples can be hooking up a relay to open your garage door or triggering a servo to open a lock.

you can even program the Arduino to receive a specific message and to execute a series of commands apon receiving this message. the possibilities are endless. so I suggest you have fun 🙂

So we will need a few items to get this project going.

* Arduino Uno.
* GSM module (I’m using the SIM900)
* 4 Male to Male jumpers.

You can ignore the relay for this project!

1.
The first thing you want to do is download the Arduino IDE from this link.

2.
After you have installed the IDE you’ll need to paste and modify the included code into your sketch (save the sketch)

3.
Next you’ll want to burn the sketch onto your Arduino.

So now you need to wire up the Arduino and the GSM module.
Thankfully the GSM module already has a MAX232 chip embedded into the board so we don’t need to worry about RS232 communication.
take a look at the pictures below and wire up your board.

GND=purple goes to 5V GND on the Arduino.
RX=red goes to pin 8 on the Arduino.
TX= yellow goes to pin 7 on the Arduino.
Trigger=grey goes to pin 2 on the Ardino.

The trigger is triggered when pulled low to GND

power to the SIM900 board gets connected to +5V and GND on the Arduino.

Now all you need to do is pull pin 3 on the arduino to GND (this is the trigger, in this case it will send a SMS)

You can also list all the messages saved to the SIM card since the SIM card is basically a tiny computer in itself!
Awesome!

Well that’s it for now HERE is the code saved in a nice zip file for you guys.