Showing posts with label Arduino Uno Sketch. Show all posts
Showing posts with label Arduino Uno Sketch. Show all posts

Wednesday, 2 July 2014

External Wireless Temperature measurement

This project was required so that I could monitor the temperature inside a temporary lean-to / greenhouse I made to winter some frost hating plants in.

There are basically two modules, the transmitter and the receiver.
Receiver
Transmitter
The transmitter uses a Jeenode from Jeelabs to read the temperature from two DS18B20s, one inside the greenhouse and the other in the form of a probe placed outside the greenhouse to measure the ambient temp.

The receiver uses one of my own PCBs which is essentially a jeenode with an added uSD card slot, the display is from Jeelabs and is designed to sit directly on top of a Jeenode but it's not the cheapest display you can use.  The receiver can also be made using a standard Jeenode instead of my PCB.

I run the transmitter off some old lithium rechargeable 1850 cells taken from an old laptop battery, the receiver also runs on a lithium battery from a mobile phone but you can use any batteries you like from 3 to 5 V.

The battery voltages of both the transmitter and receiver are monitored and displayed on the LCD, the code for the battery monitoring was taken from the Jeelabs blog here and the sleep functions were also from the same post using the Jeelib libraries.

Sketches can be downloaded for transmitter and receiver.

Any questions or comments, feel free.








Wednesday, 24 July 2013

Monitor Temperatures on your phone with an Arduino

After using the Bluetooth link to connect to the Chronograph I thought I'd use it to remotely monitor some temperatures, mainly because my fridge was acting up.

I connected the BT interface to the Arduino (my own version), this is quite easy because you just connect the TX from the Arduino to the RX of the BT interface and the sketch just uses the serial.print command.  This means you can test it out on your PC using the serial console in the Arduino IDE.

For testing I just make a small sketch to continuously output two random temperatures.

long randNumber;
long randNumber1;
long randNumber2;
long randNumber3;

void setup() {
Serial.begin(57600);
randomSeed(analogRead(0));
}

void loop() {
randNumber = random(5, 20);
randNumber1 = random(1, 10);
randNumber2 = random(5, 20);
randNumber3 = random(1, 10);
Serial.print(randNumber);
Serial.print(".");
Serial.print(randNumber1);
Serial.print("A");
Serial.print(randNumber2);
Serial.print(".");
Serial.print(randNumber3);
//Serial.print("A");
delay(10000);

}
The sketch outputs two decimal values delimited by the 'A' character, you can use any I suppose.


Within the App there is a settings screen where you can set Farenheit, enable the raw data to be seen on the main screen and edit the two temperature labels to something more meaningful.

I think I'll need to add the ability to alter the rate at which the app checks for data, currently it is 5 seconds, half of the 10 second rate from the arduino

My real world transmitter uses low power and only transmits once every minute and sleeps in-between.

If the transmitter used mains power and was permanently awake then I could request a reading when the app connects

App can be downloaded here or QR code  

Monday, 8 July 2013

DIY Chrono Shopping list

Latest project update for 2026 here


A few people have expressed interest in making a DIY chronograph so I said I'd put together a shopping list.


There are quite a few options for the display type so I try to give the pros and cons at each step.

Firstly, the processing power.
All my projects are done using the Arduino family, including the many clones out there, I've used original Arduinos and Clones from China all without any problems. (A PIC Micro will do just as well with the same hardware)


Arduino Mini Pro

Arduino Nano



These are available in 5V 16MHz and 3.3V 8MHz versions, I used the 5V versions @ 16MHz to get the best uSecond resolution, I believe that the 5V versions can be run at 3.7V and still run at 16MHz.
This device needs an external USB to serial adapter to allow programming but, once progr ammed, can be fed from a 7V source via the on-board regulator (RAW input) or a regulated 3.3 to 5V supply on the VCC pin.
I bought mine on Ebay from here for less than £3 but it took 27 days to arrive.
Others on Ebay search
These are the boards I've been using, mainly due to the USB connector for both programming and supplying 5V.  I use an Eveready unit that uses 2x AA batteries and steps up the voltage to 5V, I connect this with a standard micro USB lead.
Apart from the on-board USB and the in-circuit programming connector (far right) the specs are the same as the Mini Pro.
These can be bought on Ebay for around £4 from China and around £10 from the UK, they're a little more expensive due to the on-board USB.

Display Options

This is the top of the range display £7 from China but has the advantages of being colour and also touch screen.
I didn't go very far with this display but I think it would be good in a larger Chronograph that has a large detection curtain.

