31 October 2014
29 October 2014
A test of 24 hours should be enough to ascertain if the voltage loss is the same or less than it was previously. Before I made this change the circuit was losing about 0.27 volts per day which would give the battery a life of about a week with 2 second reads/transmits. Ultimately the sensor will be set to only wake up every 60 seconds, which will give a much greater battery life.
28 October 2014
After reviewing the code it would appear I was powering down the micro-controller but not the radio module. So after amending the code to ensure that the radio module was also placed into sleep mode (using the Lowpowerlab libraries, not the Jeelib libraries) I ran it for testing purposes again. Overnight the voltage has dropped 0.13 volts. Something is obviously still not right.
After some discussion on Twitter it would appear I should also be powering up and down the sensor. So instead of having it powered from the 3.3v power rail it should be powered by an output pin so the power can be turned on and off in-between reads and transmits. So, I will be amending my code to allow for this and then running further tests to see how this impacts the power loss.
I am aware that 2 seconds is a lot and as such the battery is not going to last years like that. However, I would expect even with 2 seconds per reading that the battery should still last a few weeks at least. Once I am happy that I am achieving this then the node will be set to transmit only once every minute to conserve power.
19 October 2014
18 October 2014
This is a breadboarded Arduino made up of the ATMega328p chip with appropriate resistors and an oscillator. Connected via SPI is the RFM69CW radio Tx/Rx module and via I2C is an HTU21D humidity and temperature sensor.
I've also added an LED to Digital Pin 9 to give a brief flash after each transmission as feedback the unit is working,
Everything is powered by a 3.7v 850mAh lithium rechargeable battery. The battery passes through an MCP1702 voltage regulator to give a nice stable 3.3v for all of the devices. I've added some sleep functions to the code so that in-between transmissions the MCU powers down for 10 seconds before waking and repeating the data transmission. This means for the majority of the time the transmitter is using micro-amps and then only milli-amps for a few milli-seconds. Overall a very efficient state which should easily give a battery life over well over a year.
The data packet contains the node's unique ID number, the battery voltage and the two sensor readings (Temperature and humidity).
I've got the circuit as small as possible on the breadboard (see pic). The next stage would be to transfer it onto a stripboard and solder it all together. Finally i'll design and etch a PCB. I could use SMD parts to make the entire thing even smaller still and swap out the ATMega for an ATTiny which is a smaller chip.
I want to make 2 or 3 different sensor nodes with varying sensors on them (temperature, humidity, pressure, luminosity, etc.) so i've got packets coming in from several nodes. This will then allow me to start writing the code for the base station which will receive the data, time stamp it, store it on an SD Card and then sporadically upload it to a web server.
I've got 433MHz and some 868MHz RFM radio modules and also an SRF radio module from Ciseco which claims to have longer range. These will be all tested out in time to see which is best for penetration through walls, etc.
17 October 2014
A quick recap - I first had lost packets and lots of CRC errors in transmissions. These turned out to be a bug in the Jeelib library. Then I put an L7805 5v to 3.3v rectifier on and found it wasn't suitable. This caused lots of problems with the radio. Changed that to an MCP1703-33 which is much more stable and better suited to battery operation too. That fixed those issues.
Then I found out that I couldn't connect any other SPI device to the BUS as the RFM69CW also uses SPI and is controlled via timer interrupts. This was corrupting comms over the SPI Bus to any other devices as the interrupt was hijacking the bus on regular intervals. I tried a DS3234 Real Time Clock IC and the data were all wrong. I could bit-bang another SPI bus on non SPI pins but this is a lot of extra work. Instead I opted to switch to an I2C RTC (DS1307). I'll make sure all the sensors I use are I2C to avoid any further problems.
So, now i've discovered the above limitations with the hardware and software and have a better understanding of what i'm up against i've made a lot of progress. The sensor nodes are now transmitting data successfully with no lost packets or CRC errors. I have yet to do any range tests yet or run them of battery (with power saving sleep modes), that is the next stage in the project..
11 October 2014
At first I had the units talking to each other and sending out test packets for nearly 24 hours with no issue. Then I started to modify my code and add functionality and they stopped working. So, I presumed I had broken something in the code and so reverted back to the RF12Demo sketch and my original code to test them again and they still didn't work.
So I rebuilt the circuit and started again. This time I had some limited success but it shortly started to fail again then stopped working altogether. I've swapped the radio modules over and still nothing.
I then started to use the RF12_easySend() function instead of RF12_sendNow() and the transmissions started to work. Then the receiver stopped receiving the packets, not even packets that failed CRC, nothing.
I've wasted hours and hours on this and it's nothing but frustration. Is it the Jeelib library? Do I have faulty radio modules? Who knows. I am at a loss what to try next.
09 October 2014
I left two units, one transmitting and one receiving, running overnight sending gibberish test data and this morning it was still running without one single lost packet of data.
A lot of time was wasted with that. Anyway, now it is fixed I am able to get down to the nitty gritty of connecting up a sensor and transmitting real live data over the network.
08 October 2014
Firstly, the receiver unit was correctly receiving packets for a while and would then stop receiving altogether or have large gaps where no packets were received. Then there were periods when the message kept failing the CRC error checks over and over. Despite the fact the units are only about a metre apart, I would expect perfect packets with minimal error and yet this is not the case.
I can only presume there is some kind of weird interference where I am testing. I did try to reduce the baud rate but when I attempt to use the RF12_control() command to set the baud rate I am getting compile errors. Some kind of issue with the RFM12 driver and Arduino 1.5.8
Overall it has been very frustrating.
05 October 2014
After doing a little bit of research it turns out that the Yun does not have its SPI pins broken out to the digital I/O pins as they are on the Uno and instead are only connected to the ICSP connector. So no wonder it wasn't working. After hooking up two modules to two Uno's they were able to communicate to each other successfully.
So, now I have two device communicating the next stage in this project is to hook up some sensors to one of the device and have it sending the data back to the base station device. After that, the circuit will be powered by battery and using sleep modes will sleep in-between sending data to conserve energy.
11 August 2014
The basic premise of the project is to have sensor nodes monitoring things such as temperature, pressure, humidity, light levels and so on and then send that data wirelessly back to a base station which will upload it to a web server. Nothing that hasn't been done before in one way or another but a nice project to get involved with.
So i'm currently researching various types of radio units, sensors, methods of battery conservation and so on that will be needed in the project. I will of course keep you updated with my project as time goes on.
10 July 2014
09 June 2014
So the build of my new Electronics lab/workshop/home office has begun. I'm starting completely from scratch and building a complete wrap around curved desk that covers 3.5 walls in a roughly square room. It's quite ambitious and will no doubt be a lot of hard work but I wanted something special instead of just square desks.
The plan is to have 3 work areas, one for me, one for Petra and a third larger maker space for our projects.
The room and desk will be white with hidden LED lighting to give it a bright and modern look. I want a kind of Tron flavour to it.
I've got all the wood and tools I need to get started so I'll be making a start tonight. I'll post photos of my progress as I go along.
Started to build the frame and then to cut out the worktops but found a problem with my router. The chuck wouldn't let go of the round over bit I was using and no amount of force would release it. The mechanism for locking/unlocking the bit is clearly faulty. So, the build is on hold whilst I take the router back to the shop to be replaced (plus get a replacement bit for the one that is stuck). Building will resume once I have my tools back.
10 May 2014
05 November 2013
Before you open up the PSU unplug it and leave it unplugged for several days prior to opening up the case. Yes, you heard me right. The power supply has great big capacitors inside that can store charge for a long time after you disconnect the power. Fail to do this and you risk getting a nasty jolt. Don't say I didn't warn you. If it's a brand new one or been unplugged for some time then you'll be fine. However, I take no responsibility for you getting a shock. Take precautions first.
Open up the case. Now chop off all of the plastic connectors. Now, the red wires are 5V, the yellow are 12V, the orange are 3.3V and the black is ground. You also have -5V on the white wire and -12V on the blue wire. If you wish to use these then fine. Check out the WIkipedia entry for ATX for the full diagram of outputs and wire colours: http://en.wikipedia.org/wiki/ATX
Optionally you can also use the grey PWR_OK cable to power up an LED (via a current limiting resistor and ground) to show the power is on.
For my conversion I used banana plug sockets. Banana plugs are usually rated for at least 10 amps which is more than enough for my usage but check the ratings for your own specifications. Drill some appropriately sized holes in the case for your banana sockets and push them through.
Bundle as many of the red wires together as you can and solder to the base of a red banana socket. This will be your 5V output. Any red wires unused can be cut off as close to the circuit board as possible.
Do the same with the yellow wires for 12V, orange wires for 3.3V (I didn't require these on my PSU as I am using it to power my astrophotography equipment which only needs 5V and 12V. I did however leave some orange wires inside, just in case.) and then black wires for ground. If you wish you can also use the white for -5V and blue for -12V.
Optionally solder a switch and LED to the grey PWR_OK wire. Also solder the green PS_ON wire to ground.
I've heard of people building the outputs into their desk for easy access, which is a great idea if you do a lot of electronics. My conversion is going to be used to power my astronomy equipment such as the motorised mount, filter wheel, camera, dew heaters, USB hub and so on. I can get rid of the numerous power supplies I need to power these and use this single PSU for them all. As I have used banana plugs, which can be daisy chained by inserting into each other, I can power as many 12v or 5v devices as I wish from the one PSU.
The following advice about this project has been offered from Brad Levy:
Using an ATX supply as an inexpensive powerful lab supply is a good idea, but there are a couple of things you need to watch out for.
Many ATX power supplies are not designed to be operated with less than a certain minimum load. If run with a load lighter than that minimum load, the supply may shut down or may output voltages outside the regulated range. The minimum load specification varies depending on which version of the ATX spec the supply adheres to.
The early ATX supplies (circa 1995) had a minimum load requirement of 1 amp on the 5V line and 0.3 amp on the 3.3V line. This can be achieved by loading the 5V line with a 5 ohm 5 watt power resistor, and the 3.3V line with a 10 ohm 2 watt power resistor.
The ATX12V spec v1.1 (circa 2000) specifies a minimum load of 0.1 amp on the 5V line and 0.3 amp on the 3.3V line. This corresponds to a 50 ohm 1 watt resistor on the 5V line, and 10 ohm 2 watt power resistor on the 3.3V line.
The ATX12V spec v2.2 (circa 2006) specifies minimum load currents of 1 amp on the +12V line, 0.3 amp on the 5V line, and 0.5 amp on the 3.3V line. A 12 ohm 16 watt power resistor (such as TE Connectivity p/n 7-1625966-9 ) would suffice on the +12 line, with a 16 ohm 2 watt resistor on the 5V line and a 6.2 ohm 2 watt resistor on the 3.3V line.
For other versions of these and other supplies, check the supply manufacturer's specification for the minimum load ratings.
I've rounded down resistor values and rounded up the resistor power ratings above to give a little bit of margin and reasonable life. Don't forget that a 12 ohm 16 watt power resistor is going to get warm in the continuous operation, so should be mounted in air flow.
The other caution is to add a fuse or circuit breaker in series with each of the output jacks.
The ATX supplies are designed to be able to provide a lot of power - 20 amps or more on the 5 volt line, for example, which is likely far more than your intended load. This is enough to allow a miswired circuit being powered to seriously overheat or start a fire. (Think how hot a 100 watt light bulb gets - some of the ATX outputs can double that power.) You should use a fuse or circuit breaker value in comparable to a little more than your expected maximum load.
03 November 2013
|The same model vacuum sealer I bought.|
The reason I purchased it was when I first tried the sous vide cooker it was obvious that having the food in a vacuum sealed bag would make life much easier. The first time I used the cooker I put the steaks into a normal gripseal bag, tried to suck out as much air as possible and then put it in the cooker. Not ideal, but the best I could do whilst lacking a vacuum sealer. As I knew the seal wasn't perfect I left the steaks in for two hours instead of one to make sure they were cooked through, They were cooked perfectly and tasted amazing, but the outside had dark and pink patches prior to frying. Also, the bag filled up with air again and the bags eventually floated.
|Vacuum sealed steaks ready to go in the sous vide cooker.|
For correct sous vide cooking the food should be vacuum sealed so that the water bath is able to get its heat to every part of the meat.
The picture on the right shows two steaks that I did today in the vacuum sealer. They will be cooked in the sous vide cooker later today for dinner so I will be able to compare how these cook compared to the first time. I will also try cooking them for a shorter time period this time around as they are vacuum sealed and so the heat will transfer to the meat more efficiently. I have also bought a cheap steak this time, the cheapest one I could find in the thickness I wanted. On the first steak I cooked even the parts that are usually chewy were soft and tender so i'm convinced that steaks done the sous vide way will always be soft and tender even if the original steak was on the tough side. I will let you know what they taste like later today once they are inside my belly.
21 October 2013
04 October 2013
|Me & my astro gear - Brecon Beacons Astrocamp, Sept 2013|
As you can see in the picture I am providing the motor with 6.2 volts. The motor is a 3.15v motor. However, that's 3.15v per coil and so double that is needed to get it going. Powering it with just 3.15v volts and it goes nowhere. When running continuously it was using about 500ma.
Below is an example video showing the motor in micro-stepping mode. it is doing 1/8th micro-steps controlled by an EasyDriver 3.1 motor control board. The motor is a 3.15v Sanyo stepper motor salvaged from a printer or scanner. I am running it at 6.2v (3.1v per coil) and have dialled down the ED3.1 so it is being given no more than 100-150mA. Any less and it stalls and any more and it gets too hot. This current is enough to give me the torque I need. Next I am prototyping the circuit and testing it out. I will post an update soon.
With a steak for example, you will usually have a temperature gradient across the meat resulting in a pink centre and increasingly darker and cooked meat towards the edge. With sous vide cooking, the steak is cooked exactly to your specifications throughout the meat evenly. You then finish off the crust of the steak quickly with a blowtorch or in a pan.
However, sous vide cookers for domestic use are very expensive indeed. But, with a bit of time and not a great deal of effort you can make your own for a fraction of the price. Many people hack slow cookers, crock pots or rice cookers into DIY Sous Vide cookers. I happen to own a slow cooker that rarely gets used so I thought I would see if I could repurpose it into a Sous Vide cooker to make the perfect steaks.
So the first thing to do was to find out if the slow cooker could reach the temperatures necessary for cooking sous vide style. Typically you want temperatures ranging between 50-60°C for the perfect steak and up to 80° for other items. So I had a DS18B20 temperature probe lying around so I hooked it up to an Arduino and set it to take a temperature reading every 5 minutes and print that to the serial monitor. That way I could see over time how long it took to get to temperature and if it could reach at least the temperatures necessary for a perfect steak.
Over the next 2 hours the cold water I put into the pot was heated slowly up to around 65°C so I knew it would be ideal for how I like my steak (rare). I decided to leave it on overnight and see just how hot it got. The next morning the temperature was just over 97°C, which was a surprise.
So, I now know that the cooker can be used to cook meat sous vide. All I need to do next is to create a control unit that keeps the water bath at the exact temperature necessary. I will work on that at some point in the not too distant future and will give you all an update.