This is an I2C connected display and can come in yellow, blue, white and red.
This is my choice for my portable sensor.
It's very easy to program and is a similar size the the sensor tube so is a good fit, see this post.
You can only really display one value, I chose FPS because that doesn't require you to input the pellet weight, you can generate a little look up chart for you pellets.
I dug out an old Nolia 5110 phone display that was set into an Arduino UNO shield and added it to the DIY Chronograph family, it works pretty well and has a very good contrast for outside readability and the 5 way switch at the bottom centre allows for a menu system to enter the pellet weight.
I can't get the shields any more but the screen can be bought off Ebay for a couple of quid from China and around £7 from the UK, these displays not on the shield work on 3.3V only so require some level shifting when used with a 5V arduino.



A cheap and cheerful display that can be bought in many webstores an Ebay, they're nearly all the same connection standards and have Arduino Libraries readily available and can come with or without backlighting.
Similar to the 2 line 16 character display just a bit smaller, easier to package and can come with and without backlight, the non backlight versions tend to use an LCD technology that means they're a good contrast  and can be good in sunlight.


Fancy using your Android smartphone as the display then this is what you need, available from £5 in China to £15 in the UK.
Be careful, this board comes with and without the back PCB, without it is a bit fiddly to use and works of 3.3V only.
Ebay search

Other parts


I chose Aluminium tube because I wanted to thread it to fit my 1/2" UNF silencer adapters on my rifle and pistol but you could use any tubing you liked, depending on how you want to fix it.
I bought mine on Ebay from here.

You will need to get it cut to length and threaded if you want to do as I did.

Maybe you have an old silencer that you could modify.  See this post for assy. details
The sensor LEDs were bought from RS components, they are available on Ebay but at a huge markup

Photo sensor - OPL-550a
Ebay
Farnell
RS components

IR Emitter LED OP240A
Ebay
Farnell
RS Components

Software

Arduino
Android
I have quite a few version of the various sketches so if you would like a particular version just request it in the comments and I sort out a link.

Nokia 5110 shield sketch
Nano with 7 segment display
Chrono with 8x2 LCD

 Here

Aptoide store download


Saturday, 25 May 2013

Chronograph update

Latest project update for 2026 here


When I made the smaller screw on sensor that connected to the PC and fed the timing into a PC application, it got me thinking about different types of display that could be used and after a a good look around the net I came across a couple of options.

The first was a 7 segment LED display, these come in different shapes and sizes and could still be quite portable when added to the sensor.

The only problem with these displays is the amount of IO needed to drive them as each of the segments require driving. I then came across the Adafruit 7 display backpack, which takes all the hard work out of controlling the 7 segment displays.
The backpack details can be found here

The device is based on an Holtek HT16K33 chip that controls the LED segments and connects to the Arduino via the I2C bus and has a library that makes sending data to the display easy.

I bought one of the displays from Ebay and stuck it on the side of the sensor tube then added the code to the sketch to send the value for feet/second to the display after sending the uSecond value to the PC.


This would allow the chronograph to be used in conjunction with the PC via the USB lead or remotely with a battery pack, just reading the Feet/Second value.


Showing the feet/Second would require a lookup table to get the power from the velocity and the weight of the pellet, I suppose with a couple of small buttons added you could enter the pellet weight after power-up but before the first shot it could then alternate between the FPS and the power reading every 10 seconds?.

I then tried it out using my CP Sport Co2 pistol and it looks good.

I then used some of that PVC heatshrink, normally used for battery packs, it's really good as it shrinks using a hair drier and is quite hard when cool but can easily be removed with a pair of scissors or a knife.

Ideally I would have liked to use some clear but I only have red or white but surprisingly the LED shows through the PVC quite well.

Things to think about: -

  • Writing the shot data to EEPROM for later retrieval
  • Adding buttons to allow pellet weight to entered
  • put together a battery pack for remote usage
  • Think about power saving schemes
  • Display battery power on power-up?
  • Who knows?
Nano Sketch can be downloaded here you can use it with or without a PC, if you want the PC application let me know in the comments, it's still very BETA.
Fritzing file here.

More about the second option I found later.....

Thursday, 25 April 2013

Chronograph - Part 6

Latest project update for 2026 here


Working on this project has really got me thinking and now I have my air rifle I needed to get something finished and usable ASAP before I started to tune the rifle, I don't want to go over the legal limit.

Whilst thinking about the total cost of the parts to make a usable chronograph, the one most people buy is £50, I had the idea of removing the LCD and just using the serial link to the PC.

So I thought about strapping an Arduino Nano to an aluminium tube with a 1/2" UNF thread so that it would fit on the standard silencer adapter, this would make it very stable.
I decided to use the Nano because there wouldn't be the need for a battery to power it, the USB lead would carry power and data back to the PC, people would also be able to programme them without having to buy the serial/USB interface.

Marking out the sensor distance
Tube screwed into the silencer adapter for my rifle
Fully assembled prototype with a foam spacer
Finished part attached to the Air Rifle
I used some thin but very tough heat shrink sleeving the same as that used to hold battery packs together on remote control cars



Below is a screen grab of the PC software (Ignore the FPS value, I'd forgot to change the calculation to 60mm spacing instead of 100mm)
Now for some more testing.


Wednesday, 29 August 2012

All in one Prototyping PCB assembly

The assembly of the PCBs finally got started over the weekend and so far I'm pretty pleased with them, I've spotted a couple of minor issues so far but nothing that can't be fixed with a sharp knife some wire and a soldering iron.

Eagle files can be found here, they are version 2 with the power supply fixed and an added higher power 5V regulator.

So far I've only tried the ATMega 328p and it's peripherals, the ATtiny84 can wait until next weekend.


Firstly I added all the resistors, they need to be quite small resistor, physically that is, as I only used a 5mm lead pitch package.  I then added the voltage regulators so I could check that power appeared correctly at all the places it should do and at the right level.

This is where I spotted my first error, originally I'd planned to feed the 3.3V regulator from the output of the 5V regulator but then for some strange reason I changed it so both regulator inputs were tied together, unfortunately this meant that when the USB to serial (FTDI) was connected it wouldn't supply the 3.3V regulator and therefore the processor wouldn't be powered.

I cut the track from the supply to the input of the 3.3V regulator and wired it to the output of the 5V regulator. this meant that the FTDI 5V was fed into the 3.3V regulator and supplied the processor.


One of the first things I tried when I got the boards was to plug in the GLCD from Jeelabs as I use this quite a lot, luckily it fit perfectly and it even works.


Today the RTC chip arrived with a clock crystal and was soldered in place, not as difficult as I thought it would be.
Added a CR2032, loaded the RTC sketch and used my RTC time setting app for the PC to set the time and it worked fine.

So far so good.....

Wednesday, 13 April 2011

Set the time on your DS1307 with the Arduino

After getting my DS1307 RTC working I thought it would be easier to set the time using an app (can I call it that?) on the PC that uses the PC time.

The code base that I used/modified to read and write to my DS1307 was from here, this uses a UNIX time code to set the time.

The app should be used in conjunction with this Sketch, or derivative that uses the same method to set the time.  You can also see any serial data sent back from the Arduino in the 'data received' window.

Now I'm not an expert in VB programming but I like the occasional challenge so here it is, please use it and modify it as you like, I got most of the instructions using Google anyway.
  
The idea is that the computer time is split out into the separate boxes, not necessary but clearer for me to programme.

The 'T' box continually updates to create the UNIX time code and is sent to the Arduino/RTC when the 'Send' button is clicked.

To install the App: -
  1. Get it from my dropbox public folder here.
  2. Extract to a folder on your PC.
  3. Run the setup to install.
  4. Run the programme.
  5. Select the comm port (plug in Arduino first).
  6. Select the baud rate to match the Arduino.
  7. Click Connect.
  8. Click Disconnect before exiting the app.
Any problems or suggestions please use the comments.
23/4/11 - Post updated - Link to Arduino sketch corrected.

Monday, 4 April 2011

Arduino - Open source hardware and software platform

I've just discovered the open source HW and SW platform called Arduino, this platform allows inexpensive prototyping of your ideas.  Your Ideas are called "sketches" and are similar to the C type programming language, not that I've done any programming in C!

The UNO
The Arduino range includes several different types of processor/PCB arrangements from the "UNO", which I bought, to the very small "Nano".

The Nano










The software "Sketches" are written in an open source IDE, available from the website www.arduino.cc, this allows you to write and download the software to the target board.

The really good thing about the design is that they have all the I/O on header pins along each edge of the PCB allowing addon PCBs, called Shields, to be stacked on top of the main processor PCB, if it's an UNO or Mega, the smaller boards use DIL sockets to connect to other circuits using breadboard for example.

Due to the open nature of the whole enterprise there are quite a lot of third party addons that can be found on the Internet especially on Ebay, things like:
  • Ethernet adapter boards
  • LCD displays
  • Prototyping boards
  • Wireless adapters (WiFi, Bluetooth etc.)
  • Relay boards for switching mains equipment
  • H-Bridge motor controllers
  • Servo Controllers
  • Real Time Clock
Most of these addons come with Arduino Libraries which give simplified commands to allow quick and easy configuration of the Shields.

The UNO comes with a surface mount LED connected to Pin13 on the PCB so it is very easy to write your first programme, for example the first code to try from the Arduino site would be: -
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
   This example code is in the public domain.
 */

void setup() {                
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

All you need to do is copy and paste this code into the Arduino IDE software and squirt it down to the board via the USB connection and the LED on the PCB will start to blink.

At the moment I'm putting together an Uno with a Real Time Clock, LCD display and a couple of temperature sensors to control my central heating and hot water, I'm also hoping to control it via the USB connection using a Visual Basic programme on a PC, I'll add more details to the blog as I progress.

New Accessories for the AirChrony S3

With the increasing abilities of AI it has become so much easier to take an idea to a finished, working item in a really short time. I was t...

Popular Posts